bammdata object from MCMC outputgetEventData reads shift configuration data (the "event data" output) from a BAMM analysis and creates a bammdata object. The bammdata object is fundamental for extracting information about macroevolutionary rate variation through time and among lineages.getEventData(phy, eventdata, burnin = 0, nsamples = NULL,
verbose = FALSE, type = "diversification")phylo - specifically, the time calibrated tree that was analyzed with BAMM. Alternatively, a character string specifying the path to a newick-formatted tree.BAMM event-data file. Alternatively, an object of class data.frame that includes the event data from a BAMM run.bammdata object. May be NULL.TRUE progess is outputted to the console. Defaults to FALSE.phylo in package ape.phylo in package ape.phylo in package ape.phylo in package ape.phy for each posterior sample. The length of this vector is equal to the number of posterior samples in the bammdata object.node - a node number. This identifies
the branch where the event originates. time - this is the absolute time on
that branch where the event originates (with the root at time 0). lam1 - an initial rate of speciation or trait evolution.
lam2 - a decay/growth parameter. mu1 - an initial rate of extinction.
mu2 - a decay/growth parameter. index - a unique integer associated with the event.
See 'Details'.phy the index of the event that occurs along that branch.
Branches are ordered increasing here and elsewhere.Column 1 identifies a node in phy.
Column 2 identifies the beginning time of the branch or segment
of the branch that subtends the node in Column 1. Column 3 identifies the
ending time of the branch or segment of the branch that subtends the node in Column 1.
Column 4 identifies the index of the event that occurs along the branch or segment
of the branch that subtends the node in Column 1.BAMM trait results.phy. The order corresponds to the
order in which nodes are visited by a pre-order tree traversal.downseq. downseq and lastvisit can be used to quickly retrieve
the descendants of any node. e.g. the descendants of node 89 can be found by
downseq[which(downseq==89):which(downseq==lastvisit[89]).BAMM models a rate $R$, e.g. speciation, as a function that changes exponentially with time: $R(t) = R(0)*exp(b*t)$. Here $R(0)$ is the initial rate and $b$ is a parameter determining how quickly that rate grows or decays with time. The eventdata file (or data frame) is a record of events and associated parameters that were sampled with BAMM during simulation of the posterior with reversible jump MCMC. This complex, information-rich file is processed into a bammdata object, which serves as the core data object for numerous downstream analyses. From a bammdata object, you can summarize rate variation through time, among clades, extract locations of rate shifts, summarize clade-specific rates of speciation and extinction, and more.
In general, the user does not need to be concerned with the details of a bammdata object. The object is used as input by a number of BAMMtools functions.
The parameter nsamples can be used to reduce the total amount of data included in the raw eventdata output from a BAMM run. The final bammdata object will consist of all data for nsamples from the posterior. These nsamples are equally spaced after discarding some burnin fraction as "burn-in". If nsamples is set to NULL, the bammdata object will include all samples in the posterior after discarding the burnin fraction.
Rabosky, D. L. 2014. Automatic detection of key innovations, rate shifts, and diversity-dependence on phylogenetic trees. PLoS ONE 9:e89543
Rabosky, D. L., F. Santini, J. T. Eastman, S. A. Smith, B. L. Sidlauskas, J. Chang, and M. E. Alfaro. 2013. Rates of speciation and morphological evolution are correlated across the largest vertebrate radiation. Nature Communications DOI: 10.1038/ncomms2958
summary.bammdata, plot.bammdata, dtRates.data(primates, events.primates)
xx <- getEventData(primates, events.primates, burnin=0.25, nsamples=500, type = 'trait')
# compute mean phenotypic rate for primate body size evolution:
brates <- getCladeRates(xx)
mean(brates$beta)
# Plot rates:
plot.bammdata(xx)Run the code above in your browser using DataLab