Download Dynamic Programming in Bioinformatics: Sequence Alignment - Prof. Drena Leigh Dobbs and more Lab Reports Bioinformatics in PDF only on Docsity!
BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 1
BCB 444/
Lecture 5 Dynamic Programming #5_Aug BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 2
Required Reading
( before lecture) Mon Aug 27 - for Lecture # Pairwise Sequence Alignment
- Chp 3 - pp 31- Wed Aug 29 - for Lecture # Dynamic Programming
- Eddy: What is Dynamic Programming? 2004 Nature Biotechnol 22: Thurs Aug 30 - Lab #2: Databases, ISU Resources & Pairwise Sequence Alignment Fri Aug 31 - for Lecture # Scoring Matrices and Alignment Statistics
- Chp 3 - pp 41- BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 3
Review: Chp 2- Biological Databases
Introduction to Biological Databases
- What is a Database?
- Types of Databases
- Biological Databases
- Pitfalls of Biological Databases
- Information Retrieval from Biological
Databases
BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 4
Types of Databases
3 Major types of electronic databases:
1. Flat files - simple text files - no organization to facilitate retrieval 2. Relational - data organized as tables ("relations") - shared features among tables allows rapid
search
3. Object-oriented - data organized as "objects" - objects associated hierarchically BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 5
Examples of Biological Databases
1- Primary
- DNA sequences
- GenBank - USA
- European Molecular Biology Lab - EMBL
- DNA Data Bank of Japan - DDBJ
- Structures (Protein, DNA, RNA)
- PDB - Protein Data Bank
- NDB - Nucleic Acid Data Bank BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 6
Examples of Biological Databases
2- Secondary
- Protein sequences
- Swiss-Prot, TreEMBL, PIR
- these recently combined into UniProt 3- Specialized
- Species-specific (or "taxonomic" specific)
- Flybase, WormBase, AceDB, PlantDB
- Molecule-specific, disease-specific See: http://www.oxfordjournals.org/nar/database/c/
BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 7 BEWARE! SUMMARY:
#2- Biological Databases
Who was that Icelandic fellow? BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 8
Chp 3- Sequence Alignment
SECTION II SEQUENCE ALIGNMENT
Xiong: Chp 3
Pairwise Sequence Alignment
- Evolutionary Basis
- Sequence Homology versus Sequence Similarity
- Sequence Similarity versus Sequence Identity
- Methods
- Scoring Matrices
- Statistical Significance of Sequence Alignment Adapted from Brown Altman, Fernandez-Baca and (^) ,Caragea Batzoglou, 2007, with some slides, Craven, Hunter, Page from:. BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 9
Motivation for Sequence Alignment
" Sequence comparison lies at the heart of bioinformatics
analysis." Jin Xiong Sequence comparison is important for drawing functional & evolutionary inferences re: new genes/proteins Pairwise sequence alignment is fundamental; it used to:
- Search for common patterns of characters
- Establish pair-wise correspondence between related sequences Pairwise sequence alignment is basis for:
- Database searching (e.g., BLAST)
- Multiple sequence alignment (MSA) BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 10
Homology
Homology has a very specific meaning in evolutionary & computational biology - & term is often used incorrectly For us: Homology = similarity due to descent from a common evolutionary ancestor
But, HOMOLOGY ≠ SIMILARITY
When 2 sequences share a sufficiently high degree of sequence similarity (or identity), we may infer that they are homologous We can infer homology from similarity (can't prove it!) BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 11
Orthologs vs Paralogs
2 types of homologous sequences:
- Orthologs - "same genes" in different species;
- result of common ancestry
- corresponding proteins have "same" functions (e.g., human α-globin & mouse α-globin)
- Paralogs - "similar genes" within a species;
- result of gene duplication events
- proteins may (or may not) have similar functions (e.g., human α-globin & human β-globin) A is the parent gene Speciation leads to B & C Duplication leads to C’ B and C are Orthologous C and C’ are Paralogous Speciation Duplication B A C C' BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 12
Sequence Homology vs Similarity
- Homologous sequences - sequences that share a common evolutionary ancestry
- Similar sequences - sequences that have a high percentage of aligned residues with similar physicochemical properties (e.g., size, hydrophobicity, charge) IMPORTANT:
- Sequence homology :
- An inference about a common ancestral relationship, drawn when two sequences share a high enough degree of sequence similarity
- Homology is qualitative
- Sequence similarity :
- The direct result of observation from a sequence alignment
- Similarity is quantitative; can be described using percentages
BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 19
Avoiding Random Alignments with a
Scoring Function
- Introducing too many gaps generates nonsense alignments: s--e-----qu---en--ce sometimesquipsentice
- Need to distinguish between alignments that occur due to homology and those that occur by chance
- Define a scoring function that accounts for mismatches and gaps Scoring Function (F): e.g. Match: + w + Mismatch: - x 0 Gap: - y - F = w(#matches) + x(#mismatches) + y(#gaps) BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 20
Not All Mismatches are the Same
- Some amino acids are more "exchangeable" than others (physicochemical properties are similar) e.g., Ser & Thr are more similar than Trp & Ala
- Substitution matrix can be used to introduce "mismatch costs" for handling different types of substitutions
- Mismatch costs are not usually used in aligning DNA or RNA sequences, because no substitution is "better" than any other (in general) BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 21
Substitution Matrix
s(a,b) corresponds to score of aligning character a with character b Match scores are often calculated based on frequency of mutations in very similar sequences (more details later) BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 22
Methods
- Global and Local Alignment
- Alignment Algorithms
- Dot Matrix Method
- Dynamic Programming Method
- Gap penalities
- DP for Global Alignment
- DP for Local Alignment
- Scoring Matrices
- Amino acid scoring matrices
- PAM
- BLOSUM
- Comparisons between PAM & BLOSUM
- Statistical Significance of Sequence Alignment BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 23
Global vs Local Alignment
Local alignment
- Finds local regions with highest similarity between 2 sequences
- Aligns these without regard for rest of sequence
- Sequences are not assumed to be similar over entire length Global alignment
- Finds best possible alignment across entire length of 2 sequences
- Aligned sequences assumed to be generally similar over entire length BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 24
Global vs Local Alignment - example
S = CTGTCGCTGCACG
T = TGCCGTG
CTGTCGCTGCACG
- TGCCG-T----G
Global alignment CTGTCGCTGCACG
CTGTCGCTGCACG
- TGCCG-TG----
Local alignment Which is better?
BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 25
Global vs Local Alignment
Which should be used when? Both are important but it is critical to use right method for a given task! Global alignment:
- Good for: aligning closely related sequences of similar length
- Not good for: divergent sequences or sequences with different lengths Local Alignment:
- Good for: searching for conserved patterns (domains or motifs) in DNA or protein sequences
- Not good for: generating an alignment of closely related sequences Global and local alignments are fundamentally similar; they differ only in optimization strategy used to align similar residues BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 26
Alignment Algorithms
3 major methods for pairwise sequence alignment:
- Dot matrix analysis
- Dynamic programming
- Word or k-tuple methods (later, in Chp 4) BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 27
Dot Matrix Method (Dot Plots)
- Place 1 sequence along top row of matrix
- Place 2nd sequence along left column of matrix
- Plot a dot each time there is a match between an element of row sequence and an element of column sequence - For proteins, usually use more sophisticated scoring schemes than "identical match"
- Diagonal lines indicate areas of match
- Contiguous diagonal lines reveal alignment; "breaks" = gaps (indels)
A
C
A
C
G
A C G C G
BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 28
Interpretation of Dot Plots
When comparing 2 sequences:
- Diagonal lines of dots indicate regions of similarity between 2 sequences
- Reverse diagonals (perpendicular to diagonal) indicate inversions
- What do similar patterns mean when comparing a sequence with itself (reverse complement)?
- e.g.: Reverse diagonals crossing diagonals (X's) indicate palindromes Exploring Dot Plots BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 29
Dot Matrix Variations
Compare 2 sequences
- Identify matching regions
- Identities for DNA seqs
- Similarities for protein seqs Compare sequence with itself
- Identify repeated regions
- Identify inverted repeats
- Identify palindromes For long sequences?
- Too many dots! Noisy!
- Instead of per "residue," plot one dot per "window" of n matching residues to reduce noise BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 30
Strengths & Weakneses of Dot Plots
Strengths:
- Fast and easy
- Allows direct visual identification of regions of similarity
- Repeats, inversions, etc. are readily apparent
- Displays all possible matches Weaknesses:
- Doesn't generate full alignment - user must "connect the diagonals"
- No statistical assessment of quality of alignment (score)
- Impractical and noisy for long sequences
- Difficult to scale up to muliple alignment
BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 37
Key Idea
Score of the best possible alignment that ends at a given pair of positions ( i,j) in two sequences is the score of the best alignment previous to those two positions PLUS the score for aligning those two positions Next best alignment = previous best + local best BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 38
Problem Formulation and Notations
Given two sequences (strings)
- X = x 1 x 2 …xN of length N x = AGC N = 3
- Y = y 1 y 2 …yM of length M y = AAAC M = 4 Construct a matrix with ( N+1) x ( M+1) elements, where S( i,j) = score of best alignment of x[1..i]=x 1 x 2 …xi with y[1..j]=y 1 y 2 …yj S(2,3) = score of best alignment
of AG ( x 1 x 2 ) to AAA ( y 1 y 2 y 3 )
x 1 x 2 x 3 y 1 y 2 y 3 y 4 BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 39
Dynamic Programming
4 Components:
- Recursive definition for optimal score
- Matrix for storing optimal scores of subproblems
- Bottom-up approach for filling the matrix, by solving smallest subproblems first
- Traceback of path through matrix to recover the optimal alignment(s) that gave the optimal score BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 40
Global Alignment: Algorithm
! S ( i , j ) = Score of optimal alignment of x1..i and y1..j ! x 1.. i = Prefix of length i of x y 1.. j = Prefix of length j of y BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 41 ! S ( i , j ) = max S ( i " 1 , j " 1 ) + #( Si , Tj ) S ( i " 1 , j ) " $ S ( i , j " 1 ) " $
&^ '
(^ '
S ( i ,0) = " i # $ S ( 0 , j ) = " j # $
Initial conditions: Recursive definition: For 1 ≤ i ≤ n, 1 ≤ j ≤ m: S(i,j) satisfies the following relationships:
Calculating Score of Optimum Alignment
BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 42
Computing the best current score
S(N,M)
S(0,0)= S(i,j) S(i-1,j-1) S(i-1,j) S(i,j-1)
S ( i , j ) = max
S ( i " 1 , j " 1 ) + #( xi , y j )
S ( i " 1 , j ) + $
S ( i , j " 1 ) + $
(^ '
0 0 1 N 1 M
S ( i ,0) = " i # $
S (0, j ) = " j # $
Recursion Initialization
BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 43
What happens at the last step in the
alignment of x[1..i] to y[1..j]?
x 1 x 2... xi-1 xi
y 1 y 2... yj-1 yj
S(i-1,j-1) + σ(xi,yj)
x 1 x 2... xi-1 xi
y 1 y 2... yj —
S(i-1,j) + γ
x 1 x 2... xi —
y 1 y 2... yj-1 yj
S(i,j-1) + γ
xi aligns to yj xi aligns to^ a gap^ yj^ aligns to^ a gap
1 of 3 cases:
BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 44
DP Implementationn - 3 steps:
- Construct sequence vs sequence matrix and fill in from [0,0] to [N,M], the best possible scores for alignments including the residues at [i,j]. Also, keep track of dependencies of scores (in a pointer matrix).
- For a global alignment of the sequences, find the score S(N,M)
- Trace back through pointer matrix to get the optimal alignment. Do this position by position to retrieve alignment of all residues of sequences, including gaps (i.e., repeat alignment calculations in reverse order, following path back through matrix, starting at from position with highest score. BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 45
Example
Case 1: Line up xi with yj x: C A T T C A C y: C - T T C A G i - 1 i j -1^ j x: C A T T C A - C y: C - T T C A G - Case 2: Line up xi with space (^) i - 1 i j x: C A T T C A C - y: C - T T C A - G Case 3: Line up yj with space (^) i j -1 j BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 46 λ C T C G C A G C A
C T T C A C
+10 for match, -2 for mismatch, -5 for space
λ BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 47 λ C T C G C A G C A
C T T C A C
λ Traceback can yield both optimal alignments
BCB 444/544 F07 ISU Dobbs #5 - Dynamic Programming 8/29/07 48
Affine Gap Penalty Functions
Gap penalty = h + gk
where k = length of gap h = gap opening penalty g = gap continuation penalty Can also be solved in O(nm) time using dynamic programming