View source: R/tess.sim.taxa.R
tess.sim.taxa | R Documentation |
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).
tess.sim.taxa(n, nTaxa, max, lambda, mu, massExtinctionTimes = c(), massExtinctionSurvivalProbabilities = c(), samplingProbability = 1, samplingStrategy = "uniform", SURVIVAL = TRUE, MRCA = TRUE, t_crit = c())
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. |
Returns a tree in 'phylo' format.
Sebastian Hoehna
S. Hoehna: Fast simulation of reconstructed phylogenies under global, time-dependent birth-death processes. 2013, Bioinformatics, 29:1367-1374
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.