A GUI application implementing two fundamental bioinformatics algorithms for sequence alignment:
- Smith-Waterman (Local Alignment)
- Needleman-Wunsch (Global Alignment)
- Intuitive graphical interface for entering DNA/protein sequences
- Adjustable scoring parameters (match, mismatch, gap penalties)
- Side-by-side alignment display
- Dynamic scoring matrix visualization
- Support for both local and global alignment strategies
pip install numpyNote: tkinter comes built-in with Python on most systems.
python sequence_alignment_gui.pySequences: Enter DNA or protein sequences (case-insensitive)
- Sequence 1: First sequence to align
- Sequence 2: Second sequence to align
Scoring Parameters:
- Match Score: Points awarded for matching characters (default: 2)
- Mismatch Score: Points deducted for non-matching characters (default: -1)
- Gap Penalty: Points deducted for gap insertion (default: -1)
- Enter your sequences and parameters
- Click "Run Smith-Waterman" for local alignment or "Run Needleman-Wunsch" for global alignment
- View results and scoring matrix below
- Finds the best matching substring between two sequences
- Useful for finding conserved regions in sequences
- Always produces positive scores for high-scoring regions
- Gap penalties never force the algorithm to continue
- Aligns entire sequences from start to end
- Useful when comparing complete sequences
- Requires initialization of first row and column
- Guarantees alignment of entire sequences with gaps as needed
Try these sequences with default parameters:
Sequence 1: AGCTAG
Sequence 2: AGTAG
Expected Smith-Waterman result: Score = 9
Expected Needleman-Wunsch result: Score = 9
sequence_alignment_gui.py- Main GUI application (run this one)test_alignment.py- Algorithm test suiteREADME.md- This documentation
- Time Complexity: O(m × n) where m and n are sequence lengths
- Space Complexity: O(m × n) for dynamic programming matrices
- Both algorithms use dynamic programming matrices
- The matrix display shows all intermediate scores
- Alignment visualization uses:
|for exact matches*for mismatches-for gaps
You can modify scoring parameters for specific use cases:
- DNA matching (ATGC): Default parameters work well
- Protein sequences: Adjust match/mismatch based on BLOSUM or PAM matrices
- Stricter/looser alignment: Adjust gap penalties
- Open Command Prompt or Terminal
- Navigate to the Sequence_Alignment_Project folder
- Run:
pip install numpy(first time only) - Run:
python sequence_alignment_gui.py - Enter sequences and click buttons to run alignments