Analysis of Phylogenetic and Evolution | CLASSIC 0153I, Exams of Classical Philology

Material Type: Exam; Class: GRECO-ROMAN ARCHTCT; Subject: Classics; University: University of California - Los Angeles; Term: Winter 2009;

Typology: Exams

Pre 2010

Uploaded on 09/17/2009

koofers-user-6ht
koofers-user-6ht 🇺🇸

10 documents

1 / 182

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Package ‘ape’
July 21, 2009
Version 2.3-2
Date 2009-07-17
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 <[email protected]>
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:14
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Analysis of Phylogenetic and Evolution | CLASSIC 0153I and more Exams Classical Philology in PDF only on Docsity!

Package ‘ape’

July 21, 2009

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:

2 R topics documented:

  • ape-package R topics documented:
  • ace
  • add.scale.bar
  • all.equal.phylo
  • as.alignment
  • as.matching
  • as.phylo
  • as.phylo.formula
  • axisPhylo
  • balance
  • base.freq
  • bd.ext
  • bind.tree
  • BIONJ
  • bird.families
  • bird.orders
  • birthdeath
  • boot.phylo
  • branching.times
  • CADM.global
  • carnivora
  • cherry
  • chiroptera
  • chronogram
  • chronoMPL
  • chronopl
  • coalescent.intervals
  • collapse.singles
  • collapsed.intervals
  • compar.cheverud
  • compar.gee
  • compar.lynch
  • compar.ou
  • compute.brlen
  • consensus
  • cophenetic.phylo
  • cophyloplot
  • corBlomberg
  • corBrownian
  • corClasses
  • corGrafen
  • corMartins
  • corPagel
  • correlogram.formula
  • data.nex
  • del.gaps
  • R topics documented:
  • dist.dna
  • dist.gene
  • dist.topo
  • diversi.gof
  • diversi.time
  • DNAbin
  • DNAmodel
  • drop.tip
  • evolve.phylo
  • FastME
  • gammaStat
  • GC.content
  • heterozygosity
  • hivtree
  • howmanytrees
  • identify.phylo
  • Initialize.corPhyl
  • is.binary.tree
  • is.monophyletic
  • is.ultrametric
  • ladderize
  • landplants
  • ltt.plot
  • makeLabel
  • makeNodeLabel
  • mantel.test
  • mat3
  • mat5M3ID
  • mat5Mrand
  • matexpo
  • mcmc.popsize
  • mlphylo
  • Moran.I
  • mrca
  • mst
  • multi2di
  • nj
  • node.depth
  • nodelabels
  • NPRS.criterion
  • nuc.div
  • opsin
  • phymltest
  • pic
  • plot.ancestral
  • plot.correlogram
  • plot.phylo
  • plot.varcomp
  • print.phylo 4 ape-package
  • ratogram
  • read.caic
  • read.dna
  • read.GenBank
  • read.nexus
  • read.nexus.data
  • read.tree
  • reorder.phylo
  • root
  • rotate
  • rtree
  • seg.sites
  • sh.test
  • skyline
  • skylineplot
  • subtreeplot
  • subtrees
  • summary.phylo
  • theta.h
  • theta.k
  • theta.s
  • unique.multiPhylo
  • varcomp
  • vcv.phylo
  • weight.taxo
  • which.edge
  • woodmouse
  • write.dna
  • write.nexus
  • write.nexus.data
  • write.tree
  • yule
  • yule.cov
  • yule.time
  • zoom
  • Index

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)

S3 method for class 'ace':

logLik(object, ...)

S3 method for class 'ace':

ace 7

1, 2, 0), 2) a model with unequal rates, matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0),

  1. a model with three states and equal rates of transition (the diagonal is always ignored). There are short-cuts to specify these models: "ER" is an equal-rates model (e.g., the first and third examples above), "ARD" is an all-rates-different model (the second example), and "SYM" is a symmetrical model (e.g., matrix(c(0, 1, 2, 1, 0, 3, 2, 3, 0), 3)). If a short-cut is used, the number of states is determined from the data.

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

Just some random data...

data(bird.orders) x <- rnorm(23)

Compare the three methods for continuous characters:

ace(x, bird.orders) ace(x, bird.orders, method = "pic") ace(x, bird.orders, method = "GLS", corStruct = corBrownian(1, bird.orders))

For discrete characters:

x <- factor(c(rep(0, 5), rep(1, 18))) ans <- ace(x, bird.orders, type = "d")

Showing the likelihoods on each node:

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)

An example of the use of the argument `ip':

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))

The default `ip = 0.1' makes ace fails:

ace(y, tr, type = "d") ace(y, tr, type = "d", ip = 0.01)

Surprisingly, using an initial value farther to the

MLE than the default one works:

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

maybe the simplest example of two representations

for the same rooted tree...:

t1 <- read.tree(text = "(a:1,b:1);") t2 <- read.tree(text = "(b:1,a:1);") all.equal(t1, t2)

... compare with this:

identical(t1, t2)

one just slightly more complicated...:

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)

... here we force the comparison as lists:

all.equal.list(t3, t4) t5 <- read.tree(text = "(a:2,(c:1,b:1):1);")

note that this does NOT return FALSE...:

all.equal(t3, t5)

... do this instead:

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, ...)

S3 method for class 'character':

as.DNAbin(x, ...)

S3 method for class 'list':

as.DNAbin(x, ...)

S3 method for class 'alignment':

as.DNAbin(x, ...)

S3 method for class 'DNAbin':

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, ...)

S3 method for class 'hclust':

as.phylo(x, ...)

S3 method for class 'phylog':

as.phylo(x, ...)

S3 method for class 'phylo':

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

An example from Paradis (2003) using the avian orders:

data(bird.orders)

Number of species in each order from Sibley and Monroe (1990):

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