Dynamic-Programming Strategies for Analyzing Biomolecular Sequences.

Slides:



Advertisements
Similar presentations
Fa07CSE 182 CSE182-L4: Database filtering. Fa07CSE 182 Summary (through lecture 3) A2 is online We considered the basics of sequence alignment –Opt score.
Advertisements

Gapped BLAST and PSI-BLAST Altschul et al Presenter: 張耿豪 莊凱翔.
Alignment methods Introduction to global and local sequence alignment methods Global : Needleman-Wunch Local : Smith-Waterman Database Search BLAST FASTA.
Sequence Alignment Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National Taiwan University, Taiwan
Space/Time Tradeoff and Heuristic Approaches in Pairwise Alignment.
Sequence Alignment Storing, retrieving and comparing DNA sequences in Databases. Comparing two or more sequences for similarities. Searching databases.
Heuristic alignment algorithms and cost matrices
Developing Pairwise Sequence Alignment Algorithms Dr. Nancy Warter-Perez.
Sequence Alignment.
Developing Pairwise Sequence Alignment Algorithms Dr. Nancy Warter-Perez June 23, 2005.
Introduction to Bioinformatics Algorithms Sequence Alignment.
Alignment methods and database searching April 14, 2005 Quiz#1 today Learning objectives- Finish Dotter Program analysis. Understand how to use the program.
Developing Pairwise Sequence Alignment Algorithms Dr. Nancy Warter-Perez June 23, 2004.
Alignment methods June 26, 2007 Learning objectives- Understand how Global alignment program works. Understand how Local alignment program works.
Developing Pairwise Sequence Alignment Algorithms Dr. Nancy Warter-Perez May 20, 2003.
Sequence Alignment III CIS 667 February 10, 2004.
Introduction to Bioinformatics Algorithms Sequence Alignment.
Bioinformatics Unit 1: Data Bases and Alignments Lecture 3: “Homology” Searches and Sequence Alignments (cont.) The Mechanics of Alignments.
Sequence Alignments Revisited
Alignment III PAM Matrices. 2 PAM250 scoring matrix.
Bioinformatics Workshop, Fall 2003 Algorithms in Bioinformatics Lawrence D’Antonio Ramapo College of New Jersey.
Developing Pairwise Sequence Alignment Algorithms Dr. Nancy Warter-Perez May 10, 2005.
15-853:Algorithms in the Real World
Alignment methods II April 24, 2007 Learning objectives- 1) Understand how Global alignment program works using the longest common subsequence method.
Developing Pairwise Sequence Alignment Algorithms
Pair-wise Sequence Alignment What happened to the sequences of similar genes? random mutation deletion, insertion Seq. 1: 515 EVIRMQDNNPFSFQSDVYSYG EVI.
CISC667, S07, Lec5, Liao CISC 667 Intro to Bioinformatics (Spring 2007) Pairwise sequence alignment Needleman-Wunsch (global alignment)
Evolution and Scoring Rules Example Score = 5 x (# matches) + (-4) x (# mismatches) + + (-7) x (total length of all gaps) Example Score = 5 x (# matches)
Dynamic-Programming Strategies for Analyzing Biomolecular Sequences Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National.
Dynamic Programming Method for Analyzing Biomolecular Sequences Tao Jiang Department of Computer Science University of California - Riverside (Typeset.
Amino Acid Scoring Matrices Jason Davis. Overview Protein synthesis/evolution Protein synthesis/evolution Computational sequence alignment Computational.
Alignment methods April 26, 2011 Return Quiz 1 today Return homework #4 today. Next homework due Tues, May 3 Learning objectives- Understand the Smith-Waterman.
Pairwise Sequence Alignment. The most important class of bioinformatics tools – pairwise alignment of DNA and protein seqs. alignment 1alignment 2 Seq.
Chapter 8 Dynamic Programming Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Pairwise alignment of DNA/protein sequences I519 Introduction to Bioinformatics, Fall 2012.
Dynamic-Programming Strategies for Analyzing Biomolecular Sequences Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National.
Multiple Sequence Alignment Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National Taiwan University, Taiwan WWW:
Sequence Alignment Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National Taiwan University, Taiwan
Sequence Alignment Csc 487/687 Computing for bioinformatics.
Function preserves sequences Christophe Roos - MediCel ltd Similarity is a tool in understanding the information in a sequence.
Chapter 3 Computational Molecular Biology Michael Smith
BLAST: Basic Local Alignment Search Tool Altschul et al. J. Mol Bio CS 466 Saurabh Sinha.
A Table-Driven, Full-Sensitivity Similarity Search Algorithm Gene Myers and Richard Durbin Presented by Wang, Jia-Nan and Huang, Yu- Feng.
Pairwise Sequence Alignment Part 2. Outline Summary Local and Global alignments FASTA and BLAST algorithms Evaluating significance of alignments Alignment.
Dynamic Programming Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National Taiwan University, Taiwan
Alignments and Phylogenetic tree Reading: Introduction to Bioinformatics. Arthur M. Lesk. Fourth Edition Chapter 5.
9/6/07BCB 444/544 F07 ISU Dobbs - Lab 3 - BLAST1 BCB 444/544 Lab 3 BLAST Scoring Matrices & Alignment Statistics Sept6.
Database Scanning/Searching FASTA/BLAST/PSIBLAST G P S Raghava.
Homology Search Tools Kun-Mao Chao (趙坤茂)
Sequence Alignment Kun-Mao Chao (趙坤茂)
Homology Search Tools Kun-Mao Chao (趙坤茂)
LSM3241: Bioinformatics and Biocomputing Lecture 4: Sequence analysis methods revisited Prof. Chen Yu Zong Tel:
Dynamic-Programming Strategies for Analyzing Biomolecular Sequences
Homology Search Tools Kun-Mao Chao (趙坤茂)
SMA5422: Special Topics in Biotechnology
Sequence Alignment Kun-Mao Chao (趙坤茂)
A Quick Note on Useful Algorithmic Strategies
A Note on Useful Algorithmic Strategies
A Note on Useful Algorithmic Strategies
A Note on Useful Algorithmic Strategies
Sequence Alignment Kun-Mao Chao (趙坤茂)
A Note on Useful Algorithmic Strategies
Sequence Alignment Kun-Mao Chao (趙坤茂)
Multiple Sequence Alignment
A Note on Useful Algorithmic Strategies
Basic Local Alignment Search Tool (BLAST)
A Note on Useful Algorithmic Strategies
Homology Search Tools Kun-Mao Chao (趙坤茂)
Multiple Sequence Alignment
Dynamic Programming Kun-Mao Chao (趙坤茂)
Presentation transcript:

Dynamic-Programming Strategies for Analyzing Biomolecular Sequences

2 Dynamic Programming Dynamic programming is a class of solution methods for solving sequential decision problems with a compositional cost structure. Richard Bellman was one of the principal founders of this approach.

3 Two key ingredients Two key ingredients for an optimization problem to be suitable for a dynamic-programming solution: Each substructure is optimal. (Principle of optimality) 1. optimal substructures2. overlapping subproblems Subproblems are dependent. (otherwise, a divide-and-conquer approach is the choice.)

4 Three basic components The development of a dynamic-programming algorithm has three basic components: –The recurrence relation (for defining the value of an optimal solution); –The tabular computation (for computing the value of an optimal solution); –The traceback (for delivering an optimal solution).

5 Fibonacci numbers.for       i>1 i F i F i F F F The Fibonacci numbers are defined by the following recurrence:

6 How to compute F 10 ? F 10 F9F9 F8F8 F8F8 F7F7 F7F7 F6F6 ……

7 Tabular computation The tabular computation can avoid recompuation. F0F0 F1F1 F2F2 F3F3 F4F4 F5F5 F6F6 F7F7 F8F8 F9F9 F

8 Maximum-sum interval Given a sequence of real numbers a 1 a 2 …a n, find a consecutive subsequence with the maximum sum. 9 –3 1 7 – –4 2 –7 6 – For each position, we can compute the maximum-sum interval starting at that position in O(n) time. Therefore, a naive algorithm runs in O(n 2 ) time.

9 O-notation: an asymptotic upper bound f(n) = O(g(n)) iff there exist two positive constant c and n 0 such that 0 f(n) cg(n) for all n n 0 cg(n) f(n)f(n) n0n0

10 How functions grow? 30n 92n log n 26n n 3 2n2n sec sec sec. 4 x yr. 100, sec.2.6 min.3.0 days22 yr. For large data sets, algorithms with a complexity greater than O(n log n) are often impractical! n function (Assume one million operations per second.)

11 Maximum-sum interval (The recurrence relation) Define S(i) to be the maximum sum of the intervals ending at position i. aiai If S(i-1) < 0, concatenating a i with its previous interval gives less sum than a i itself.

12 Maximum-sum interval (Tabular computation) 9 –3 1 7 – –4 2 –7 6 – S(i) – – The maximum sum

13 Maximum-sum interval (Traceback) 9 –3 1 7 – –4 2 –7 6 – S(i) – – The maximum-sum interval:

14 Longest increasing subsequence(LIS) The longest increasing subsequence is to find a longest increasing subsequence of a given sequence of distinct integers a 1 a 2 …a n. e.g are increasing subsequences. are not increasing subsequences. We want to find a longest one.

15 A naive approach for LIS Let L[i] be the length of a longest increasing subsequence ending at position i. L[i] = 1 + max j = 0..i-1 {L[j] | a j < a i } (use a dummy a 0 = minimum, and L[0]=0) L[i] ?

16 A naive approach for LIS L[i] L[i] = 1 + max j = 0..i-1 {L[j] | a j < a i } The maximum length The subsequence 2, 3, 7, 8, 10, 13 is a longest increasing subsequence. This method runs in O(n 2 ) time.

17 Binary search Given an ordered sequence x 1 x 2... x n, where x 1 <x 2 <... <x n, and a number y, a binary search finds the largest x i such that x i < y in O(log n) time. n... n/2 n/4

18 Binary search How many steps would a binary search reduce the problem size to 1? n n/2 n/4 n/8 n/ How many steps? O(log n) steps.

19 An O(n log n) method for LIS Define BestEnd[k] to be the smallest number of an increasing subsequence of length k BestEnd[1] BestEnd[2] BestEnd[3] BestEnd[4] BestEnd[5] BestEnd[6]

20 An O(n log n) method for LIS Define BestEnd[k] to be the smallest number of an increasing subsequence of length k BestEnd[1] BestEnd[2] BestEnd[3] BestEnd[4] BestEnd[5] BestEnd[6] For each position, we perform a binary search to update BestEnd. Therefore, the running time is O(n log n).

21 Longest Common Subsequence (LCS) A subsequence of a sequence S is obtained by deleting zero or more symbols from S. For example, the following are all subsequences of “president”: pred, sdn, predent. The longest common subsequence problem is to find a maximum-length common subsequence between two sequences.

22 LCS For instance, Sequence 1: president Sequence 2: providence Its LCS is priden. president providence

23 LCS Another example: Sequence 1: algorithm Sequence 2: alignment One of its LCS is algm. a l g o r i t h m a l i g n m e n t

24 How to compute LCS? Let A=a 1 a 2 …a m and B=b 1 b 2 …b n. len(i, j): the length of an LCS between a 1 a 2 …a i and b 1 b 2 …b j With proper initializations, len(i, j)can be computed as follows.

25

26

27

28

29 Dot Matrix Sequence A : CTTAACT Sequence B : CGGATCAT C G G A T C A T CTTAACTCTTAACT

30 C---TTAACT CGGATCA--T Pairwise Alignment Sequence A: CTTAACT Sequence B: CGGATCAT An alignment of A and B: Sequence A Sequence B

31 C---TTAACT CGGATCA--T Pairwise Alignment Sequence A: CTTAACT Sequence B: CGGATCAT An alignment of A and B: Insertion gap Match Mismatch Deletion gap

32 Alignment Graph Sequence A: CTTAACT Sequence B: CGGATCAT C G G A T C A T CTTAACTCTTAACT C---TTAACT CGGATCA--T

33 A simple scoring scheme Match: +8 (w(x, y) = 8, if x = y) Mismatch: -5 (w(x, y) = -5, if x ≠ y) Each gap symbol: -3 (w(-,x)=w(x,-)=-3) C T T A A C T C G G A T C A - - T = +12 Alignment score

34 An optimal alignment -- the alignment of maximum score Let A=a 1 a 2 …a m and B=b 1 b 2 …b n. S i,j : the score of an optimal alignment between a 1 a 2 …a i and b 1 b 2 …b j With proper initializations, S i,j can be computed as follows.

35 Computing S i,j i j w(a i,-) w(-,b j ) w(a i,b j ) S m,n

36 Initializations C G G A T C A T CTTAACTCTTAACT

37 S 3,5 = ? ? C G G A T C A T CTTAACTCTTAACT

38 S 3,5 = ? C G G A T C A T CTTAACTCTTAACT optimal score

39 C T T A A C – T C G G A T C A T C G G A T C A T CTTAACTCTTAACT 8 – 5 – = 14

40 Global Alignment vs. Local Alignment global alignment: local alignment:

41 An optimal local alignment S i,j : the score of an optimal local alignment ending at a i and b j With proper initializations, S i,j can be computed as follows.

42 local alignment ? C G G A T C A T CTTAACTCTTAACT Match: 8 Mismatch: -5 Gap symbol: -3

43 local alignment C G G A T C A T CTTAACTCTTAACT Match: 8 Mismatch: -5 Gap symbol: -3 The best score

C G G A T C A T CTTAACTCTTAACT The best score A – C - T A T C A T = 18

45 Affine gap penalties Match: +8 (w(x, y) = 8, if x = y) Mismatch: -5 (w(x, y) = -5, if x ≠ y) Each gap symbol: -3 (w(-,x)=w(x,-)=-3) Each gap is charged an extra gap-open penalty: -4. C T T A A C T C G G A T C A - - T = Alignment score: 12 – 4 – 4 = 4

46 Affine gap penalties A gap of length k is penalized x + k·y. gap-open penalty gap-symbol penalty Three cases for alignment endings: 1....x...x 2....x x an aligned pair a deletion an insertion

47 Affine gap penalties Let D(i, j) denote the maximum score of any alignment between a 1 a 2 …a i and b 1 b 2 …b j ending with a deletion. Let I(i, j) denote the maximum score of any alignment between a 1 a 2 …a i and b 1 b 2 …b j ending with an insertion. Let S(i, j) denote the maximum score of any alignment between a 1 a 2 …a i and b 1 b 2 …b j.

48 Affine gap penalties

49 Affine gap penalties SI D SI D SI D SI D -y -x-y -y w(a i,b j )

50 PAM (percent accepted mutation) Scoring function is critical element above SF is not good enough Developing a new scoring function –Based on a set of native protein sequences

51 20 x 20 substitution matrix

52 PAM-250

53 PAM – 1 The Dayhoff Matrix: Proteins evolve through a succession of independent point mutations, that are accepted in a population and subsequently can be observed in the sequence pool. (Dayhoff, M.O. et al. (1978) Atlas of Protein Sequence and Structure. Vol. 5, Suppl. 3 National Biomedical Research Foundation, Washington D.C. U.S.A). First step: Pair Exchange Frequencies A PAM (Percent Accepted Mutation) is one accepted point mutation on the path between two sequences, per 100 residues.

54 PAM – 2: Second step: Frequencies of Occurrence of each amino acid L A G S V E T K I D R P N Q F Y M H C W Computing the relative frequency of occurrence of a.a. over a large, Sufficiently varied protein sequence set i.e: occurrence in the sample space

55 PAM – 3: Third step: Relative Mutabilities A C D E F G H I K L M N P Q R S T V W Y All values are taken relative to alanine, which is arbitrarily set at 100.

56 PAM – 4: Fourth step: Mutation Probability matrix The probability that an amino acid in row a of the matrix will replace the amino acid in column b : the mutability of amino acid b, multiplied by the pair exchange frequency for aa divided by the sum of all pair exchange frequencies for amino acid a: Matrix M is a Markov model of evolution

57 PAM – 5: Last step: the log-odds matrix log to base 10: a value of +1 would mean that the corresponding pair has been observed 10 times more frequently than expected by chance. The most commonly used matrix is the matrix from the 1978 edition of the Dayhoff atlas, at PAM 250: this is also frequently referred to as the PAM250 matrix. k-PAM defines as

58 PAM-250

59 BLOSUM Matrices –BLOSUM matrices are based on local alignments. –BLOSUM 62 is a matrix calculated from comparisons of sequences with no less than 62% divergence. –All BLOSUM matrices are based on observed alignments; they are not extrapolated from comparisons of closely related proteins. –BLOSUM 62 is the default matrix in BLAST 2.0. Though it is tailored for comparisons of moderately distant proteins, it performs well in detecting closer relationships. A search for distant relatives may be more sensitive with a different matrix.

60 BLOSUM62 is the BLAST default

61 BLOSUM 62

62 Relationship between PAM & BLOSUM

63 Gap Penalty Query LengthSubstitution MatrixGap Costs <35PAM-30(9,1) 35-50PAM-70(10,1) 50-85BLOSUM-80(10,1) >85BLOSUM-62(10,1)

64 k best local alignments Smith-Waterman (Smith and Waterman, 1981; Waterman and Eggert, 1987) –linear-space version : sim (Huang and Miller, 1991) –linear-space variants : sim2 (Chao et al., 1995); sim3 (Chao et al., 1997) FASTA (Wilbur and Lipman, 1983; Lipman and Pearson, 1985) –linear-space band alignment (Chao et al., 1992) BLAST (Altschul et al., 1990; Altschul et al., 1997) –restricted affine gap penalties (Chao, 1999)

65 FASTA 1)Find runs of identities, and identify regions with the highest density of identities. 2)Re-score using PAM matrix, and keep top scoring segments. 3)Eliminate segments that are unlikely to be part of the alignment. 4)Optimize the alignment in a band.

