tess.sim.age: tess.sim.age: Simulate a reconstructed tree for a given age...

Description Usage Arguments Value Author(s) References Examples

View source: R/tess.sim.age.R

Description

tess.sim.age simulates a reconstructed phylogenetic tree under a global, time-dependent birth-death process conditioned on the age of the tree. 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

1
2
3
tess.sim.age(n, age, lambda, mu, massExtinctionTimes = c(), 
   massExtinctionSurvivalProbabilities = c(), samplingProbability = 1, 
   samplingStrategy = "uniform", maxTaxa = Inf, MRCA = TRUE)

Arguments

n

Number of simulations.

age

The age of the tree, i.e. the time to simulate.

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.

maxTaxa

The maximum number of possible taxa. If by chance a higher number is simulated, than simply ntaxa=maxTaxa. This is useful when too large trees should be simulated because this takes too much time and memory.

MRCA

Does the process start with the most recent common ancestor?

Value

Returns a set of trees 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

1
2
3
4
5
6
7
l <- function(x) { if (x > 0.5 || x < 0.3) { return (1) } else { return (2) } }
e <- function(x) { if (x > 0.5 || x < 0.3) { return (0.95) } else { return (0.5) } }

tess.sim.age(n=1,age=1,l,e,MRCA=TRUE)

# simulation under constant rates
tess.sim.age(n=1,age=1,2.0,1.0,MRCA=TRUE)

hoehna/TESS documentation built on Feb. 3, 2022, 5:59 a.m.