| mrca_calibrations {datelife} | R Documentation |
Identify nodes of a tree topology that are most recent common ancestor (mrca)
of taxon pairs from a calibrations object
Description
mrca_calibrations get nodes of a tree topology given in
phy that correspond to the most recent common ancestor (mrca) of taxon
pairs given in calibrations. It uses phytools::findMRCA() to get mrca nodes.
Usage
mrca_calibrations(phy, calibrations)
Arguments
phy |
A |
calibrations |
A |
Details
The function takes pairs of taxon names in a calibrations data frame,
and looks for them in the vector of tip labels of the tree. If both are present,
then it gets the node that represents the most recent
common ancestor (mrca) for that pair of taxa in the tree.
Nodes of input phy can be named or not. They will be renamed.
Value
A list of two elements:
- matched_phy
A
phyloobject with nodes renamed to match results of the mrca search. Nodes are renamed usingtree_add_nodelabels().- matched_calibrations
A
matchedCalibrationsobject, which is the inputcalibrationsobject with two additional columns storing results from the mrca search withphytools::findMRCA():$mrca_node_numberand$mrca_node_name.