bifurcatr: Algorithm to randomly resolve polytomies in a phylogenetic...

Description Usage Arguments Details Value References

View source: R/bifurcatr.R

Description

Many trees used in phylogenetic ecology include polytomies (nodes with more than two descendent branches) and are the result of uncertainty about the true branching order of taxa. Polytomies result in an overestimation of Phylogenetic Diversity because only two of the members of a polytomy will have a divergence as great as the node depth. To overcome this problem, this algorithm resolves all polytomies randomly (see details) using the procedure described by Rangel et al. (2015). Please note that this algorithm is designed for rooted, ultrametric trees and the resulting fully resolved tree will also be ultrametric. Because trees are resolved randomly, the algorithm is designed to be run multiple times to explore the range of potential solutions (which could be very large).

Usage

1
bifurcatr(phy, runs = 1)

Arguments

phy

is a rooted, ultrametric phylogenetic tree with branch lengths stored as a phylo object (as in the ape package).

runs

is the number of repetitions of the algorithm (to produce multiple equally plausible trees). Default is 1.

Details

bifurcatr takes a phylogenetic tree (rooted and ultrametric, with branch lengths) and randomly resolves all polytomies. The algorithm proceeds as follows: 1) randomly choose two edges from a polytomy, 2) join the edges with a new node, 3) generate a new edge, 4) link polytomy node to new node via new edge, 5) generate new branch length (from a random uniform distribution) for new edge, 6) adjust lengths of descendent edges (to preserve ultrametricity). The user should repeat the algorithm (using the runs argument) to generate several equally plausible trees. The algorithm is a modification of that descibed in Rangel et al. (2015).

Value

If runs = 1, a phylo object (see ape package) is returned. If runs > 1, then a multiPhylo object (see ape package) is returned, consisting of one tree for each run of the algorithm. Because the algorithm simply appends new edges to the resulting phylo object, it will not plot correctly in ape (the plot function requires trees to be organised in cladewise order). This can be easily fixed by writing the tree (or trees) to a Newick or Nexus file (using the write.tree or write.nexus in the ape package) and then reading the file back into R.

References


davidnipperess/PDcalc documentation built on July 7, 2021, 1:07 p.m.