A tree is made up of Bio::Tree::Node objects.
This module implements several functions on a tree.
Find a node by its name or other attribute.
Remove a node from the tree, takes care of re-connecting the orphaned nodes when this is an internal node. The method is used as part of the reroot.
For a given node in a tree, get a list of all its ancestor nodes, from root->immediate ancestor of given node.
Remove one or more nodes from a tree without making the tree fall apart.
Finds the least common ancestor (LCA) for a set of nodes.
Add a lineage of nodes to an existing tree.
Splices out all nodes in the tree that have an ancestor and only one descendent.
Calculates the branch length distance between a pair of nodes.
This method peforms a test of monophy for a set of nodes given an outgroup. It will first find the (LCA) (returned by get_lca) and then test if the outgroup is a child of the LCA.
- -1 if the group is not monophyletic
- 0 if the group is not paraphyletic
- 1 if the group is paraphyletic
Reposition the root of a tree, this involves adding and removing an internal node which serves as the root. The new rooted node will be the midpoint distance between the two internal nodes where the root is placed.
Finds a node by its ID (not the autogenerated unique_id)
Assumes the internal node IDs represent the bootstrap values, move them to the bootstrap slot so they can be retrieved with bootstrap() function
collapsefunction to post-process a bootstrapped tree and collapse nodes below a minimum.