66 FASTA Step 1: Find runes of identities, and identify regions with the highest density of identities.

67 FASTA Step 2: Re-score using PAM matrix, and keep top scoring segments.

68 FASTA Step 3: Eliminate segments that are unlikely to be part of the alignment.

69 FASTA Step 4: Optimize the alignment in a band.

70 BLAST 1)Build the hash table for Sequence A. 2)Scan Sequence B for hits. 3)Extend hits.

71 BLAST Step 1: Build the hash table for Sequence A. (3-tuple example) For DNA sequences: Seq. A = AGATCGAT AAA AAC.. AGA 1.. ATC 3.. CGA 5.. GAT TCG 4.. TTT For protein sequences: Seq. A = ELVIS Add xyz to the hash table if Score(xyz, ELV) ≧ T; Add xyz to the hash table if Score(xyz, LVI) ≧ T; Add xyz to the hash table if Score(xyz, VIS) ≧ T;

72 BLAST Step2: Scan sequence B for hits.

73 BLAST Step2: Scan sequence B for hits. Step 3: Extend hits. hit Terminate if the score of the sxtension fades away. BLAST 2.0 saves the time spent in extension, and considers gapped alignments.

74 Remarks Filtering is based on the observation that a good alignment usually includes short identical or very similar fragments. The idea of filtration was used in both FASTA and BLAST.

