Ete3 - get subtree from NCBI with names as labels

28 views
Skip to first unread message

Marc Hoeppner

unread,
Jul 5, 2024, 10:04:59 AM7/5/24
to The ETE toolkit
Hi,

so after what seemed a little harder than it should be, I got Ete3 running. 

What I want to do is the following:

- Read the NCBI Taxonomy
- Extract a sub tree based on a node ID (say: all amniotes, 23524)
- And write that subtree to Newick, with the scientific names as (leaf) labels (instead of the taxonomy ids). 

I cannot for the life of me figure out how to translate the taxonomy IDs to scientic names in the tree, prior to writing it. The examples, frankly, seem a little "off topic" for what most people would probably use this for (i.e. ASCII printing to screen?!). I.e. there are examples of how to read and translate the identifiers, but not (as far as I could see) how to do that *on* the tree. Surely that is possible, somehow? ;) Maybe I'm just blind..^^

Any pointers would be greatly appreciated!

Kind regards,
Marc

Marc Hoeppner

unread,
Jul 5, 2024, 11:46:49 AM7/5/24
to The ETE toolkit

After more Googling, I found that I have to rename each leaf individually. Works now
Reply all
Reply to author
Forward
0 new messages