1 / 65

Dynamic Programming for Pairwise Alignment

Dynamic Programming for Pairwise Alignment. Dr Alexei Drummond Department of Computer Science alexei@cs.auckland.ac.nz. BIOSCI 359, Semester 2, 2006. Dynamic Programming. method for solving combinatorial optimisation problems guaranteed to give optimal solution

tyra
Télécharger la présentation

Dynamic Programming for Pairwise 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. Dynamic Programmingfor Pairwise Alignment Dr Alexei Drummond Department of Computer Science alexei@cs.auckland.ac.nz BIOSCI 359, Semester 2, 2006

  2. Dynamic Programming • method for solving combinatorial optimisation problems • guaranteed to give optimal solution • generalisation of “divide-and-conquer” • relies on “Principle of Optimality” i.e. sub-optimal solution of subproblem cannot be part of optimal solution of original problem instance.

  3. Principle of Optimality Auckland Te Kuiti Wellington

  4. Principle of Optimality Auckland Te Kuiti Wellington

  5. Key to efficiency • computation is carried out bottom-up • store solutions to subproblems in a table • all possible subproblems solved once each, beginning with smallest subproblems • work up to original problem instance • only optimal solutions to subproblems are used to compute solution to problem at next level • DO NOT carry out computation in recursive, top-down manner • same subproblems would be solved many times

  6. Pairwise alignment Sequences x = a c g g t s y = a w g c c t t Alignment x¢ = a – c g g – t s y¢ = a w – g c c t t

  7. Scoring • Numeric score associated with each column • Total score = sum of column scores • Column types: • Identical (+ve) (2) Conservative (+ve) (3) Non-conservative (-ve) (4) Gap (-ve) x¢ = a – c g g– t s y¢ = a w – g cc t t

  8. Gap penalties • Linear score:g(g) = -gd gap penality • Affine score:g(g) = -d- (g-1)e gap-open penality gap-extension penalty y¢ ---------- x¢ g

  9. BLOSUM50 matrix “Blocks Amino Acid Substitution Matrix”

  10. Needleman & Wunsch algorithm • Dynamic programming algorithm for global alignment • Needleman & Wunsch (‘70), modified Gotoh (‘82) • Assumptions: • Linear gap score d • Symmetric scoring matrix S • s(a,b) = s(b,a) score from lining up a and b • s(a,-) = s(-,a) = -d score from lining up a with -

  11. Principle of Optimality Given sequences: Define: F(i,j) = score of best alignment between and

  12. Principle of Optimality Optimal alignment

  13. Principle of Optimality Optimal alignment Looks like ……

  14. Principle of Optimality Optimal alignment Looks like …… or ……………

  15. Principle of Optimality Optimal alignment Looks like …… or …………… or ……………

  16. Principle of Optimality Optimal alignment Looks like …… or …………… or …………… so ……………

  17. Principle of Optimality Basis:

  18. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  19. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  20. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  21. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  22. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  23. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  24. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  25. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  26. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  27. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  28. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  29. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  30. Filling up table Y F matrix 0 1 2 n 0 1 2 X m

  31. Filling up table Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m

  32. Constructing alignment Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m

  33. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m

  34. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m Y Alignment X

  35. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m Y Alignment X

  36. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m Y Alignment X

  37. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m Y Alignment X

  38. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m Y Alignment X

  39. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m Y Alignment X

  40. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m Y Alignment X

  41. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m Y Alignment X

  42. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m Y Alignment X

  43. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m Y Alignment X

  44. Example Y F matrix 0 1 2 n 0 1 2 Optimal alignment score X m Y Alignment X

  45. Time and space 0 1 2 n 0 1 2 F matrix m table entries space Each entry computed in constant time time

  46. Smith & Waterman algorithm Computes local alignment. i.e. look for best alignment of subsequences of X and Y, ignoring scores of regions on either side Y X Best subsequence alignment

  47. Principle of Optimality Given sequences DefineF(i,j) = score of best suffix alignment between and N.B. Includes empty alignment with score 0

  48. Dynamic Programming recurrences Optimal alignment Looks like …… or …………… or …………… or ……………

  49. Principle of Optimality so …… Basis:

  50. Example

More Related