- Given two strings of length n, how many possible alignments are there?
- Example: AT & CAT
For this example:
gap penalty = -4
mismatch = -1
match = 2
Given two strings
Put them on two edges of a table (with the fronts near each other! and a 0 in between) like this:
T
A
0
C A T
Fill in the cells straight to the right and up from the 0 with increasing gap penalties
T -8
A -4
0 -4 -8 -12
C A T
For each of the blank cells, there are three ways you might get there:
1) Horizontally or
2) Vertically, both create a gap, so score change is the gap penalty
3) Diagonally: advances one in each string; score change is either match or mismatch
Select the one with the highest score and fill that in.
Deduce the route by which you arrived at the upper right cell.
Use it to generate the optimal alignment.
- TATA & AT