Skip to main content
. 2015 Dec 10;16:406. doi: 10.1186/s12859-015-0832-5

Fig. 13.

Fig. 13

Dynamic programming algorithm for the E2pair model. Dynamic programming algorithm to calculate the probability of two sequences related by a common ancestor by summing to all ancestors and to all evolutionary histories. The algorithm behaves as O(ll2) both in time and memory for two sequences of lengths l1 and l2. The parameters of the model have been described in Fig. 11. The algorithm assumes that the internal nodes are “profile” sequences, that is, sequences that instead of a fixed residue per position, they have a probability distribution of residues for each position px1(a),px2(a). This generalization becomes useful when we extend this pairwise algorithm to perform a progressive alignment, and we align internal nodes of the tree. Internal node sequences are estimated from the E2pair algorithm by the optimal posterior path through the model