Extract evolutionary rates from a Bayesian clock tree produced by Mr. Bayes
get_clockrate_table_MrBayes.Rd
Extract evolutionary rate summary statistics for each node from a Bayesian clock summary tree produced by Mr. Bayes and stores them in a data frame.
Arguments
- tree
An S4 class object of type
treedata
; a Bayesian clock tree imported usingtreeio::read.mrbayes
for Mr. Bayes summary trees.- summary
The name of the rate summary. Should be one of
"mean"
or"median"
.- drop_dummy
if not
NULL
, will drop the dummy extant tip with the given label from the Mr. Bayes summary tree prior to extracting the clock rates (when present). Default isNULL
.
Value
A data frame with a column containing the node identifier (node
) and one column for each relaxed clock partition in the tree object containing clock rates.
See also
vignette("rates-selection")
for the use of this function as part of an analysis pipeline.
get_clockrate_table_BEAST2
for the equivalent function for BEAST2 output files.
clockrate_summary
for summarizing and examining properties of the resulting rate table. Note that clade membership for each node must be customized (manually added) before these functions can be used, since this is tree and dataset dependent.
Examples
# See vignette("rates-selection") for how to use this
# function as part of an analysis pipeline
## Import summary tree with three clock partitions produced by
## Mr. Bayes (.t or .tre files) from your local directory
if (FALSE) {
tree3p <- treeio::read.mrbayes("Tree3p.t")
}
#Or use the example Mr.Bayes multi-clock tree file (\code{tree3p})
data("tree3p")
# obtain the rate table from MrBayes tree
rate_table <- get_clockrate_table_MrBayes(tree3p)
head(rate_table)
#> nodes rates1 rates2 rates3
#> 1 1 0.927276 0.958621 0.984651
#> 2 2 1.039289 0.757550 0.899578
#> 3 3 1.151933 0.627024 0.795243
#> 4 4 1.189229 0.451265 0.693551
#> 5 5 1.188293 0.446332 0.693501
#> 6 46 1.175959 0.544381 0.747233