The RED of a node measures its relative placement between the root and the node's descending tips (Parks et al. 2018). The root's RED is set to 0. Traversing from root to tips (preorder traversal), for each node the RED is set to \(P+(a/(a+b))\cdot(1-P)\), where \(P\) is the RED of the node's parent, \(a\) is the edge length connecting the node to its parent, and \(b\) is the average distance from the node to its descending tips. The RED of a tip would always be 1.
The RED may be useful for defining taxonomic ranks based on a molecular phylogeny (e.g. see Parks et al. 2018).
This function is similar to the PhyloRank v0.0.27 script published by Parks et al. (2018).
The time complexity of this function is O(Nedges).
The input tree may include multi-furcations (i.e. nodes with more than 2 children) as well as mono-furcations (i.e. nodes with only one child). If tree$edge.length
is NULL
, then all edges in the input tree are assumed to have length 1.