1 / 49

Pairwise sequence Alignment

Pairwise sequence Alignment. Types of Alignment • Global alignment: Aligning the whole sequences • Appropriate when aligning two very closely related sequencs • Local alignment: Aligning certain regions in the sequences • Appropriate for aligning multi-domain protein sequences

terri
Download Presentation

Pairwise sequence Alignment

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pairwise sequence Alignment

  2. Types of Alignment • Global alignment: Aligning the whole sequences • Appropriate when aligning two very closely relatedsequencs • Local alignment: Aligning certain regions in the sequences • Appropriate for aligning multi-domain proteinsequences • It is important to use the “appropriate” type Distinction between global and local alignments of two sequences.

  3. How do we compute the best alignment? AGTGCCCTGGAACCCTGACGGTGGGTCACAAAACTTCTGGA Too many possible alignments: >> 2N (exercise) AGTGACCTGGGAAGACCCTGACCCTGGGTCACAAAACTC

  4. Sequence Alignment AGGCTATCACCTGACCTCCAGGCCGATGCCC TAGCTATCACGACCGCGGTCGATTTGCCCGAC -AGGCTATCACCTGACCTCCAGGCCGA--TGCCC--- TAG-CTATCAC--GACCGC--GGTCGATTTGCCCGAC Definition Given two strings x = x1x2...xM, y = y1y2…yN, an alignment is an assignment of gaps to positions 0,…, M in x, and 0,…, N in y, so as to line up each letter in one sequence with either a letter, or a gapin the other sequence

  5. Alignment is additive Observation: The score of aligning x1……xM y1……yN is additive Say that x1…xi xi+1…xM aligns to y1…yj yj+1…yN The two scores add up: F(x[1:M], y[1:N]) = F(x[1:i], y[1:j]) + F(x[i+1:M], y[j+1:N])

  6. Calculation of an alignment score

  7. DP Algorithms for PairwiseAlignment The number of all possible pairwise alignments (if gaps are allowed) is exponential in the length of the sequences • Therefore, the approach of “score every possible alignment and choose the best” is infeasible in practice • Efficient algorithms for pairwise alignment have been devised using dynamic programming (DP)

  8. Two kinds of sequence alignment: global and local We will first consider the global alignment algorithm of Needleman and Wunsch (1970). We will then explore the local alignment algorithm of Smith and Waterman (1981). Finally, we will consider BLAST, a heuristic version of Smith-Waterman. We will cover BLAST in detail on Monday. Page 63

  9. Global alignment with the algorithm of Needleman and Wunsch (1970) • • Two sequences can be compared in a matrix • along x- and y-axes. • • If they are identical, a path along a diagonal • can be drawn • • Find the optimal subpaths, and add them up to achieve • the best score. This involves • --adding gaps when needed • --allowing for conservative substitutions • --choosing a scoring system (simple or complicated) • N-W is guaranteed to find optimal alignment(s) Page 63

  10. İnitial stage of filling in the DP Sm and Sn m+1 x n+1 9 x 10 The sequences are written across the top and down the left side of a matrix, respectively, An extra row and column labeled “gap” are added to allow the alignment to begin with a gap of any length in either sequence. The gap rows are filled with penalty scores for gaps of increasing lengths, as indicated. A zero is placed in the upper right box corresponding to no gaps in either sequence. columns rows

  11. Gap=-8 Gap=-4

  12. Three steps to global alignment with the Needleman-Wunsch algorithm [1] set up a matrix [2] score the matrix [3] identify the optimal alignment(s) Page 63

  13. Four possible outcomes in aligning two sequences 1 2 [1] identity (stay along a diagonal) [2] mismatch (stay along a diagonal) [3] gap in one sequence (move vertically!) [4] gap in the other sequence (move horizontally!) Page 64

  14. Page 64

  15. Necessary values in adjacent cells

  16. x (x1x2...xm) and y(y1y2...yn) The matrix has (m+1) rows labeled 0➝m and (n+1)columns labeled 0➝n The rows correspond to the residues of sequence x, andthe columns correspond to the residues of sequence y y S0,0 + s(x1,y1) = 0+s(I,T)=0-1=-1 S1,0 + g = -8-8=-16 S0,1 + g = -8-8=-16 x

  17. s11 is the score for an a1-b1 match added to 0 in the upper left position Trial values for s12 are calculated and the maximum score is chosen. Trial 1 is to add the score for the a1-b2 match to s11 and subtract a penalty for a gap of size 1. The other three trials shown by arrows include gap penalties and so likely cannot yield a higher score than trial 1.

  18. Global alignment of two protein sequences by the Needleman-Wunsch algorithm withenhancements by Smith and Waterman. • sequence 1 = MNALSDRT and • sequence 2 = MGSDRTTET. • Notice the subsequence SDRT in the two sequences which one might expect to be aligned if the sequences are aligned properly. JMB, 1970

  19. -12 is the penalty for opening the gap in the alignment, and -4 is the penalty for each additional sequence character in the gap. Use PAM250 M M S0,0 + s(x1,y1) = 0+s(M,M)=0+6=6 S1,0 + g = -12-12=-24 S0,1 + g = -12-12=-24 M - - M S1,1 = - M M -

  20. sequence 1 M -N A L S D R T sequence 2 M G S D R T T E T score 6 -12 1 0 -3 1 0 -1 3 = -5 sequence 1 M N A - L S D R T sequence 2 M G S D R T T E T score 6 -12 1 0 -3 1 0 -1 3 = -5

  21. Example 2

  22. Example contd.

  23. H E A G A W G H E - E - P - - A W - H E A E Optimal alignment:

  24. Alignments and Paths through Example 3

  25. t a c g - c a a - - - a c g t g a a t t

  26. t - - a c g c a - - a a c g t g - - a a t t

  27. Example 4 - T G C A T - A - A T - C - T G A T Alignment:

  28. Tracing back a solution (I)

  29. Tracing back a solution (II) The algorithm is called with PRINT-LCS(b,V,n,m)

  30. Computing Distance di-1,j + 1 di,j-1 + 1 di-1,j-1 , if vi=wj di,j=min Only deletions/insertions are allowed

  31. Needleman-Wunsch: dynamic programming N-W is guaranteed to find optimal alignments, although the algorithm does not search all possible alignments. It is an example of a dynamic programming algorithm: an optimal path (alignment) is identified by incrementally extending optimal subpaths. Thus, a series of decisions is made at each step of the alignment to find the pair of residues with the best score. Page 67

  32. Local sequence alignment • Suppose, we have a long DNA sequence (e.g., 4000 bp) and we want to compare it with the complete yeast genome (12.5M bp). • What if only a portion of our query, say 200 bp length, has strong similarity to a gene in yeast. • Can we find this 200 bp portion using (semi) global alignment? Probably not. Because, we are trying to align the complete 4000 bp sequence, thus a random alignment may get a better score than the one that aligns 200 bp portion to the similar gene in yeast.

  33. Global alignment versus local alignment Global alignment (Needleman-Wunsch) extends from one end of each sequence to the other Local alignment finds optimally matching regions within two sequences (“subsequences”) Local alignment is almost always used for database searches such as BLAST. It is useful to find domains (or limited regions of homology) within sequences Smith and Waterman (1981) solved the problem of performing optimal local sequence alignment. Other methods (BLAST, FASTA) are faster but less thorough. Page 69

  34. How the Smith-Waterman algorithm works Set up a matrix between two proteins (size m+1, n+1) No values in the scoring matrix can be negative! S > 0 The score in each cell is the maximum of four values: [1] s(i-1, j-1) + the new score at [i,j] (a match or mismatch) [2] s(i,j-1) – gap penalty [3] s(i-1,j) – gap penalty [4] zero Page 69

  35. Local alignemnt The major difference between this scoring matrix and the Needleman-Wunsch matrix is that there are no negative scores in the Smith-Waterman scoring matrix. The effect of this change is that an alignment can begin anywhere without receiving a negative penalty from a previously low- scoring alignment. sequence 1 S D R T sequence 2 S D R T score 2 4 6 3 = 15

  36. Example Linear gap model Gap = -1 Match = 4 Mismatch = -2 Q: E Q L L K A L E F K L P: K V L E F G Y - E Q L L K A L E F K L - K V L E F G Y

  37. Example Linear gap model Gap = -1 Match = 4 Mismatch = -2 Q: E Q L L K A L E F K L P: K V L E F G Y - E Q L L K A L E F K L - K V L E F G Y

  38. Example Linear gap model Gap = -1 Match = 4 Mismatch = -2 Q: E Q L L K A L E F K L P: K V L E F G Y - E Q L L K A L E F K L - K V L E F G Y

  39. Example Linear gap model Gap = -1 Match = 4 Mismatch = -2 Q: E Q L L K A L E F K L P: K V L E F G Y - E Q L L K A L E F K L - K V L E F G Y

  40. Example Alignment Q: E Q L L K A L E F K L P: K V L E F G Y Q: K A - L E F P: K - V L E F - E Q L L K A L E F K L - K V L E F G Y

  41. Example Alignment Q: E Q L L K A L E F K L P: K V L E F G Y Q: K - A L E F P: K V - L E F - E Q L L K A L E F K L - K V L E F G Y

  42. Example Alignment Q: E Q L L K A L E F K L P: K V L E F G Y Q: K A L E F P: K V L E F - E Q L L K A L E F K L - K V L E F G Y

  43. Another Example Linear gap model Gap = -4 Match = +5 Mismatch = -4 Find the local alignment between: Q: G C T G G A A G G C A T P: G C A G A G C A C G Q P

  44. Another Example Q’s subsequence: G A A G – G C A P’s subsequence: G C A G A G C A Q P

More Related