Pairwise Alignment
Global Needleman-Wunsch alignment with score, identity, and gap statistics.
The Pairwise Alignment Tool performs global (Needleman-Wunsch) sequence alignment between two DNA, RNA, or Protein sequences to calculate optimal alignment score, identity percentage, and gap distribution.
Free, runs in your browser. Nothing you enter is uploaded.
How to use it
- Input Sequence A and Sequence B.
- Adjust match, mismatch, and gap penalty parameters.
- Click Align to compute dynamic programming matrix and alignment score.
What you enter
- Sequence 1 and Sequence 2 (DNA, RNA, or Protein)
- Gap opening penalty (default: 8) and gap extension penalty (default: 2)
What you get
- Formatted Pairwise Alignment with matching symbols
- Identical Residues Count and Percentage Identity (%)
- Total Gap Count and Percentage Gap Ratio (%)
Formula
Score Matrix F(i,j) = max[ F(i-1, j-1) + s(x_i, y_j), F(i-1, j) - d, F(i, j-1) - d ]
Calculates the globally optimal alignment across the entire length of both sequences using dynamic programming with affine gap penalties. Uses unit scoring for nucleic acids and BLOSUM62 matrix for proteins.
Example: Comparison of Wild-Type vs Mutant Protease Fragment
Input: Seq 1: MASNFTQFVLVD | Seq 2: MASNATQFVL-D | Matrix: BLOSUM62
Result: Identity: 83.3% (10/12 residues) | Gaps: 8.3% (1 gap) | Score: 48
High conservation with a single conservative substitution (F5A) and one deletion at residue 11.
Questions
How does the Needleman-Wunsch algorithm work?
Needleman-Wunsch is a dynamic programming algorithm that fills a 2D matrix of scores for sequence character matches, mismatches, and gaps to find the globally optimal alignment.
Limitations
- Global alignment forces full-length alignment; if sequences differ significantly in length, local alignment (Smith-Waterman) or semi-global alignment is more appropriate.
- Sequences exceeding 10,000 residues require substantial browser memory for dynamic programming matrix allocation.
References
- Needleman SB, Wunsch CD (1970) J Mol Biol 48(3):443-453.
- Durbin R et al. (1998) Cambridge University Press.
Related reading
- Smith-Waterman Dynamic Programming Algorithm
- Structure-Based Phylogenetic Alignment
- Gene-Level Alignment of Single-Cell Trajectories
More Alignment
All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.