Entering edit mode
6.0 years ago
Matteo Schiavinato
★
3.6k
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 tree.py
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 ]
t.prune(Leaves_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?
Is your tree file malformed in some way?
Not that I know of. All these trees worked in all my analyses, it would be very unexpected.
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?
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!Can you please tell how you -except the error. I'm facing the same issue. Thanks.
The same way you would except any other error in python, nothing fancy.