Dynamic Programing-Global Alignment
Dynamic Programing-Global Alignment
Dynamic Programming
• The two sequences are arranged in a matrix form with A+1columns and B+1rows.
• 1st column and 1st row will be empty.
• Fill first block with zero.
• Then fill 1st row and 1st column with gap penalty multiples.
• While filling the matrix there are three possible values
• Horizontal: score+gap penalty
• Vertical: score+gap penalty
• Diagonal: score+(match score/mismatch score)
Sequence 1: AAAC A A A C
Sequence 2: AGC
0 -2 -4 -6 -8
A -2 1 -1 -3 -5
G -4 -1 0 -2 -4
C -6 -3 -2 -1 -1
Match score = 1
Mismatch score=-1
Gap penalty = -2
A A A C
0 -2 -4 -6 -8
0 -2 -4 -6 -8
AAAC AAAC
AG- C AGC-
Backward traceback
In backward tracking we have to move from last cell (lower corner) and follows arrow from
which cell the current cell’s values come from and go ahead.
There are 2 rules for it
1. If the value come from column, we will have to write two sequences
2. If value come from horizontal or vertical, then we will have to write perpendicular and
gap to other side.
Align the following sequences using Needleman Wunsch algorithm
GCACCT
GACCT
Match score = 1
Mismatch score=-1
Gap penalty = -2
Smith-Waterman algorithm for Local sequence alignment
The basic steps for the algorithm are similar to that of Needleman-Wunsch algorithm.
The steps are:
1. Initialization of a matrix.
2. Matrix Filling with the appropriate scores.
3. Trace back the sequences for a suitable alignment.
To study the Local sequence alignment, consider the given below sequences.
CGTGAATTCAT (sequence#1 or A)
GACTTAC (sequence #2 or B)
Let,
Match score=1
Mismatch score =0
Gap penalty=0
The two sequences are arranged in a matrix form with A+1columns and B+1rows. The values in the first row
and first column are set to zero as shown in Figure 1.
Variables used:
i,j describes row and columns.
M is the matrix value of the required cell (stated as Mi,j)
S is the score of the required cell (Si, j)
W is the gap alignment