View source: R/createMrBayesTipCalibrations.R
createMrBayesTipCalibrations | R Documentation |
Takes a set of tip ages (in several possible forms, see below), and outputs a set of tip age calibrations for use with tip-dating analyses (sensu Zhang et al., 2016) in the popular phylogenetics program MrBayes. These calibrations are printed as a set of character strings, as well as a line placing an offset exponential prior on the tree age, either printed in the R console or in a named text file, which can be used as commands in the MrBayes block of a NEXUS file for use with (you guessed it!) MrBayes.
createMrBayesTipCalibrations( tipTimes, ageCalibrationType, whichAppearance = "first", treeAgeOffset, minTreeAge = NULL, collapseUniform = TRUE, anchorTaxon = TRUE, file = NULL )
tipTimes |
This input may be either: (a) a |
ageCalibrationType |
This argument decides how age calibrations are defined,
and currently allows for four options: |
whichAppearance |
Which appearance date of the taxa should be used:
their |
treeAgeOffset |
A parameter given by the user controlling the offset between the minimum and expected tree age prior. mean tree age for the offset exponential prior on tree age will be set to the minimum tree age, plus this offset value. Thus, an offset of 10 million years would equate to a prior assuming that the expected tree age is around 10 million years before the minimum age. |
minTreeAge |
if |
collapseUniform |
MrBayes won't accept uniform age priors where the maximum and
minimum age are identical (i.e. its actually a fixed age). Thus, if this argument
is |
anchorTaxon |
This argument may be a logical (default is |
file |
Filename (possibly with path) as a character string
to a file which will be overwritten with the output tip age calibrations.
If |
Beware: some combinations of arguments might not make sense for your data.
(But that's always true, is it not?)
If argument file
is NULL
, then the tip age commands
are output as a series of character strings.
All taxa with their ages set to fixed by the behavior of anchorTaxon
or collapseUniform
are returned as a list within a commented line of the returned MrBayes block.
David W. Bapst. This code was produced as part of a project funded by National Science Foundation grant EAR-1147537 to S. J. Carlson.
Zhang, C., T. Stadler, S. Klopfstein, T. A. Heath, and F. Ronquist. 2016. Total-Evidence Dating under the Fossilized Birth-Death Process. Systematic Biology 65(2):228-249.
createMrBayesConstraints
, createMrBayesTipDatingNexus
# load retiolitid dataset data(retiolitinae) # uniform prior, with a 10 million year offset for # the expected tree age from the earliest first appearance createMrBayesTipCalibrations( tipTimes = retioRanges, whichAppearance = "first", ageCalibrationType = "uniformRange", treeAgeOffset = 10) # fixed prior, at the earliest bound for the first appearance createMrBayesTipCalibrations( tipTimes = retioRanges, whichAppearance = "first", ageCalibrationType = "fixedDateEarlier", treeAgeOffset = 10 ) # fixed prior, sampled from between the bounds on the last appearance # you should probably never do this, fyi createMrBayesTipCalibrations( tipTimes = retioRanges, whichAppearance = "first", ageCalibrationType = "fixedDateRandom", treeAgeOffset = 10 ) ## Not run: createMrBayesTipCalibrations( tipTimes = retioRanges, whichAppearance = "first", ageCalibrationType = "uniformRange", treeAgeOffset = 10, file = "tipCalibrations.txt" ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.