next up previous
Next: Longest Common Subsequence Up: Gap Penalty Previous: Constant gap weight model

   
Affine gaps penalty

To align strings S, T, consider as usual the prefixes $S_{1 \ldots i}$ of S and $T_{1 \ldots j}$ of T. Any alignment of these two prefixes is one of the following three types:

1.
S ------i
T ------j
alignment of $S_{1 \ldots i}$ and $T_{1 \ldots j}$ where characters S(i) and T(j) are aligned opposite each other. This includes both the case that Si = Tj and that ${S_i \neq T_j}$.

2.
S ------i_ _ _ _ _ _ _
T -------------j

alignment of $S_{1 \ldots i}$ and $T_{1 \ldots j}$ where character Si is aligned to a character strictly to the left of character Tj. Therefore, the alignment ends with a gap in S.

3.
S --------------i
T ------j_ _ _ _ _ _ _ _

alignment of $S_{1 \ldots i}$ and $T_{1 \ldots j}$ where character Si is aligned to a character strickly to the right of character Tj. Therefore, the alignment ends with a gap in T.

 
\begin{ntt}{\rm
We will use ${G(i, j)}$\space to denote the maximum value of any...
...um value of the three terms ${E(i, j)}$ , ${F(i, j)}$ , ${G(i, j)}$ .} \end{ntt}

Hence the base conditions are:

\begin{eqnarray*}V(i, 0) &=& E(i, 0) = W_g + iW_s\\
V(0, j) &=& F(0, j) = W_g + jW_s
\end{eqnarray*}


and the recursive computation of V(i, j) will be:

\begin{displaymath}V(i, j) = \max \{ E(i, j), F(i, j), G(i, j) \}\end{displaymath}

while

\begin{eqnarray*}G(i, j) &=& V(i - 1, j - 1) + \sigma(S_{i}, T_{j})\\
E(i, j) &...
...(i, j) &=& \max \{ F(i - 1, j) + W_s, V(i - 1, j) + W_g + W_s \}
\end{eqnarray*}


The optimal value alignment is the maximum value in the nth row or m column.

Complexity


next up previous
Next: Longest Common Subsequence Up: Gap Penalty Previous: Constant gap weight model
Itshack Pe`er
1999-01-03