Question: ETE3 TreeError: 'Nodes are not connected!': how to fix?
gravatar for Macspider
3 months ago by
Vienna - BOKU
Macspider2.8k wrote:

Hi everyone,

I am working with ETE3 and I stumbled upon an error that I have never retrieved before:

ete3.coretype.tree.TreeError: 'Nodes are not connected!'

The error seems to trace back to the get_common_ancestor() function, which is in the script of ETE3.

The lines raising the error are these, within a prune() command:

IDs_to_keep = [ ID for ID in Relevant_ID_list ]
Leaves_to_keep = [ t.search_nodes(name=leaf)[0] for leaf in IDs_to_keep ]

I should probably also mention that not every phylogenetic tree arises this behavior. It is running smoothly for most of the phylogenetic trees in the list I have, and only rarely encountering this error! The internet is quite scarse on the subject and I don't really know what's going on. Can anyone help me?

ADD COMMENTlink modified 3 months ago • written 3 months ago by Macspider2.8k

Is your tree file malformed in some way?

ADD REPLYlink written 3 months ago by jrj.healey11k

Not that I know of. All these trees worked in all my analyses, it would be very unexpected.

ADD REPLYlink written 3 months ago by Macspider2.8k

That is pretty weird. I’ve certainly never seen it before. Perhaps this is one to submit to their issue tracker.

Could you share an example problematic tree and your versions of python/ETE etc to see if others can reproduce?

ADD REPLYlink modified 3 months ago • written 3 months ago by jrj.healey11k

It's pretty weird: I started except-ing the error to get those trees, and now it is not showing that error anymore. I have no clue on how to reconstruct the previous situation. Perhaps there was some I/O error and something got read/written wrongly from/to the file? I don't know what to think anymore!

ADD REPLYlink written 3 months ago by Macspider2.8k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1181 users visited in the last hour