** Next:** Find Best PAM Distance
** Up:** Pairwise Matching Functions
** Previous:** Backwards Dynamic Programming

`
`**Calling Sequences:**

`DynProg`(
*seq*_{1}, *seq*_{2}`, `*DM*`)
`

`DynProg`(
*seq*_{1}, *seq*_{2}`, `*DM*`, `
*l*_{1}, *l*_{2}`)
`

**Parameters:**

*seq*_{1}, *seq*_{2} |
: |
` string` |

*DM* |
: |
` DayMatrix` |

*l*_{1}, *l*_{2} |
: |
` 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 (
*l*_{1}, *l*_{2}`are not passed), the ``DynProg` function computes the highest
similarity score for the two sequences (or two subsequences of
*seq*_{1}` and `*seq*_{2}`). This is referred to as the best `*global
alignment*.

`If the lengths are given as arguments, then
``DynProg` finds the alignment of length
*max*(*l*_{1}, *l*_{2})` with
maximum score. The alignment is guaranteed to use `*l*_{1}` elements of
`*seq*_{1}` and `*l*_{2}` of `*seq*_{2}`. This is referred to as the best
`*local alignment*.

`
`**Examples:**

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

`
`

*Gaston Gonnet*

*1998-09-15*