tess.sim.taxa {TESS} | R Documentation |
tess.sim.taxa.taxa: Simulate a reconstructed tree for a given number of taxa under a global, time-dependent birth-death process.
Description
tess.sim.taxa simulates a reconstructed phylogenetic tree under a global, time-dependent birth-death process conditioned on the number of taxa sampled. The rates may be any positive function of time or a constant. The process starts at time 0 and goes forward in time, hence the rates and events should be interpreted in the time after the origin. Additionally, mass-extinction event can be provided and a uniform taxon sampling probability. It is possible to start either with the origin (1 species) or with the most recent common ancestor (2 species).
Usage
tess.sim.taxa(n, nTaxa, max, lambda, mu, massExtinctionTimes = c(),
massExtinctionSurvivalProbabilities = c(), samplingProbability = 1,
samplingStrategy = "uniform", SURVIVAL = TRUE, MRCA = TRUE, t_crit = c())
Arguments
n |
Number of simulations. |
nTaxa |
Number of species sampled. |
max |
Maximum time/height of the tree. |
lambda |
The speciation rate function or constant. |
mu |
The extinction rate function or constant. |
massExtinctionTimes |
The set of mass-extinction times after the start of the process. |
massExtinctionSurvivalProbabilities |
The set of survival probabilities for each speciation event. The set must have the same length as the set of mass-extinction times. |
samplingProbability |
The probability for a species to be included in the sample. |
samplingStrategy |
The strategy how samples were obtained. Options are: uniform|diversified. |
SURVIVAL |
Do you want to condition on survival of the process? |
MRCA |
Does the process start with the most recent common ancestor? |
t_crit |
The critical time points when a jump in the rate function occurs. Only a help for the numerical integration routine. |
Value
Returns a tree in 'phylo' format.
Author(s)
Sebastian Hoehna
References
S. Hoehna: Fast simulation of reconstructed phylogenies under global, time-dependent birth-death processes. 2013, Bioinformatics, 29:1367-1374
Examples
l <- Vectorize(function(x) { if (x > 0.5 || x < 0.3) { return (1) } else { return (2) } })
e <- Vectorize(function(x) { if (x > 0.5 || x < 0.3) { return (0.95) } else { return (0.5) } })
tess.sim.taxa(n=1,nTaxa=10,max=10,l,e,MRCA=TRUE)
# simulation under constant rates
tess.sim.taxa(n=1,nTaxa=10,max=10,2.0,1.0,MRCA=TRUE)