Sequence Alignment
A pairwise sequence alignment lines up two sequences to show where they are the same, where they differ and where one has an insertion or deletion relative to the other. Alignment is how scientists measure relatedness, find conserved regions and see the effect of a mutation.
How scoring works
Every aligned pair of letters earns or loses points. Matches score positive. For DNA mismatches score negative. For proteins a substitution matrix such as BLOSUM62 rewards swaps evolution commonly accepts (leucine ↔ isoleucine is positive) and penalises unusual ones (alanine ↔ tryptophan is negative). The aligner finds the arrangement with the highest total score.
Gaps
Insertions and deletions appear as gaps (−). One long indel is more likely than many scattered ones, so most aligners use affine gap penalties: a larger cost to open a gap and a smaller one for each extra position in it.
Reading the result
Identity is the percentage of alignment columns where both sequences have the same letter. Score depends on the scoring system and the length, so it can only be compared with other alignments made with the same settings. Below about 25–30% identity two protein sequences are in the "twilight zone", where a real relationship is hard to tell apart from chance.
How Aaron's Archive does it
| Item | What the tool does |
|---|---|
| Algorithm | Gotoh's dynamic programming with affine gaps, in local and global mode. It was checked against Biopython's pairwise aligner on hundreds of alignments and gives identical scores. |
| DNA scoring | +2 for a match, −3 for a mismatch, a gap of length k costs 5 + 2k (the BLASTN defaults). |
| Protein scoring | BLOSUM62, a gap of length k costs 11 + k. |
| Identity | Matches ÷ alignment length (gap columns included) × 100. |
| Limits | Both sequences of the same kind (nucleotide with nucleotide, protein with protein), up to 10,000 residues each. |
Pitfalls
The tool reports a raw score and identity but no statistical significance; use BLAST to judge whether a similarity is more than chance. Letters other than A, C, G and T (such as N) count as zero in a DNA alignment, and amino-acid letters outside the 20 standard ones score −1 against everything.
Common questions about sequence alignment
What is the difference between global and local alignment?
Global alignment (Needleman-Wunsch) lines up both sequences from end to end. Local alignment (Smith-Waterman) finds only the best matching region, so it suits sequences that share just a domain.
What is the difference between identity and similarity?
Identity counts positions with exactly the same residue. Similarity also counts substitutions between chemically alike amino acids, as scored by a matrix such as BLOSUM62.
Why do gaps cost more to open than to extend?
One insertion or deletion event can add several residues at once, so a long gap is only a little less likely than a short one. The affine penalty (a large cost to open, a smaller one per extra residue) reflects that.
Where can I align two sequences?
Use the pairwise sequence alignment tool.