1 / 44

Local Alignment

Tutorial 2. Local Alignment. Local alignment. What is local alignment? Dynamic programming How to solve a local alignment matrix Reminder – global alignment. Local alignment.

zocha
Download Presentation

Local 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. Tutorial 2 Local Alignment

  2. Local alignment • What is local alignment? • Dynamic programming • How to solve a local alignment matrix • Reminder – global alignment

  3. Local alignment Local alignment finds one or more alignments describing the most similar region(s) within the sequences to be aligned.

  4. Local Alignment • Dynamic Programming algorithm for finding local matches between two sequences. • What is a local match?: • It is a best-matching, highest-scoring region between two sequences. • It is a well conserved region between two sequences.

  5. Dynamic Programming • Conditions • Division to sub-problems possible • The problem can be described in a recursive way • “Bottom-up” approach

  6. Example – solving Fibonacci Fib(x) = Fib(x-1)+Fib(x-2), Fib(0)=0 Fib(1)=1 Fib(5) = Fib(3)+Fib(4) Fib(5) = Fib(2)+Fib(1)+Fib(3)+Fib(2) Fib(5) = Fib(1)+Fib(0)+Fib(1)+Fib(2)+Fib(1)+Fib(1)+Fib(0) Fib(5) = Fib(1)+Fib(0)+Fib(1)+ Fib(1)+Fib(0)+Fib(1)+Fib(1)+Fib(0) Fib(5) = 1+0+1+1+0+1+1+0 = 5 Without using dynamic programming we will need to calculate Fib(2) three times.

  7. Fibonacci Dynamic programming solution will work “bottom up”: 1. First calculate Fib(2) from known Fib(0) and Fib(1) 2. Calculate Fib(3) using calculated Fib(2) and known Fib(1). 3. Calculate Fib(4) using calculated Fib(3) and Fib(2). 4. Calculate Fib(5) using calculated Fib(4) and Fib(3).

  8. How to – local alignment

  9. Alignment [I,J] Best alignment M1..I, N1..J

  10. Alignment All possible alignments encoded as path in matrix

  11. Global vs Local • The differences: • We can start a new match instead of extending a previous alignment. • Instead of looking only at the far corner, we look anywhere in the table for the best score Global Local • Scoring System • Match : +1 • Mismatch: -2 • Indel : -1

  12. Local Alignment Scoring System • Match : +1 Ni=Mj • Mismatch: -1 Ni=Mj • Indel : -2

  13. Local Alignment Scoring System • Match : +1 Ni=Mj • Mismatch: -1 Ni=Mj • Indel : -2

  14. Local Alignment Scoring System • Match : +1 • Mismatch : -1 • Indel : -2

  15. Local Alignment Scoring System • Match : +1 • Mismatch : -1 • Indel : -2 N1 -

  16. Local Alignment Scoring System • Match : +1 • Mismatch : -1 • Indel : -2 -M1

  17. Local Alignment Scoring System • Match : +1 • Mismatch: -1 • Indel : -2 N1- M1M2

  18. +1 if M2=N2; -1 if M2=N2 Local Alignment Fill: 1.We fill the table like in global alignment, but we don’t allow negative numbers (turn every negative number to 0) 2.No arrows coming out from cells with a 0. Scoring System • Match : +1 • Mismatch: -1 • Indel : -2 N1N2.. M1M2.. N1N2.. M1 -.. -2 N1 -.. M1M2..

  19. +1 if M2=N2; -1 if M2=N2 Local Alignment Trace: We trace back from the highest scoring cells. N1N2.. M1M2.. N1N2.. M1 -.. -2 N1 -.. M1M2..

  20. If you like formulas… i i+1 j Z = max (Si,j+w, Si+1,j+w, Si,j+1+w) j+1 Z When w is the score according to the scoring matrix For example match or mismatch 2 match w = -1 mismatch/indel Z = max (Si,j+2/-1, Si+1,j-1, Si,j+1-1) indel

  21. Local Alignment – let’s get this party started • Seq 1 TACTAA • Seq 2 TAATA

  22. - T

  23. T -

  24. -T -T +1 T- -T -T T- -2 -2

  25. 0 T 1 A 2 C 3 T 4 A 5 A 6 0 0 0 0 0 0 0 0 T1 0 1 0 0 1 0 0 A2 0 A3 0 T4 0 A5 0

  26. 0 T 1 A 2 C 3 T 4 A 5 A 6 0 0 0 0 0 0 0 0 T1 0 1 0 0 1 0 0 A2 0 0 2 0 0 2 1 A3 0 T4 0 A5 0

  27. 0 T 1 A 2 C 3 T 4 A 5 A 6 0 0 0 0 0 0 0 0 T1 0 1 0 0 1 0 0 A2 0 0 2 0 0 2 1 A3 0 0 1 1 0 1 3 T4 0 A5 0

  28. 0 T 1 A 2 C 3 T 4 A 5 A 6 0 0 0 0 0 0 0 0 T1 0 1 0 0 1 0 0 A2 0 0 2 0 0 2 1 A3 0 0 1 1 0 1 3 T4 0 1 0 0 2 0 1 A5 0

  29. 0 T 1 A 2 C 3 T 4 A 5 A 6 0 0 0 0 0 0 0 0 T1 0 1 0 0 1 0 0 A2 0 0 2 0 0 2 1 A3 0 0 1 1 0 1 3 T4 0 1 0 0 2 0 1 A5 0 0 2 0 0 3 1

  30. Leave only paths from highest score

  31. TAA TAA TACTA TAATA

  32. +1 if M2=N2; -1 if M2=N2 And Now… Global Alignment 1.We keep negative numbers. 2.Arrows coming out from any cell. 3.We trace back from right-bottom to left-top of the table. Scoring System • Match : +1 • Mismatch: -1 • Indel : -2 N1N2.. M1M2.. N1N2.. M1 -.. -2 N1 -.. M1M2..

  33. Match: +1 • Mismatch:-1 • Indel: -2 0 T 1 A 2 C 3 T 4 A 5 A 6 0 0 -2 -4 -6 -8 -10 -12 T1 -2 1 -1 -3 -5 -7 -9 A2 -4 -1 2 0 -2 -4 -6 A3 -6 -3 0 1 -1 -1 -3 T4 -8 -5 -2 -1 2 0 -2 A5 -10 -7 -4 -3 0 3 1

  34. Match: +1 • Mismatch:-1 • Indel: -2 0 T 1 A 2 C 3 T 4 A 5 A 6 0 0 -2 -4 -6 -8 -10 -12 T1 -2 1 -1 -3 -5 -7 -9 A2 -4 -1 2 0 -2 -4 -6 A3 -6 -3 0 1 -1 -1 -3 T4 -8 -5 -2 -1 2 0 -2 A5 -10 -7 -4 -3 0 3 1

  35. 0 T 1 A 2 C 3 T 4 A 5 A 6 0 0 -1 -2 -3 -4 -5 -6 T1 -1 1 -1 -3 -2 -4 -6 A2 -2 -1 2 0 -2 0 -2 A3 -3 -3 0 1 -1 -1 1 T4 -4 -2 -2 -1 2 0 -1 A5 -5 -4 -1 -3 0 3 1

  36. TACTAA TAATA- TACTAA TAAT-A

  37. Global Local TACTAA TAAT-A TAA TAA TACTAA TAATA- TACTA TAATA

More Related