Module:Bio::Tree::TreeFunctionsI
| Pdoc documentation: Bio::Tree::TreeFunctionsI | CPAN documentation: Bio::Tree::TreeFunctionsI |
|---|
Contents |
A tree is made up of Bio::Tree::Node objects.
Key Functions
This module implements several functions on a tree.
find_node
Find a node by its name or other attribute.
remove_Node
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.
get_lineage_nodes
For a given node in a tree, get a list of all its ancestor nodes, from root->immediate ancestor of given node.
splice
Remove one or more nodes from a tree without making the tree fall apart.
get_lca
Finds the least common ancestor (LCA) for a set of nodes.
merge_lineage
Add a lineage of nodes to an existing tree.
contract_linear_paths
Splices out all nodes in the tree that have an ancestor and only one descendent.
distance
Calculates the branch length distance between a pair of nodes.
is_monophyletic
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.
is_paraphyletic
Returns
- -1 if the group is not monophyletic
- 0 if the group is not paraphyletic
- 1 if the group is paraphyletic
reroot
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.
findnode_by_id
Finds a node by its ID (not the autogenerated unique_id)
move_id_to_bootstrap
Assumes the internal node IDs represent the bootstrap values, move them to the bootstrap slot so they can be retrieved with bootstrap() function
Wishlist
-
collapsefunction to post-process a bootstrapped tree and collapse nodes below a minimum.