Simulating taxonomy and fossil data on phylogenetic trees under mechanistic models of speciation, preservation and sampling.
R package for simulating fossil data on phylogenetic trees under mechanistic models of preservation and sampling
The latest version can be installed in R using the package devtools:
Simulating data using
FossilSim can be as simple as the following code snippets.
# simulate a tree using apetips = 8t = ape::rtree(tips)# simulate fossils using fossilsimrate = 2f = sim.fossils.poisson(rate, t)# plot the outputplot(f, t)
# simulate taxonomy using fossilsimbeta = 0.5 # probability of symmetric speciationlambda.a = 0.1 # rate of anagenesiss = sim.taxonomy(t, beta, lambda.a)# plot the outputplot(s, t, legend.position = "bottomright")
The following vignettes are available via CRAN and provide detailed examples:
Walker Pett Joseph O'Reilly
sim.fbd.rateshift.taxawhich led to trees being simulated with the wrong rates. NB: Any dataset simulated with this function before the fix is invalid and needs to be rerun.
fossils.to.pyratecan be used to convert objects generated by this package into PyRate format.
fossils.to.BEAST.start.tree.Rdcan be used to convert objects generated by this package into BEAST2 format.
subsample.fossils.youngestcan be used to subsample fossil occurrences.
sim.trait.values. Parameters are unchanged.
rangeplot.asymmetricand separated from the
rangeplot.asymmetricthat could lead to crashes or plots with missing edges.
SAtreeobjects were not created properly when using an empty