next up previous contents
Next: Find Best PAM Distance Up: Pairwise Matching Functions Previous: Backwards Dynamic Programming

Dynamic Programming

Calling Sequences:
seq1, seq2, DM)
seq1, seq2, DM, l1, l2)
seq1, seq2 : string
DM : DayMatrix
l1, l2 : posint

Returns: list - three elements (1) score, (2), length of match for sequence 1 and length of match for sequence 2.

Synposis: If no lengths are given as arguments ( l1, l2are not passed), the DynProg function computes the highest similarity score for the two sequences (or two subsequences of seq1 and seq2). This is referred to as the best global alignment.

If the lengths are given as arguments, then DynProg finds the alignment of length max(l1, l2) with maximum score. The alignment is guaranteed to use l1 elements of seq1 and l2 of seq2. This is referred to as the best local alignment.


> CreateOrigDayMatrix();                   # calculate the Dayhoff matrix DM
> DynProg('GHRICT', 'GYICT', DM);
> DynProg('GHRICT', 'GYICT', DM, 6, 5);


Gaston Gonnet