
























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

























Imagine each of these boxes has a score in it. (i.e. from BLOSUM)
right-hand corner box.when we reach the lowerThe alignment is completediagonal.each step: down, right, orThere are directions for
scores.("gap" rows) have noRows on top and leftsequences.lengths of the twowhere N and M are thematrix is (N+1)x(M+1),The size of the alignment
starting point
write *, "Score =",scoreenddoendifscore = score + A[Aseq,Bseq]Bseq = Bseq+1Aseq = Aseq+1elseif (walk[i]==diag) then
starting here
ending here
possible paths ofTotal number of (^) n
diagonal.(the original) gogoes down, and yougoes right, one clonein each box. One clonecloning yourself twicepossible walks byYou could take all arrows = 3 n
All "walks" through the alignment matrix end in the
(^) lower
right-hand corner
. We can ask each "walker" as it enters the
Consider the lastlast box what its score is. Then we pick the best one. (^) down (^) arrow before the last box. All
those (^) suboptimal together. That means we didn't need to keep track of any ofhighest score after all the walkers traverse the same arrowwalker had the highest score in the previous box still has thethe arrow and after the arrow did not change Whichever- a gap penalty. So the relative scores of those walks beforealignments that traversed that arrow added the same amount - (^) walks, just the (^) optimal (^) one for that box.
others, since they will always rank lower than the optimal.to keep the optimal walk into each box. We can ignore theThis is true for all boxes back to the beginning. We only need
. Draw an arrow
Make the alignment from the arrows. (When you reach the last box, trace back along the arrows.(traceback) from the box that had the highest scoring walk. This is the optimal
alignment !)
i,j-1 (^) y S (^) - w (^) } i-1,j (^) xS (^) - w (^) , (^) + s(i,j),
Filling in a box requires that the values in the three input boxes be already filled in.