A list of the path to the root from each node in a tree

PCMTreeListRootPaths(tree, tableAncestors = PCMTreeTableAncestors(tree))

Arguments

tree

a phylo object

tableAncestors

an integer matrix resulting from a call to PCMTreeTableAncestors(tree).

Value

a list with unnamed elements in the order of nodes in the tree. Each element is an integer vector containing the ancestors nodes on the path from the node (i) to the root of the tree in that order (the first element in the vector is the parent node of i and so on).

Details

This function has time and memory complexity O(M^2), where M is the number of nodes in the tree. It can take several minutes and gigabytes of memory on trees of more than 10000 tips.