Functions and classes for manipulating or changing tree structural relations.
Collapses all internal edges that are descendants of node.
Takes a node that is the root of a subtree. Collapses every edge in the subtree that conflicts with split. This can include the edge subtending subtree_root.
Inserts all children of the head_node of edge as children of the tail_node of edge in the same place in the child_node list that head_node had occupied. The edge length and head_node will no longer be part of the tree.
Removes all terminal nodes that have their taxon attribute set to None.
Removes terminal nodes associated with Taxon objects given by the container taxa (which can be any iterable, including a TaxonSet object) from tree.
Randomly picks a new rooting position and rotates the branches around all internal nodes in the tree. If splits is True, the the split_bitmask and split_edges attributes kept valid.
Randomly rotates the branches around all internal nodes in the tree
Removes terminal nodes that are not associated with any of the Taxon objects given by taxa (which can be any iterable, including a TaxonSet object) from the tree.