Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Sequence Alignment Tool

A GUI application implementing two fundamental bioinformatics algorithms for sequence alignment:

  • Smith-Waterman (Local Alignment)
  • Needleman-Wunsch (Global Alignment)

Features

  • 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

Requirements

pip install numpy

Note: tkinter comes built-in with Python on most systems.

Usage

Run the Application

python sequence_alignment_gui.py

Input Parameters

Sequences: 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)

Running Alignments

  1. Enter your sequences and parameters
  2. Click "Run Smith-Waterman" for local alignment or "Run Needleman-Wunsch" for global alignment
  3. View results and scoring matrix below

Algorithm Differences

Smith-Waterman (Local Alignment)

  • 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

Needleman-Wunsch (Global Alignment)

  • 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

Example

Try these sequences with default parameters:

Sequence 1: AGCTAG
Sequence 2: AGTAG

Expected Smith-Waterman result: Score = 9
Expected Needleman-Wunsch result: Score = 9

Files

  • sequence_alignment_gui.py - Main GUI application (run this one)
  • test_alignment.py - Algorithm test suite
  • README.md - This documentation

Algorithm Complexity

  • Time Complexity: O(m × n) where m and n are sequence lengths
  • Space Complexity: O(m × n) for dynamic programming matrices

Notes

  • Both algorithms use dynamic programming matrices
  • The matrix display shows all intermediate scores
  • Alignment visualization uses:
    • | for exact matches
    • * for mismatches
    • - for gaps

Customization

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

Quick Start

  1. Open Command Prompt or Terminal
  2. Navigate to the Sequence_Alignment_Project folder
  3. Run: pip install numpy (first time only)
  4. Run: python sequence_alignment_gui.py
  5. Enter sequences and click buttons to run alignments

About

Bioinformatics sequence alignment (Smith-Waterman local + Needleman-Wunsch global) with a Tkinter GUI and scoring-matrix visualization

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages