next up previous
Next: Tabular computation of optimal Up: Pairwise Alignment Previous: Models for Inexact Matching

     
Global Alignment


\begin{dfn}{\rm Informally, an {\em alignment} of two strings $S$\space and $T$\...
...matched to a unique
character or a unique space in the other string.
} \end{dfn}

Example 2.5   Given a string "ACBCDDDB" and a string "CADBDAD", one possible alignment will be:
                    A C - - B C D D D B
                      |     |   | | |
                    - C A D B - D A D -

A more useful than the general case is the following problem:

Problem 2.6   INPUT: Two strings S and T |T|=m, |S|=n (n and m are of roughly the same magnitude)
QUESTION: Establish the optimal alignment according to the alignment quality (or scoring) which will be defined next.

 
\begin{ntt}{\rm Let $ \sigma(a,b)$\space be the score (weight) of the
alignment of character a with character b. (including spaces)} \end{ntt}
 
\begin{ntt}{\rm Let $ V(i,j)$\space be the optimal score of the alignment
of $S_...
...ce and $T_1 \ldots T_j$\space ($0 \leq i \leq n , 0 \leq j \leq m$ ).} \end{ntt}

Lemma 2.7   V(A,B) has the following properties:

\begin{eqnarray*}{\em Base\; conditions:} \hspace{2cm}
V(i,0) &=& \sum_{k=0}^i{...
...gma(S_i, - )\\
V(i ,j-1)+\sigma( - ,T_j)
\end{array} \right.
\end{eqnarray*}


Proof:Base condition:
The only way to align the first i elements of the string S with zero elements of the string T is to align each of the elements with a space in the string T. The score for that operation is by definition $\sigma(S_i, -)$ for each of the i elements and $V(i,0) = \sum_{k=0}^i{\sigma(S_k, -)} $ for the total sum.

Similarly, the expression $V(0,j) = \sum_{k=0}^j{\sigma(-, T_k)} $ follows from matching the first j elements of T with i blanks in string S.

Proof:Recurrence relation:
Let us consider an optimal alignment of $S_1 \ldots S_i$ and $T_1 \ldots T_j$. We shall distinguish between three cases according to the three possible scoring for the three operations are:



 
next up previous
Next: Tabular computation of optimal Up: Pairwise Alignment Previous: Models for Inexact Matching
Itshack Pe`er
1999-01-03