Darwin Help

Back to Index

ProbAncestor

Function ProbAncestor


Calling Sequence  ProbAncestor(ps1,ps2,d1,d2)
ProbAncestor(ps1,ps2,d1,d2,lnM,freq)
Parameters
NameTypeDescription

ps1, ps2 ProbSeqProbabilistic sequences
d1, d2 numericDistances to the common ancestor
lnM matrix(numeric)(optional) log. of a 1-PAM matrix
freq array(numeric)(optional) character frequencies
Return Type  ProbSeq
Globals LogLikelihoods,
Synopsis Given two probabilistic sequences and the distances to their common ancestor, this function computes the probabilistic ancestral sequence (PAS). The logarithm of a 1-PAM matrix is needed to compute the mutation matrices for the two distances. The mutation matrix NewlogPAM1 is the default value and can be used for amino acid sequences. For codon sequences CodonLogPAM1 is recommended. The ancestral probabilities depend on the natural frequencies of the characters. By default, the amino acid frequencies AF are used. The global variable LogLikelihoods will be assigned to an array containing the ln of the likelihoods at each position.
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
> ps1 := ProbSeq('AARV',IntToA):

> ps2 := ProbSeq('AVVV',IntToA):

> pas := ProbAncestor(ps1,ps2,10,10):

> print(pas);;
 pos   Most probable chars
   1   A 1.00   S 0.00   V 0.00   G 0.00   T 0.00
   2   A 0.56   V 0.43   L 0.00   T 0.00   I 0.00
   3   V 0.56   R 0.34   A 0.02   L 0.02   K 0.02
   4   V 1.00   I 0.00   L 0.00   A 0.00   T 0.00


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