Darwin Help

Back to Index

PASfromTree

Function PASfromTree


Calling Sequence  PASfromTree(seqs,tree)
PASfromTree(seqs,tree,lnM,freq,gapcosts)
Parameters
NameTypeDescription

seqs array({ProbSeq,string})(probabilistic) sequences
tree Treetree of the sequences
lnM matrix(numeric)(optional) log. of a 1-PAM matrix
freq array(numeric)(optional) freq. of characters
gapcosts procedure(optional) gap cost function
Synopsis Computes the probabilistic ancestral sequence at the root of a phylogenetic tree over a list of probabilistic sequences. For each internal node, the prob. sequences at the roots of the two subtrees are aligned and then an ancestral vector is computed. The global variable LogLikelihoods will be assigned to an array containing the ln of the likelihoods at each position. The third field of the leaves must be integer numbers corresponding to the sequences in the list (as it is automatically teh case when the tree comes either from an MAlign or a PhylogeneticTree call). For protein sequences, the global variables NewLogPAM1, AF and gap costs drevied from DMS are assumed. For other types of sequences, the log of a mutation matrix (e.g. CodonLogPAM1), a vector of natural character frequencies (e.g. CF) and a function to compute gap costs for a given gap length at a given PAM distance is needed. (Typically of the form (pam,len)->-37.64+7.434*log10(pam)-(len-1)*1.3961).
References GM Cannarozzi, A Schneider and GH Gonnet (2007): Probabilistic Ancestral Sequences Based on the Markovian Model of Evolution - Algorithms and Applications, in: D Liberless (editor): Ancestral Sequence Reconstruction, Oxford University Press.
Examples
> seqs := ['VAAAR','AARR','VTAARRQQ']:

> ps := [seq(ProbSeq(s,IntToA),s=seqs)]:

> tree := PhylogeneticTree(seqs,[seq(i,i=1..length(seqs))],DISTANCE);

> pas := PASfromTree(ps,tree):

> print(pas);;
 pos   Most probable chars
   1   V 1.00   I 0.00   L 0.00   A 0.00   T 0.00
   2   A 0.71   T 0.25   S 0.02   V 0.01   K 0.00
   3   A 1.00   S 0.00   V 0.00   G 0.00   T 0.00
   4   A 1.00   S 0.00   V 0.00   G 0.00   T 0.00
   5   R 1.00   K 0.00   Q 0.00   A 0.00   S 0.00
   6   R 0.97   K 0.01   Q 0.00   A 0.00   L 0.00
   7   Q 0.76   E 0.05   K 0.04   R 0.03   A 0.02
   8   Q 0.76   E 0.05   K 0.04   R 0.03   A 0.02


See also CreateCodonMatrices,   CreateDayMatrices,   PASfromMSA,   ProbAncestor,   ProbSeq,   PSDynProg