etetoolkit / ete

Python package for building, comparing, annotating, manipulating and visualising trees. It provides a comprehensive API and a collection of command line tools, including utilities to work with the NCBI taxonomy tree.
http://etetoolkit.org
GNU General Public License v3.0
782 stars 212 forks source link

Add feature to ete4: TreeNode:to_str() #602

Closed jordibc closed 2 years ago

jordibc commented 2 years ago

Add a function to the class TreeNode that returns the tree as a compact text.

It is similar to get_ascii(), but with a more compact representation that allows to see bigger trees on the console.

Example:

t = Tree(...)
print(t.to_str(['name', 'dist', 'support']))