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
777 stars 214 forks source link

NCBI - taxid to names - newick tree #754

Open kullrich opened 1 month ago

kullrich commented 1 month ago

Hi, this is a feature request. In the documentation there is the following example:

from ete3 import NCBITaxa
ncbi = NCBITaxa()

tree = ncbi.get_topology([9606, 9598, 10090, 7707, 8782])
print tree.get_ascii(attributes=["sci_name", "rank"])

The question for me is now how to change the original tree that it will use the sci_name insead of the taxid printing or writing a newick tree.

The get_ascii is not helping here since it does not output in newick format.

An easy way how to e.g. combine "sci_name", "taxid", with a delimiter would be a nice feature.

Thank you in anticipation

Best regards

Kristian

dengzq1234 commented 1 month ago

Hi! Indeed we tried not to change the original tree newick format. That sounds like a interesting feature, I will see what I can do!

Best, Ziqi