Presentation is loading. Please wait.

Presentation is loading. Please wait.

We want to calculate the score for the yellow box. The final score that we fill in the yellow box will be the SUM of two other scores, we’ll call them.

Similar presentations


Presentation on theme: "We want to calculate the score for the yellow box. The final score that we fill in the yellow box will be the SUM of two other scores, we’ll call them."— Presentation transcript:

1 We want to calculate the score for the yellow box. The final score that we fill in the yellow box will be the SUM of two other scores, we’ll call them MATCH and MAX. Let’s try it… SEQUENCE 1 SEQUENCE 2 Review of Dynamic Programming

2 Dynamic Programming Score = Sum of MatchScore + MAX Match Score whether the sequence matches at that location 1 for match / 0 for non match MAX (the highest of the following three) 1.The score in the box at position i-1, j-1 2.The highest score in the row i-x, j-1 (where 2<=x<i) 3.The highest score in the column i-1, j-y (where 2<=y<j) i-4 i-3 i-2 i-1 i j j-1 j-2 j-3 j-4 Fill in the Table from the top left hand corner!

3 Dynamic Programming – Filling in the Table! 1 The MATCH score is assigned based on whether the residues at position i, j (i.e. yellow box) matches. In this case, the residues at i, j are A and A which matches. Therefore, the MATCH score would be 1. Since there are no i-1 or j-1 (i.e no column/rows on top) we don’t have to worry about the MAX part of the score. A B B C D A B C C C FILL in the Table from the top left hand corner!

4 Dynamic Programming – Filling in the Table! 10 Moving one square to the right. In this case, the residues at i, j are B and A and match. Therefore, the MATCH score would be 0. Again there are no i-1 or j-1 (i.e no column/rows on top) we don’t have to worry about the MAX part of the score. A B B C D A B C C C

5 Dynamic Programming – Filling in the Table! 10000 0 0 0 0 We can filled in the rest of the first column and first row A B B C D A B C C C

6 Dynamic Programming – Filling in the Table! 10000 02 0 0 0 Let’s move to the 2 nd row Score = Sum of MatchScore + MAX MAX (the highest of the following three) 1.The score in the box at position i-1, j-1 2.The highest score in the row i-x, j-1 (where 2<=x<i) 3.The highest score in the column i-1, j-y (where 2<=y<j) In this case there is no 2 or 3 to consider MatchScore = 1 MAX = 1 Score = 1 + 1 = 2 A B B C D A B C C C

7 Dynamic Programming – Filling in the Table! 10000 022 0 0 0 Moving across the row Score = Sum of MatchScore + MAX MAX (the highest of the following three) 1.The score in the box at position i-1, j-1 2.The highest score in the row i-x, j-1 (where 2<=x<i) 3.The highest score in the column i-1, j-y (where 2<=y<j) MatchScore = 1 MAX = 1 Score = 1 + 1 = 2 A B B C D A B C C C

8 Dynamic Programming – Filling in the Table! 10000 02211 0 0 0 Moving across the row again! Score = Sum of MatchScore + MAX MAX (the highest of the following three) 1.The score in the box at position i-1, j-1 2.The highest score in the row i-x, j-1 (where 2<=x<i) 3.The highest score in the column i-1, j-y (where 2<=y<j) MatchScore = 0 MAX = 1 Score = 0 + 1 = 1 We can fill in the last square using the same method = 1 A B B C D A B C C C

9 Dynamic Programming – Filling in the Table! 10000 02211 01 0 0 Moving to the next row MAX (the highest of the following three) 1.The score in the box at position i-1, j-1 2.The highest score in the row i-x, j-1 (where 2<=x<i) 3.The highest score in the column i-1, j-y (where 2<=y<j) MatchScore = 0 MAX = 1 Score = 0 + 1 = 1 A B B C D A B C C C

10 Dynamic Programming – Filling in the Table! 10000 02211 012 0 0 Moving to the next row MAX (the highest of the following three) 1.The score in the box at position i-1, j-1 2.The highest score in the row i-x, j-1 (where 2<=x<i) 3.The highest score in the column i-1, j-y (where 2<=y<j) MatchScore = 0 MAX = 2 Score = 0 + 2 = 2 A B B C D A B C C C

11 Dynamic Programming – Filling in the Table! 10000 02211 01232 0 0 Moving to the next row MAX (the highest of the following three) 1.The score in the box at position i-1, j-1 2.The highest score in the row i-x, j-1 (where 2<=x<i) 3.The highest score in the column i-1, j-y (where 2<=y<j) MatchScore = 1 MAX = 2 OR 2 Score = 1 + 2 = 3 We can fill in the last square in similar fashion A B B C D A B C C C

12 Dynamic Programming – Filling in the Table! 10000 02211 01232 01233 0123 We can fill in the remaining squares! A B B C D A B C C C

13 Dynamic Programming – Filling in the Table! 10000 02211 01232 01233 01233 The LAST Square! MATCH = 0 MAX = 3 Score = 0+3 = 3 A B B C D A B C C C

14 QUESTIONS? 10000 02211 01232 01233 01233 A B B C D A B C C C

15 Traceback Protocol AATVD A11000 V01121 V01122 D01113 Used to get the alignment from the filled in table. Start in the lower right corner. You can only move to the largest number that is UP and TO THE LEFT. DD

16 Traceback Protocol AATVD A11000 V01121 V01122 D01113 All 3 paths start like this. But, moving up and to the left from the square with score 2, we have two possible choices, both of which are up and to the left, and contain equal values. VDVD

17 Traceback Protocol AATVD A11000 V01121 V01122 D01113 We now have two possible alignments – red and yellow. Yellow has only one more square it can access. The red alignment can branch off again, however. TVDVVD ATVDV-VD

18 Traceback Protocol AATVD A11000 V01121 V01122 D01113 These are the 3 possible paths through the matrix, in other words, the 3 possible alignments. AATVD-AVVDAATVDAV-VDAATVDA-VVD

19 Traceback Protocol AATVD A11000 V01121 V01122 D01113 Every time a diagonal line “skips” a box (i.e does not lead into the box immediately to the upper left (i-1, j- 1), we insert a gap into the alignment.

20 Traceback Protocol AATVD A11000 V01121 V01122 D01113 AATVD-AVVDAATVDAV-VDAATVDA-VVD

21 AATVD A11000 V01121 V01122 D01113 Is this possible??AATV-D-A-VVD Optimal alignment??

22 QUESTIONS?? AATVD A11000 V01121 V01122 D01113 AATVD-AVVDAATVDAV-VDAATVDA-VVD


Download ppt "We want to calculate the score for the yellow box. The final score that we fill in the yellow box will be the SUM of two other scores, we’ll call them."

Similar presentations


Ads by Google