dendropy.treemanip – Tree Manipulation

Functions and classes for manipulating or changing tree structural relations.

dendropy.treemanip.collapse_clade(node)

Collapses all internal edges that are descendants of node.

dendropy.treemanip.collapse_conflicting(subtree_root, split, split_bitmask)

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.

dendropy.treemanip.collapse_edge(edge)

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.

dendropy.treemanip.prune_leaves_without_taxa(tree, delete_outdegree_one=True)

Removes all terminal nodes that have their taxon attribute set to None.

dendropy.treemanip.prune_taxa(tree, taxa, delete_outdegree_one=True)

Removes terminal nodes associated with Taxon objects given by the container taxa (which can be any iterable, including a TaxonSet object) from tree.

dendropy.treemanip.randomly_reorient_tree(tree, rng=None, splits=False)

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.

dendropy.treemanip.randomly_rotate(tree, rng=None)

Randomly rotates the branches around all internal nodes in the tree

dendropy.treemanip.retain_taxa(tree, taxa, delete_outdegree_one=True)

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.

Previous topic

dendropy.treecalc – Tree Statistics, Metrics and Calculations

Next topic

dendropy.treesim – Tree Simulation

Documentation

Obtaining

AnnouncementsGoogle Groups

Join the "DendroPy Announcements" group to receive announcements of new releases, updates, changes and other news of interest to DendroPy users and developers.

Enter your e-mail address in the box above and click the "subscribe" button to subscribe to the "dendropy-announce" group, or click here to visit this group page directly.

DiscussionGoogle Groups

Join the "DendroPy Users" group to follow and participate in discussion, troubleshooting, help, information, suggestions, etc. on the usage and development of the DendroPy phylogenetic computing library.

Enter your e-mail address in the box above and click the "subscribe" button to subscribe to the "dendropy-users" group, or click here to visit this group page directly.