A Method for Finding Local Alignments.
Now we take a more petulant attitude when calculating scores. This is sort of similar to the case (page 7) of not charging for end gaps, but much more extreme. In that case we didn't punish leading and trailing end gaps. In this case we punish everything as usual, but whenever the resulting score for a position is less than zero, we arbitrarily set it equal to zero (so leading gaps, at least, will all be zero).

What's this do for us? First, it focuses our attention on scores that are positive, which, of course, result from actual matches (or in general from positively scored alignments). Long strings of mismatches and gaps are ignored. The idea then is to look for the highest score on the page and trace it back until you get to a zero. This will give you an alignment for a portion of each sequence - a local alignment. Then, if you wish, look for the second highest score that isn't part of the first trail of scores, and do the same. This will give you another significant local alignment.

Note that since by now you should be able to trace back along a path of scores without the three subscores used to compute the maximum score for each position, I have only put in the single final score for each position. This allows you to type in longer sequences without having to scroll to see the entire score array. Also note that as usual JavaScript is not the swiftest program in the world, and you may have to wait a while for the screen to give you results, depending on the length of you inputs.

One last word: what makes this better than a dot plot? Well, it's more rigorous, it allows us to use a more complicated scoring scheme, and it's something a computer can get its teeth into. That is, we can let the computer do all the work, ignoring these score arrays, and just get the best local alignments based on our dynamic programming algorithm. That's the way it works in practice, and the way it works when you hook up with a genome database.