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
768 stars 216 forks source link

`get_distance()` with `topology_only=True` should return number of edges, not nodes (ete3) #741

Open lenacoll opened 5 months ago

lenacoll commented 5 months ago

get_distance(target, target2, topology_only=True) returns (according to the documentation) the number of nodes on the path between target and target2. Without the flag topology_only=True, it returns the branch length sum between the two targets. It therefore seems more intuitive to return the number of edges connecting the two targets if topology_only=True. It especially seems odd that two nodes connected by an edge have distance 0.