




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Class: GRECO-ROMAN ARCHTCT; Subject: Classics; University: University of California - Los Angeles; Term: Winter 2009;
Typology: Exams
1 / 182
This page cannot be seen from the preview
Don't miss anything!





























































































Version 2.3-
Date 2009-07-
Title Analyses of Phylogenetics and Evolution
Author Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong, Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel, Gangolf Jobb, Christoph Heibl, Daniel Lawson, Vincent Lefort, Pierre Legendre, Jim Lemon, Yvonnick Noel, Johan Nylander, Rainer Opgen-Rhein, Korbinian Strimmer, Damien de Vienne
Maintainer Emmanuel Paradis
Depends R (>= 2.6.0)
Suggests gee
Imports gee, nlme, lattice
ZipData no
Description ape provides functions for reading, writing, plotting, and manipulating phylogenetic trees, analyses of comparative data in a phylogenetic framework, analyses of diversification and macroevolution, computing distances from allelic and nucleotide data, reading nucleotide sequences, and several tools such as Mantel’s test, computation of minimum spanning tree, the population parameter theta based on various approaches, nucleotide diversity, generalized skyline plots, estimation of absolute evolutionary rates and clock-like trees using mean path lengths, non-parametric rate smoothing and penalized likelihood. Phylogeny estimation can be done with the NJ, BIONJ, and ME methods.
License GPL (>= 2)
URL http://ape.mpl.ird.fr/
Repository CRAN
Date/Publication 2009-07-21 12:27:
ace 5
Description
ape provides functions for reading and manipulating phylogenetic trees and DNA sequences, com- puting DNA distances, estimating trees with distance-based methods, and a range of methods for comparative analyses and analysis of diversification. Functionalities are also provided for program- ming new phylogenetic methods. The complete list of functions can be displayed with library(help = ape). More information on ape can be found at http://ape.mpl.ird.fr/.
Author(s)
Emmanuel Paradis, Ben Bolker, Julien Claude, Hoa Sien Cuong, Richard Desper, Benoit Durand, Julien Dutheil, Olivier Gascuel, Gangolf Jobb, Christoph Heibl, Daniel Lawson, Vincent Lefort, Pierre Legendre, Jim Lemon, Yvonnick Noel, Johan Nylander, Rainer Opgen-Rhein, Korbinian Strimmer, Damien de Vienne Maintainer: Emmanuel Paradis
References
Paradis, E. (2006) Analyses of Phylogenetics and Evolution with R. Springer, New York. Paradis, E., Claude, J. and Strimmer, K. (2004) APE: analyses of phylogenetics and evolution in R language. Bioinformatics, 20 , 289–290.
ace Ancestral Character Estimation
Description
This function estimates ancestral character states, and the associated uncertainty, for continuous and discrete characters. logLik, deviance, and AIC are generic functions used to extract the log-likelihood, the de- viance (-2*logLik), or the Akaike information criterion of a tree. If no such values are available, NULL is returned. anova is another generic function that is used to compare nested models: the significance of the additional parameter(s) is tested with likelihood ratio tests. You must ensure that the models are effectively nested (if they are not, the results will be meaningless). It is better to list the models from the smallest to the largest.
Usage
ace(x, phy, type = "continuous", method = "ML", CI = TRUE, model = if (type == "continuous") "BM" else "ER", scaled = TRUE, kappa = 1, corStruct = NULL, ip = 0.1)
logLik(object, ...)
ace 7
1, 2, 0), 2) a model with unequal rates, matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0),
Value
a list with the following elements:
ace if type = "continuous", the estimates of the ancestral character values. CI95 if type = "continuous", the estimated 95% confidence intervals. sigma2 if type = "continuous", model = "BM", and method = "ML", the maximum likelihood estimate of the Brownian parameter. rates if type = "discrete", the maximum likelihood estimates of the transition rates. se if type = "discrete", the standard-errors of estimated rates. index.matrix if type = "discrete", gives the indices of the rates in the rate matrix. loglik if method = "ML", the maximum log-likelihood. lik.anc if type = "discrete", the scaled likelihoods of each ancestral state. call the function call.
Author(s)
Emmanuel Paradis 〈[email protected]〉, Ben Bolker 〈[email protected]〉
References
Cunningham, C. W., Omland, K. E. and Oakley, T. H. (1998) Reconstructing ancestral character states: a critical reappraisal. Trends in Ecology & Evolution, 13 , 361–366. Felsenstein, J. (1985) Phylogenies and the comparative method. American Naturalist, 125 , 1–15. Martins, E. P. and Hansen, T. F. (1997) Phylogenies and the comparative method: a general ap- proach to incorporating phylogenetic information into the analysis of interspecific data. American Naturalist, 149 , 646–667. Pagel, M. (1994) Detecting correlated evolution on phylogenies: a general method for the com- parative analysis of discrete characters. Proceedings of the Royal Society of London. Series B. Biological Sciences, 255 , 37–45. Schluter, D., Price, T., Mooers, A. O. and Ludwig, D. (1997) Likelihood of ancestor states in adaptive radiation. Evolution, 51 , 1699–1711.
See Also
corBrownian, corGrafen, corMartins, compar.ou, anova
8 add.scale.bar
Examples
data(bird.orders) x <- rnorm(23)
ace(x, bird.orders) ace(x, bird.orders, method = "pic") ace(x, bird.orders, method = "GLS", corStruct = corBrownian(1, bird.orders))
x <- factor(c(rep(0, 5), rep(1, 18))) ans <- ace(x, bird.orders, type = "d")
plot(bird.orders, type = "c", FALSE, label.offset = 1) co <- c("blue", "yellow") tiplabels(pch = 22, bg = co[as.numeric(x)], cex = 2, adj = 1) nodelabels(thermo = ans$lik.anc, piecol = co, cex = 0.75)
tr <- character(4) tr[1] <- "((((t10:5.03,t2:5.03):2.74,(t9:4.17," tr[2] <- "t5:4.17):3.60):2.80,(t3:4.05,t7:" tr[3] <- "4.05):6.53):2.32,((t6:4.38,t1:4.38):" tr[4] <- "2.18,(t8:2.17,t4:2.17):4.39):6.33);" tr <- read.tree(text = paste(tr, collapse = "")) y <- c(rep(1, 6), rep(2, 4))
ace(y, tr, type = "d") ace(y, tr, type = "d", ip = 0.01)
ace(y, tr, type = "d", ip = 0.3)
add.scale.bar Add a Scale Bar to a Phylogeny Plot
Description
This function adds a horizontal bar giving the scale of the branch lengths to a plot of a phylogenetic tree on the current graphical device.
Usage
add.scale.bar(x = 0, y = 1, length = NULL, ...)
Arguments
x x location of the bar. y y location of the bar.
10 all.equal.phylo
Arguments
target an object of class "phylo". current an object of class "phylo". use.edge.length if FALSE only the topologies are compared; the default is TRUE. use.tip.label if FALSE the unlabelled trees are compared; the default is TRUE. index.return if TRUE the function returns a two-column matrix giving the correspondence between the nodes of both trees. tolerance the numeric tolerance used to compare the branch lengths. scale a positive number, comparison of branch lengths is made after scaling (i.e., di- viding) them by this number. ... further arguments passed to or from other methods.
Details
This function is meant to be an adaptation of the generic function all.equal for the comparison of phylogenetic trees. A single phylogenetic tree may have several representations in the Newick format and in the "phylo" class of objects used in ‘ape’. One aim of the present function is to be able to iden- tify whether two objects of class "phylo" represent the same phylogeny. Only the labelled topologies are compared (i.e. branch lengths are not considered.
Value
A logical value, or a two-column matrix.
Author(s)
Benoît 〈[email protected]〉
See Also
all.equal for the generic R function
Examples
t1 <- read.tree(text = "(a:1,b:1);") t2 <- read.tree(text = "(b:1,a:1);") all.equal(t1, t2)
identical(t1, t2)
t3 <- read.tree(text = "((a:1,b:1):1,c:2);") t4 <- read.tree(text = "(c:2,(a:1,b:1):1);")
as.alignment 11
all.equal(t3, t4) # == all.equal.phylo(t3, t4)
all.equal.list(t3, t4) t5 <- read.tree(text = "(a:2,(c:1,b:1):1);")
all.equal(t3, t5)
identical(all.equal(t3, t5), TRUE)
as.alignment Conversion Among DNA Sequence Internal Formats
Description
These functions transform a set of DNA sequences among various internal formats.
Usage
as.alignment(x) as.DNAbin(x, ...)
as.DNAbin(x, ...)
as.DNAbin(x, ...)
as.DNAbin(x, ...)
as.character(x, ...)
Arguments
x a matrix or a list containing the DNA sequences, or an object of class "alignment". ... further arguments to be passed to or from other methods.
Details
For as.alignment, the sequences given as argument should be stored as matrices or lists of single-character strings (the format used in ape before version 1.10). The returned object is in the format used in the package seqinr to store aligned sequences. as.DNAbin is a generic function with methods so that it works with sequences stored into vectors, matrices, or lists. as.character is a generic function: the present method converts objects of class "DNAbin" into the format used before ape 1.10 (matrix of single characters, or list of vectors of single char- acters). This function must be used first to convert objects of class "DNAbin" into the class "alignment".
as.matching 13
Details
A matching is a representation where each tip and each node are given a number, and sibling groups are grouped in a “matching pair” (see Diaconis and Holmes 1998, for details). This coding system can be used only for binary (fully dichotomous) trees. Diaconis and Holmes (1998) gave some conventions to insure that a given tree has a unique repre- sentation as a matching. I have tried to follow them in the present functions.
Value
as.matching returns an object of class "matching" with the following component:
matching a three-column numeric matrix where the first two columns represent the sibling pairs, and the third one the corresponding ancestor. tip.label (optional) a character vector giving the tip labels where the ith element is the label of the tip numbered i in matching. node.label (optional) a character vector giving the node labels in the same order than in matching (i.e. the ith element is the label of the node numbered i + n in matching, with n the number of tips).
as.phylo.matching returns an object of class "phylo".
Note
Branch lengths are not supported in the present version.
Author(s)
Emmanuel Paradis 〈[email protected]〉
References
Diaconis, P. W. and Holmes, S. P. (1998) Matchings and phylogenetic trees. Proceedings of the National Academy of Sciences USA, 95 , 14600–14602.
See Also
as.phylo
Examples
data(bird.orders) m <- as.matching(bird.orders) str(m) m tr <- as.phylo(m) all.equal(tr, bird.orders, use.edge.length = FALSE)
14 as.phylo
as.phylo Conversion Among Tree Objects
Description
as.phylo is a generic function which converts an object into a tree of class "phylo". There are currently two methods for this generic for objects of class "hclust" and of class "phylog" (implemented in the package ade4). as.hclust.phylo is a method of the generic as.hclust which converts an object of class "phylo" into one of class "hclust". This can used to convert an object of class "phylo" into one of class "dendrogram" (see examples). old2new.phylo and new2old.phylo are utility functions for converting between the old and new coding of the class "phylo".
Usage
as.phylo(x, ...)
as.phylo(x, ...)
as.phylo(x, ...)
as.hclust(x, ...) old2new.phylo(phy) new2old.phylo(phy)
Arguments
x an object to be converted into another class. ... further arguments to be passed to or from other methods. phy an object of class "phylo".
Value
An object of class "hclust" or "phylo".
Author(s)
Emmanuel Paradis 〈[email protected]〉
See Also
hclust, as.hclust, dendrogram, phylog, as.phylo.formula
16 axisPhylo
Value
An object of class phylo.
Author(s)
Julien Dutheil 〈[email protected]〉
See Also
as.phylo, read.tree for a description of phylo objects, multi2di
Examples
data(carnivora) plot(as.phylo(~SuperFamily/Family/Genus/Species, data=carnivora))
axisPhylo Axis on Side of Phylogeny
Description
This function adds a scaled axis on the side of a phylogeny plot.
Usage
axisPhylo(side = 1, ...)
Arguments
side a numeric value specifying the side where the axis is plotted: 1: below, 2: left, 3: above, 4: right. ... further arguments to be passed to axis.
Details
The further arguments (...) are used to format the axis. They may be font, cex, col, las, and so on (see the help pages on axis and par).
Author(s)
Emmanuel Paradis 〈[email protected]〉
See Also
plot.phylo, add.scale.bar, axis, par
balance 17
Examples
tr <- rtree(30) ch <- rcoal(30) plot(ch) axisPhylo() plot(tr, "c", FALSE, direction = "u") axisPhylo(2, las = 1)
balance Balance of a Dichotomous Phylogenetic Tree
Description
This function computes the balance of a phylogenetic tree, that is for each node of the tree the num- bers of descendants (i.e. tips) on each of its daughter-branch. The tree must be fully dichotomous.
Usage
balance(phy)
Arguments
phy an object of class "phylo".
Value
a numeric matrix with two columns and one row for each node of the tree. The columns give the numbers of descendants on each daughter-branches (the order of both columns being arbitrary). If the phylogeny phy has an element node.label, this is used as rownames for the returned matrix; otherwise the numbers (of mode character) of the matrix edge of phy are used as rownames.
Author(s)
Emmanuel Paradis 〈[email protected]〉
References
Aldous, D. J. (2001) Stochastic models and descriptive statistics for phylogenetic trees, from Yule to today. Statistical Science, 16 , 23–34.
bd.ext 19
Arguments
phy an object of class "phylo".
S a numeric vector giving the number of species for each tip.
Details
A re-parametrization of the birth-death model studied by Kendall (1948) so that the likelihood has to be maximized over d/b and b - d, where b is the birth rate, and d the death rate.
The standard-errors of the estimated parameters are computed using a normal approximation of the maximum likelihood estimates.
If the argument S has names, then they are matched to the tip labels of phy. The user must be careful here since the function requires that both series of names perfectly match, so this operation may fail if there is a typing or syntax error. If both series of names do not match, the values S are taken to be in the same order than the tip labels of phy, and a warning message is issued.
Note that the function does not check that the tree is effectively ultrametric, so if it is not, the returned result may not be meaningful.
Author(s)
Emmanuel Paradis 〈[email protected]〉
References
Paradis, E. (2003) Analysis of diversification: combining phylogenetic and taxonomic data. Pro- ceedings of the Royal Society of London. Series B. Biological Sciences, 270 , 2499–2505.
See Also
birthdeath, branching.times, diversi.gof, diversi.time, ltt.plot, yule, yule.cov
Examples
data(bird.orders)
S <- c(10, 47, 69, 214, 161, 17, 355, 51, 56, 10, 39, 152, 6, 143, 358, 103, 319, 23, 291, 313, 196, 1027, 5712) bd.ext(bird.orders, S)
20 bind.tree
bind.tree Binds Trees
Description
This function binds together two phylogenetic trees to give a single object of class "phylo".
Usage
bind.tree(x, y, where = "root", position = 0)
Arguments
x an object of class "phylo". y an object of class "phylo". where an integer giving the number of the node or tip of the tree x where the tree y is binded ("root" is a short-cut for the root). position a numeric value giving the position from the tip or node given by node where the tree y is binded; negative values are ignored.
Details
The argument x can be seen as the receptor tree, whereas y is the donor tree. The root of y is then sticked on a location of x specified by where and, possibly, position. If y has a root edge, this is added as in internal branch in the resulting tree.
Value
an object of class "phylo".
Note
For the moment, this function handles only trees with branch lengths, and does not handle node labels. Further testing/improvements may be needed.
Author(s)
Emmanuel Paradis 〈[email protected]〉
See Also
drop.tip, root