rescale.phylo {geiger} | R Documentation |
Rescale object of class "phylo"
Description
Applying various transformation to the branches of a phylogenetic tree.
Usage
## S3 method for class 'phylo'
rescale(x, model = c("BM", "OU", "EB", "nrate", "lrate",
"trend", "lambda", "kappa", "delta", "white", "depth"), ...)
Arguments
x |
an object of class |
model |
a model used to transform the tree (see Details). |
... |
argument(s) to be passed to the transformation function (see Examples). |
Details
This function takes a tree and returns either a transformed tree if ...
is not empty and gives the parameter value(s) for the tree transformation. If ...
is left empty, a function is returned to the user that can be efficiently iterated over many parameter values for transformation. The available models are meant to correspond with changing the model of phenotypic evolution for discrete or continuous characters.
Value
A transformation function (or rescaled phylogenetic tree of class 'phylo' (ape format) is returned. Possible transforms include the following:
\bold{BM} |
is the Brownian motion model, which fits a random walk with variance |
\bold{OU} |
is the Ornstein-Uhlenbeck model (Butler and King 2004), which fits a random walk with a central tendency with an attraction strength proportional to the parameter |
\bold{EB} |
is the Early-burst model (Harmon et al. 2010) and also called the |
\bold{nrate} |
is the multiple-rates model where time slices have independent rates of evolution. The parameters used for transformation are |
\bold{lrate} |
is the multiple-rates model where local clades have independent rates of evolution. The parameters used for transformation are |
\bold{trend} |
is a diffusion model with linear trend in rates through time. The parameter used for transformation is |
\bold{lambda} |
is one of the Pagel (1999) models that fits the extent to which the phylogeny predicts covariance among trait values for species. The model effectively transforms the tree as follows: values of |
\bold{kappa} |
is a punctuational (speciational) model of trait evolution (Pagel 1999), where character divergence is related to the number of speciation events between two species. Note that if there are missing speciation events in the given phylogeny (due to extinction or incomplete sampling), interpretation under the |
\bold{delta} |
is a time-dependent model of trait evolution (Pagel 1999). The |
\bold{white} |
is a |
\bold{depth} |
is simply a transformation of the total depth of the tree; stretching the tree has an effect of increasing rates of evolution under Brownian motion (relative to characters evolved on the unstretched tree), and compressing the tree has the opposite effect. The parameter used for transformation is |
Author(s)
LJ Harmon and JM Eastman
References
Pagel, M. 1999. Inferring the historical patterns of biological evolution. Nature 401:877-884.
Butler, M.A. and A.A. King, 2004. Phylogenetic comparative analysis: a modeling approach for adaptive evolution. American Naturalist 164:683-695.
Various papers in prep., L. J. Harmon and J. T. Weir.
Examples
geo <- get(data(geospiza))
## returning a function
ltrns <- rescale(geo$phy, "lambda")
plot(ltrns(0))
title("lambda: 0.0")
plot(ltrns(0.5))
title("lambda: 0.5")
plot(ltrns(1))
title("lambda: 1")
## transforming the tree
lphy <- rescale(geo$phy, "lambda", 0.5) # transform tree in one fell swoop
plot(lphy)
title("lambda: 0.5")
## multirate tree -- time
rtrns <- rescale(geo$phy, "nrate")
rphy <- rtrns(time=c(0.2, 0.4, 0.6, 0.8), rate=c(2, 4, 8, 16))
plot(rphy)
title("5-rate tree: by time")
## multirate tree -- lineages
mtrns <- rescale(geo$phy, "lrate")
mphy <- mtrns(node=c(25, 20), rate=c(4, 8))
plot(mphy)
title("3-rate tree: by lineages")