75 Linear-space ideas Hirschberg, 1975; Myers and Miller, 1988 m/2

76 Two subproblems ½ original problem size m/2 m/4 3m/4

77 Four subproblems ¼ original problem size m/2 m/4 3m/4

78 Time and Space Complexity Space: O(M+N) Time: O(MN)*(1+ ½ + ¼ + …) = O(MN) 2

79 Band Alignment Sequence B Sequence A

80 Band Alignment in Linear Space The remaining subproblems are no longer only half of the original problem. In worst case, this could cause an additional log n factor in time.

81 Band Alignment in Linear Space

82 Multiple sequence alignment (MSA) The multiple sequence alignment problem is to simultaneously align more than two sequences. Seq1: GCTC Seq2: AC Seq3: GATC GC-TC A---C G-ATC

83 How to score an MSA? Sum-of-Pairs (SP-score) GC-TC A---C G-ATC GC-TC A---C GC-TC G-ATC A---C G-ATC Score= + +

84 Defining scores for alignment columns infocon [Stojanovic et al., 1999] –Each column is assigned a score that measures its information content, based on the frequencies of the letters both within the column and within the alignment. CGGATCAT—GGA CTTAACATTGAA GAGAACATAGTA

85 Defining scores (cont’d) phylogen [Stojanovic et al., 1999] –columns are scored based on the evolutionary relationships among the sequences implied by a supplied phylogenetic tree. TTTCCTTTCC T T T C C C T T T TT T T Score = 1 Score = 2

86 MSA for three sequences an O(n 3 ) algorithm

87 General MSA For k sequences of length n: O(n k ) NP-Complete (Wang and Jiang) The exact multiple alignment algorithms for many sequences are not feasible. Some approximation algorithms are given. (e.g., 2- l/k for any fixed l by Bafna et al.)

88 Progressive alignment A heuristic approach proposed by Feng and Doolittle. It iteratively merges the most similar pairs. “Once a gap, always a gap” A B C D E The time for progressive alignment in most cases is roughly the order of the time for computing all pairwise alignment, i.e., O(k 2 n 2 ).

89 Concluding remarks Three essential components of the dynamic- programming approach: –the recurrence relation –the tabular computation –the traceback The dynamic-programming approach has been used in a vast number of computational problems in bioinformatics.