Docsity

Bioinformatics 1: Dynamic Programming Algorithm with Affine Gap Penalties and Alignment - , Study notes of Biology

Partial preview of the text

Download Bioinformatics 1: Dynamic Programming Algorithm with Affine Gap Penalties and Alignment - and more Study notes Biology in PDF only on Docsity!

Bioinformatics 1: lecture 5

Dynamic Programming Algorithm, continued End gaps Affine versus linear gap penalties Gloabl, local-global and local alignment SeqLab: using GenBank Features Seqlab: optimizing parameters for BestFit

Thinking about gaps

  • Each gap represents an evolutionary event (duplication, polymerase stutter, deletion/ligation, etc.)
  • If the alignment has "evolutionary distance" meaning, then the gap penalty score should be proportional to the number of gaps.
  • Two problems: What about long gaps versus short gaps? Are they equally probable? What about gaps at the ends of the sequence? How many evolutionary events took place there?

Linear versus Affine gap penalty linear gap penalty affine gap penalty number of gaps number of gaps Gap penalty for the whole sequence is just the number of gaps times a constant. Gap penalty for the whole sequence is the affine function. N(gap initiation penalty) + E(gap extension penalty)

Affine gap penalty scoring AGGCTACT~T~TCA GGCTACTATATCA AGGCTACTTT~~CA GGCTACTATATCA gap initiation = -5 gap extension = -

Affine gap penalty worksheet

M = match matrix I = insertion matrix D = deletion matrix scores for alignments currently in a match state scores for alignments with gap in first sequence. scores for alignments with gap in second sequence. M(i,j) is the max over three diagonal arrows I(i,j) is the max over three down arrows D(i,j) is the max over three right arrows A D P Q F G A K L K L D Q F G P A K L K L D Q F G P A K L K L D Q F G P A D P Q F G A D P Q F G Note: I wrote the sequences in the gap rows!!

Does gap to gap make sense???

Special rules may apply for going from I to D and D to I. AGGCTACT~TATCA GGCTACTA~ATCA If you think this alignment does not make sense, then D to I and I to D can simply be disallowed in the DP algorithm. Most programs do this. [Exception: For a global alignment, D-to-I or I-to-D arrows are allowed at the ends of alignments because there is no other way to complete the matrix.]

Affine gap penalty worksheet

M = match matrix I = insertion matrix D = deletion matrix scores for alignments currently in a match state scores for alignments with gap in first sequence. scores for alignments with gap in second sequence.

M

M

M

D

I M

I

I

I

M

M

Traceback

The traceback is a sequence of M I or D , but this is NOT the traceback of the letters. Instead it is a traceback of the location of the letters (which matrix they are in), since the location (the matrix) defines the direction of the next arrow.

MIIIIMDMMMD

A ~ ~ ~ ~ D P Q F G ~

A K L K L D ~ Q F G P

How to NOT penalize end gaps

G T T C A G C T T T C A C T

First: Ignore starting gap penalties , set gap rows to zero (keep the traceback arrows, though).

How to NOT penalize end gaps

G T T C A G C T T T C A C T

Second: Start the traceback with the MAX score at the end of either sequence. (i.e. last row, or last column)

Global in one sequence, local in the other

If we penalize end gaps in sequence 1 but not in sequence 2, we are asking for an alignment that contains all of sequence 1 within sequence 2.

G T T C A G C T T

T

C

A

C

T

Global, global-local, and local alignment

  • Global alignment (with end gaps) requires that all 4 termini are counted. In general, the two sequences be about the same length.
  • Global-local alignment (no end gaps in 1 or both seqs) requires that one of the two sequences be completely contained in the other or that 2 or the 4 the termini be included.
  • Local alignment finds subsequences in both. Does not require that the termini be included in the alignment. The choice of alignment method makes a statement about how the sequences are related. Was one sequence inserted into the other?

Local Alignment

...is the most generally applicable alignment method, since it has the fewest assumptions.

The optimal alignment may be no alignment

If the maximum score in the alignment matrix is < 0., then the optimal local alignment has score = 0 and looks like this:

ATSFM~~~~~~~

~~~~~PGTSFEP