Additional file 1.
Tree rerooting. Example code to read a tree from a file and write copies of the tree rerooted at every internal and external node. The method find_clades produces an iterator over the tree rather than a new list, in order to make more efficient use of memory in general. In this case, because the method root_with_outgroup modifies the tree in-place, which could change the ordering of nodes during traversal, list is used to create an unchanging copy of references to the original nodes in the tree.
Format: PY Size: 1KB Download file
Talevich et al. BMC Bioinformatics 2012 13:209 doi:10.1186/1471-2105-13-209