Diversitree
Comparative phylogenetic analysis of diversification in R. The "diversitree"
package includes a number of comparative phylogenetic methods,
mostly focussing on analysing diversification and character
evolution. Contains implementations of BiSSE (Binary State
Speciation and Extinction; Maddison et al. 2007: Syst. Biol. 56:
701) and its unresolved tree extensions (FitzJohn et al. 2009:
Syst. Biol. 58: 595), MuSSE (Multiple State Speciation and
Extinction), and QuaSSE (Quantitative State Speciation and
Extinction; FitzJohn 2010: Syst. Biol. in press), and GeoSSE
(Geographic State Speciation and Extinction; Goldberg et
al. 2010: Syst. Biol.). The package also includes support
for Markov models of character evolution (e.g., Pagel 1994, and
Brownian motion) and character-independent speciation/extinction
(Nee et al. 1994).
Diversitree has been used in a number of studies. If you use diversitree in a
paper, please let me know!
Installation
The simplest route is to install the package through R:
install.packages("diversitree")
will install diversitree from CRAN (current
CRAN version:
0.7-2).
Download and installation from source
The source package can be downloaded from here.
It is important that this file is not uncompressed by your
browser. If the file is downloaded without the "gz" extension,
try right-clicking the file and selecting "Save file as" (or
similar depending on your browser). Mac users might try
curl -O http://www.zoology.ubc.ca/prog/diversitree/diversitree_0.7-7.tar.gz
from the command line.
This download is a source package only; you will need a
working C and Fortran compiler to install the package. (Xcode +
gfortran is
sufficient on Mac OS X, most Linux systems are probably fine
as-is, and on windows consider MinGW or the tools here).
First, install the packages deSolve,
ape,
and subplex
From within R, run
install.packages("diversitree_0.7-7.tar.gz", repos=NULL, type="source")
which will compile and install the package.
See here for more information, for
known problems with Mac OS X 10.5 (leopard), and for information
about using QuaSSE.
Documentation
A preliminary tutorial is available here, which outlines use of
the main models. Most of the examples here use simulated data,
but to run the shorebird example, you will need a number of
files from here. Additional help is
available through R's online help system - type
library(help=diversitree) for a list of topics.
Frequently asked questions and answers are here.
Licence
Diversitree is released under the GPL, version
2.
It uses the excellent Expokit library
for matrix exponential calculations for using BiSSE with
terminally unresolved clades.
Releases / Changes
- 18 July 2011 [0.7-6]
- Works with deSolve 1.10-2.
- 11 July 2011 [0.7-6]
- New parametrisation of MuSSE available where the
multi-state trait is really combinations of binary states.
This allows expressing speciation and extinction rates as main
effects and interations of the underlying binary traits, and
easily restricting trait evolution to a single trait at a
time.
- Some internal streamlining that should speed up most
models slightly
- Faster stochastic character mapping
- Various bugs fixed (
mcmc not passing
additional arguments properly, make.bd.split not
using unresolved clade information).
- 12 May 2011 [0.7-2]
- Fixed bug that prevented use on Windows
- 11 May 2011 [0.7-1]
- New Sundials
based solver CVODE
available (switch with
control=list(backend="CVODES")). In some cases this is
8x faster than the previous version.
- Bug fixes. In particular, the equilibrium root state
treatment (
ROOT.EQUI) was incorrect.
- Works with deSolve 1.10.
- 20 April 2011 [0.6-5]
Bug fixes mostly:
- Better integration control for all ODE-based solvers.
- Slightly altered root state treatment (exact calculations
will change with
condition.surv=TRUE)
- Very basic mixed integer nonlinear optimisation approach
for finding ML point for some QuaSSE models that involve a
character space variable (poorly documented at present).
- Assorted minor bug fixes.
- 26 January 2011 [0.6-3]. Bug
fixes and some new features/models:
- Includes Emma
Goldberg's GeoSSE model
- New numerical method-of-lines
integrator for QuaSSE, which may be more robust in some
situations.
- Marginal ancestral state reconstructions for MuSSE
models.
- Better support for MuSSE/mkn models with >9 states
- Works with deSolve 1.9
- Builds on CRAN
for windows!
- 21 October 2010 [0.6-1]. A
number of new models.
- "QuaSSE" (Quantitative Trait Speciation and
Extinction): new method is now released. This tests for
correlation between a continuous/quantitative character and
rates of speciation and/or extinction. Includes support for
"split" QuaSSE analyses.
- Improved support for time dependent models: now,
speciation, extinction, and (for BiSSE only) character change
rates may be arbitrary functions of time. This is implemented
for birth-death models, BiSSE, and MuSSE.
- 23 September 2010 [0.5-3]. A couple
of model extensions, documentation improvements, and bug fixes.
- Now works with deSolve 1.8
- Time-dependent and "split" MuSSE models are now included.
The interface for both is similar to their BiSSE
analogues.
- A new tutorial document.
- 12 August 2010 [0.5-2]. A
number of new models and bug fixes.
- "MuSSE" (Multi-State Speciation and Extinction):
the multiple-character extension to BiSSE is now implemented.
This allows modelling characters with more than two states, or
combinations of characters (similar to the Pagel 1994 method
for rates of character evolution). Likelihood calculations
and tree simulation are supported.
- Simple support for Brownian Motion models of continuous
trait evolution (single trait only).
- "Split BiSSE" model: this combines aspects of the MEDUSA
model (Alfaro et al. 2009) with the BiSSE model to allow
different parts of the tree to have different rates of
speciation, extinction, and/or character evolution. For
completeness a "Split BD" model is also implemented. None of
these assist in searching for positions in the tree where
rates shift.
- "Time-dependent" BiSSE, where different chunks of time
have different rates of speciation, extinction, and/or
character evolution.
The new models' documentation is still very preliminary and
these are not yet in the tutorial document.
Other new features:
- Interrupting a
mcmc run will return a
truncated set of samples.
- Constrained functions can be constrained (though this is
still limited)
subplex is now the default ML search
algorithm for BiSSE and MuSSE models.
- 2 March 2010 [0.4-5]. Some
important bug fixes (BiSSE likelihood calculations were very
slightly incorrect at root and unresolved clade calculations
were incorrect when no species within a clade had a known
state). Other changes:
- Added support for sampling and unresolved clades in
constant rate birth-death models.
- Fixes to the Mk2 ancestral state reconstructions
- Works with deSolve version 1.7
- Assorted small bug fixes and documentation
improvements
- 2 Febrary 2010 [0.4-4]. New
features include:
- Ancestral state reconstruction and stochastic character
mapping under Mk2 (
?asr.mk2) (slow, but will get
faster in future versions)
- Much faster Mk2 likelihood calculation (speed increase of
20-50x)
- Ancestral state reconstruction under BiSSE
(
?asr.marginal.bisse)
The ancestral state reconstruction code should be regarded as
experimental.
- 19 January 2010 [0.4-3]. Mostly
a few bug fixes.
- 11 January 2010 [0.4-2]. New
features include:
- Remembering and plotting character histories on simulated
trees (see
?tree.bisse
- Works with deSolve 1.6
- Support for simulating Yule trees and estimating Yule
model parameters
- Bug fixes and improvements to the MLE code
- 02 December 2009 [0.4-1]. New
features include
- Constant rate birth death model (
make.bd) and
Mk2/Mk-n (make.mk2, make.mkn) models
implemented
- Now works with the current deSolve package
- Node states now retained during tree simulation (see
?trees for an example)
- Simple MCMC plots with
profiles.plot
- Several bugs fixes, documentation improvements, additional
examples, and minor features
- 16 October 2009 [0.3-2]:: Minor bugfix
- 15 October 2009 [0.3-1]:
- New formula-based constraint interface (through function
constrain())
- Subplex available to do ML searches
- Simple hypothesis testing convenience functions added
(
anova(), logLik()).
- 5 May 2009 [0.2-1]: Initial public release
References
-
Alfaro M.E., Santini F., Brock C., Alamillo H., Dornburg A.,
Rabosky D.L., Carnevale G., and Harmon L.J. 2009. Nine
exceptional radiations plus high turnover explain species
diversity in jawed vertebrates.
Proc. Natl. Acad. Sci. U.S.A. 106:13410-13414.
-
FitzJohn, R.G., W.P. Maddison, and S.P. Otto. 2009.
Estimating trait-dependent speciation and extinction rates
from incompletely resolved phylogenies. Syst. Biol. 58:
595-611.
-
FitzJohn R.G. 2010. Quantitative traits and diversification.
Systematic Biology 59: 619-633.
-
Goldberg E.E., Lancaster L.T., and Ree R.H. 2011.
Phylogenetic inference of reciprocal effects between
geographic range evolution and diversification. Systematic
Biology in press.
-
Maddison, W.P., P.E. Midford, and S.P. Otto. 2007. Estimating
a binary character's effect on speciation and
extinction. Syst. Biol. 56: 701-710.
-
Nee S., May R.M., and Harvey P.H. 1994. The reconstructed
evolutionary process. Philos. Trans. R. Soc. Lond. B
Biol. Sci. 344:305-311.
-
Pagel M. 1994. Detecting correlated evolution on phylogenies:
a general method for the comparative analysis of discrete
characters. Proc. R. Soc. Lond. B Biol. Sci. 255:37-45.