RenumberTips.phylo degenerates preorder into cladewise as it's possible that edges, whilst in preorder, are not in the identical order generated by Preorder.
# If the labels of a tree are modified, then it will no longer be in "strict"
# preorder. Degenerate to "cladewise".
# TODO in a future release, we may wish to distinguish "strict" preorder
# with a relaxed version that is still "preorder" but doesn't guarantee
# identical edge matrices.
.LapsePreorder <- function (tree) {
if (attr(tree, "order") == "preorder") {
attr(tree, "order") <- "cladewise"
}
tree
}
We may therefore needlessly run reorder operations on renumbered trees.
Objective: create a suborder attributes that distinguishes trees in strict Preorder, i.e. as output by preorder_edges_and_nodes, from loose preorder, i.e. preorder from a graph theoretic perspective. use this order to determine when reordering is necessary.
RenumberTips.phylodegenerates preorder into cladewise as it's possible that edges, whilst in preorder, are not in the identical order generated byPreorder.We may therefore needlessly run reorder operations on renumbered trees.
Objective: create a
suborderattributes that distinguishes trees instrictPreorder, i.e. as output by preorder_edges_and_nodes, fromloosepreorder, i.e. preorder from a graph theoretic perspective. use this order to determine when reordering is necessary.