pml
computes the likelihood of a phylogenetic tree
given a sequence alignment and a model. optim.pml
optimizes the
different model parameters.
pml(tree, data, bf=NULL, Q=NULL, inv=0, k=1, shape=1, rate=1, model="", ...)
optim.pml(object, optNni=FALSE, optBf=FALSE, optQ=FALSE, optInv=FALSE, optGamma=FALSE, optEdge=TRUE, optRate=FALSE, optRooted=FALSE, control = pml.control(epsilon=1e-08, maxit=10, trace=1), model = NULL, rearrangement = ifelse(optNni, "NNI","none"), subs = NULL, ratchet.par = list(iter = 20L, maxit = 100L, prop = 1/3),...)
pml.control(epsilon = 1e-08, maxit = 10, trace = 1)
tree
, object of class phylo
. phyDat
.pml
.pml
or optim.pml
return a list of class pml
, some are useful for further computations likepml
:
model | optBf |
optQ | Jukes-Cantor |
FALSE | FALSE |
F81 | TRUE |
FALSE | symmetric |
FALSE | TRUE |
So far 17 amino acid models are supported ("WAG", "JTT", "LG", "Dayhoff", "cpREV", "mtmam", "mtArt", "MtZoa", "mtREV24", "VT","RtREV", "HIVw", "HIVb", "FLU", "Blossum62", "Dayhoff_DCMut" and "JTT_DCMut") and additionally rate matrices and amino acid frequencies can be supplied.
It is also possible to estimate codon models (e.g. YN98), for details see also the chapter in vignette("phangorn-specials").
If the option 'optRooted' is set to TRUE than the edge lengths of rooted tree are optimized.
The tree has to be rooted and by now ultrametric! Optimising rooted trees is generally much slower.
pml.control
controls the fitting process. epsilon
and maxit
are only defined
for the most outer loop, this affects pmlCluster
, pmlPart
and pmlMix
.
epsilon
is defined as (logLik(k)-logLik(k+1))/logLik(k+1), this seems to be a good
heuristics which works reasonably for small and large trees or alignments.
If trace
is set to zero than no out put is shown, if functions are called internally
than the trace is decreased by one, so a higher of trace produces more feedback.
If rearrangement
is set to stochastic
a stochastic search algorithm similar to Nguyen et al. (2015).
and for ratchet
the likelihood ratchet as in Vos (2003).
This should helps often to find better tree topologies, especially for larger trees.
Felsenstein, J. (2004). Inferring Phylogenies. Sinauer Associates, Sunderland.
Yang, Z. (2006). Computational Molecular evolution. Oxford University Press, Oxford.
Adachi, J., P. J. Waddell, W. Martin, and M. Hasegawa (2000) Plastid genome phylogeny and a model of amino acid substitution for proteins encoded by chloroplast DNA. Journal of Molecular Evolution, 50, 348--358
Rota-Stabelli, O., Z. Yang, and M. Telford. (2009) MtZoa: a general mitochondrial amino acid substitutions model for animal evolutionary studies. Mol. Phyl. Evol, 52(1), 268--72
Whelan, S. and Goldman, N. (2001) A general empirical model of protein evolution derived from multiple protein families using a maximum-likelihood approach. Molecular Biology and Evolution, 18, 691--699
Le, S.Q. and Gascuel, O. (2008) LG: An Improved, General Amino-Acid Replacement Matrix Molecular Biology and Evolution, 25(7), 1307--1320
Yang, Z., R. Nielsen, and M. Hasegawa (1998) Models of amino acid substitution and applications to Mitochondrial protein evolution. Molecular Biology and Evolution, 15, 1600--1611
Abascal, F., D. Posada, and R. Zardoya (2007) MtArt: A new Model of amino acid replacement for Arthropoda. Molecular Biology and Evolution, 24, 1--5
Kosiol, C, and Goldman, N (2005) Different versions of the Dayhoff rate matrix - Molecular Biology and Evolution, 22, 193--199
L.-T. Nguyen, H.A. Schmidt, A. von Haeseler, and B.Q. Minh (2015) IQ-TREE: A fast and effective stochastic algorithm for estimating maximum likelihood phylogenies. Molecular Biology and Evolution, 32, 268--274.
Vos, R. A. (2003) Accelerated Likelihood Surface Exploration: The Likelihood Ratchet. Systematic Biology, 52(3), 368--373
Yang, Z., and R. Nielsen (1998) Synonymous and nonsynonymous rate variation in nuclear genes of mammals. Journal of Molecular Evolution, 46, 409-418.
Lewis, P.O. (2001) A likelihood approach to estimating phylogeny from discrete morphological character data. Systematic Biology 50, 913--925.
bootstrap.pml
, modelTest
, pmlPart
, pmlMix
, plot.phylo
, SH.test
, ancestral.pml
example(NJ)
# Jukes-Cantor (starting tree from NJ)
fitJC <- pml(tree, Laurasiatherian)
# optimize edge length parameter
fitJC <- optim.pml(fitJC)
fitJC
## Not run:
# # search for a better tree using NNI rearrangements
# fitJC <- optim.pml(fitJC, optNni=TRUE)
# fitJC
# plot(fitJC$tree)
#
# # JC + Gamma + I - model
# fitJC_GI <- update(fitJC, k=4, inv=.2)
# # optimize shape parameter + proportion of invariant sites
# fitJC_GI <- optim.pml(fitJC_GI, optGamma=TRUE, optInv=TRUE)
# # GTR + Gamma + I - model
# fitGTR <- optim.pml(fitJC_GI, rearrangement = "stochastic",
# optGamma=TRUE, optInv=TRUE, model="GTR")
# ## End(Not run)
# 2-state data (RY-coded)
dat <- acgt2ry(Laurasiatherian)
fit2ST <- pml(tree, dat)
fit2ST <- optim.pml(fit2ST,optNni=TRUE)
fit2ST
# show some of the methods available for class pml
methods(class="pml")
Run the code above in your browser using DataLab