Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Authors: Francisco Picazo, Dalila Zovko Date: October 10, 2025 TO DO: 1 CHANGE THE 'FIRST LENGTH' AND 'SECOND LENGTH' TO BE 'PRIMER LENGTH' AND MAKE IT SO THAT THIS VALUE CAN BE A RANGE AND IT APPLIES TO BOTH FIRST AND SECOND LENGTH. ONE INPUT, TWO OUTPUTS (TWO LENGTHS BEFORE AND AFTER). 2 CHANGE 'MIDDLE LENGTH' TO BE TWO SEQUENCES, ONE BEING 'UNIVERSAL TARGET SEQUENCE' WHICH IS CONSERVED, THE SECOND BEING 'UNIQUE TARGET SEQUENCE'. THESE NEED TO BE RIGHT NEXT TO EACH OTHER, BUT, EITHER CAN BE FIRST, SO MAKE SURE 'UNIVERSAL TARGET SEQUENCE' CAN BE EITHER THE FIRST OR SECOND ONE. 3 NEW ADDITION: 'MAX DISTANCE BETWEEN PRIMER AND TARGET SEQUENCES', THIS IS HOW FAR THE 'PRIMER LENGTH' CAN BE FROM THE MIDDLE SECTIONS 'UNIVERSAL TARGET SEQUENCE' AND 'UNIQUE TARGET SEQUENCE'. 4 FOR SIMPLICITY, THIS IS HOW AN EXAMPLE SHOULD LOOK: [PRIMER 20-30NT] [SPACE 0-200NT] [UNIVERSAL TARGET SEQUENCE OR UNIQUE TARGET SEQUENCE][UNIVERSAL TARGET SEQUENCE OR UNIQUE TARGET SEQUENCE][SPACE 0-200NT][PRIMER 20-30NT]

DNA_Sequencing

What this tool does

The file find_regions.py scans a CLUSTAL Omega multiple-sequence alignment and finds stretches of DNA that follow this pattern:

  1. Several consecutive alignment columns where every sequence shows the exact same nucleotide (no gaps, no differences).
  2. A middle block where at least one sequence differs (a mutation, gap, or ambiguous base).
  3. Another block of perfectly conserved columns.

Every matching stretch is reported with 1-based column positions (the first column in the alignment is position 1) so that you can line up results with the alignment file you opened in your viewer.

Helpful terminology

  • Script: a small program you run with the Python interpreter. Think of it as a recipe of instructions stored in a text file.
  • Terminal / Command Prompt: the place where you type commands (for example, “Terminal” on macOS or “Command Prompt” / “PowerShell” on Windows).
  • Alignment file: the .aln or .aln-clustal_num file you already have.

Before you start

  • Install Python 3.8 or newer. On macOS and Linux it is often available as python3. On Windows you can download it from https://www.python.org.
  • Know where the alignment file lives on your computer (note the folder path).
  • Download or clone this project so that find_regions.py is stored somewhere you can reach from the terminal.

Running the tool (step by step)

  1. Open a terminal window.

    • macOS: open Spotlight (⌘+Space), type Terminal, press Enter.
    • Windows: press the Windows key, type cmd or PowerShell, press Enter.
    • Linux: search for “Terminal” in your application menu.
  2. Move to the folder that contains find_regions.py.

    • Use the cd command (short for “change directory”).
    • Example on macOS/Linux:
      cd /Users/yourname/Downloads/DNA_Sequencing
    • Example on Windows:
      cd C:\Users\yourname\Downloads\DNA_Sequencing
    • If you prefer, you can skip this step and give Python the full path to the script in the next command.
  3. Choose three lengths.

    • first_length: number of consecutive conserved columns to find first.
    • middle_length: size of the region that must contain at least one change.
    • second_length: number of consecutive conserved columns to find after the middle region.
  4. Run the script.

    • Use python3 on macOS/Linux; on Windows the command may be python.
    • Basic command structure:
      python3 find_regions.py <alignment_file> <first_length> <middle_length> <second_length>
    • If your alignment file is in another folder, provide the full path. Example:
      python3 find_regions.py sample.aln-clustal_num 20 14 20
      or, from any folder:
      python3 /full/path/to/find_regions.py /full/path/to/sample.aln-clustal_num 20 14 20
  5. Read the output.

    • The script lists every pattern that matches your lengths.
    • For each match you’ll see:
      • A “First conserved region” line with start–end positions and the aligned bases for every sequence.
      • A “Mutation region” section showing the differing block.
      • A “Second conserved region” section showing the conserved columns after the mutation block.
    • If nothing matches, you’ll see No matching regions found..

Extra tips

  • Unsure about the exact command? Run python3 find_regions.py -h to see the help message and parameter descriptions.
  • On Windows, if python3 is not recognized, try python instead.
  • You can copy and paste commands into the terminal. Make sure to adjust the paths so that they point to the correct folders on your computer.
  • If you work with multiple Python projects, consider creating a virtual environment:
    python3 -m venv .venv
    source .venv/bin/activate  # Windows PowerShell: .venv\Scripts\Activate.ps1

About

Python CLI that scans CLUSTAL multiple-sequence alignments for conserved→mutated→conserved motifs.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages