Closed EDohmen closed 1 year ago
Thanks for the interest!
The .treedist() method, as currently implemented, treats the trees as unrooted when computing the Robinson-Foulds symmetric distance (and the two trees in your example are then identical). I should implement the rooted version also. (And in fact I should implement other measures, in addition to RF, that are less sensitive to e.g., moving a single taxon)
I have now implemented the rooted version of Robinson-Foulds (phylotreelib version 1.20.1, available at PyPi and GitHub). Syntax is as follows (note new method name. Also note that default is now to return the un-normalised measure):
rf_unrooted = tree1.treedist_RF(tree2)
rf_unrooted_normalised = tree1.treedist_RF(tree2, normalise=True)
rf_rooted = tree1.treedist_RF(tree2, rooted=True)
rf_rooted_normalised = tree1.treedist_RF(tree2, rooted=True, normalise=True)
While I was at it, I also added a method to compute the path difference distance, as described in Steel and Penny (1993) and used in various other software packages:
pd = tree1.treedist_pathdiff(tree2)
I plan to also implement the branch length-aware method from Kuhner and Felsenstein, 1994, and also the information-theoretic method from Smith, 2020.
Closing for now, but let me know if there are any issues.
Kind regards, Anders
Cool, thanks a lot, sounds awesome! I will try it out!
Hey again, I detected a bug in the treedist() function, which returns 0.0 (i.e. no difference) between two trees with different topologies such as these (ete3 normalised robinson-foulds dist for comparison):
Is this known?