Darwin Help

Back to Index

PSDynProg

Function PSDynProg


Calling Sequence  PSDynProg(ps1,ps2,dist,meth)
PSDynProg(ps1,ps2,dist,lnM,freq,gapcosts,meth)
Parameters
NameTypeDescription

ps1, ps2 ProbSeqProbabilistic sequences
dist numericDistance between the two sequences
lnM matrix(numeric)(optional) log. of a 1-PAM matrix
freq array(numeric)(optional) Natural frequencies of the characters
gapcosts procedure(optional) Gapcosts as a function of gap length
meth {Global,Local}(optional) alignment method
Return Type  [numeric, ProbSeq, ProbSeq]
Globals DBGTMP,
Synopsis Dynamic programming over two probabilistic sequences. In the standard case of proteins, the global varibles NewLogPAM1, AF and gap costs according to the Dayhoff matrices are used. For other types of sequences (e.g. DNA or codons), the logarithm of a mutation matrix (e.g. CodonLogPAM1) and the natural frequencies of the characters (e.g. CF) are required. Also, a gap cost function is needed that returns the costs for a gap of a given size. This is usually k->FixedDel+(k-1)*IncDel with the coefficients taken from the CMS matrix for the given distance. The default alignment method is 'Local'.
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('RAAVTGAAAQQQFT',IntToA):

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

> dist := 10:

> aps := PSDynProg(ps1,ps2,dist):

> print(aps);;
41.6760
 pos   Most probable chars
   1   V 1.00
   2   T 1.00
   3   G 1.00
   4   A 1.00
   5   A 1.00
   6   A 1.00
   7   Q 1.00
   8   Q 1.00
   9   Q 1.00
 pos   Most probable chars
   1   V 1.00
   2   T 1.00
   3   G 1.00
   4   <gap>
   5   <gap>
   6   <gap>
   7   Q 1.00
   8   Q 1.00
   9   Q 1.00


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