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

Seqlab: optimizing parameters for BestFitSeqLab: using GenBank FeaturesGloabl, local-global and local alignmentAffine versus linear gap penaltiesEnd gapsDynamic Programming Algorithm, continued

Seqlab: optimizing parameters for BestFitSeqLab: using GenBank FeaturesGloabl, local-global and local alignmentAffine versus linear gap penaltiesEnd gapsDynamic Programming Algorithm, continued

Thinking about gaps

•Two problems:number of gaps.then the gap penalty score should be proportional to the•If the alignment has "evolutionary distance" meaning,polymerase stutter, deletion/ligation, etc.)•Each gap represents an evolutionary event (duplication,

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

times a constant.the number of gapswhole sequence is justGap penalty for the

E(gap extension penalty)N(gap initiation penalty) +affine function.whole sequence is theGap penalty for the

Affine gap penalty scoring

AGGCTACT~T~TCA

GGCTACTATATCA

AGGCTACTTT~~CA

GGCTACTATATCA

gap

initiation

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.

the max M(i,j) is

over three diagonal arrows

three downmax overI(i,j) is the

arrows

the maxD(i,j) is rightthreeover

arrows

A D P Q F G

P G F Q D L K L K A

P G F Q D L K L K A

P G F Q D L K L K A

A D P Q F G A D P Q F G

Note: I wrote the sequences

in the gap rows!!

Special rules may apply for going fromDoes gap to gap make sense???

I

to

D

and

D

to

I

AGGCTACT~TATCA

GGCTACTA~ATCA

D to I and I to D can simply be If you think this alignment does not make sense, then

disallowed

in the DP

complete the matrix.]allowed at the ends of alignments because there is no other way to[Exception: For a global alignment, D-to-I or I-to-D arrows arealgorithm. Most programs do this.

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

M

I

I I I M

M

Traceback

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

A^ MIIIIMDMMMD

~ D P Q

F G ~

A K L K

L D ~ Q

F G P

G How to NOT penalize end gaps

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).

G How to NOT penalize end gaps

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)

  • included.contained in the other or that 2 or the 4 the termini berequires that one of the two sequences be completely 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

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

The

optimal

alignment may be

no alignment

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

~~~~~PGTSFEP ATSFM~~~~~~~