Closed cndewey closed 3 years ago
Thanks @cndewey! I found and fixed the bug.
I changed the root and unroot functions quite a bit from ete so I think this bug was likely unique to toytree. Here is a demo of the new functionality: https://github.com/eaton-lab/toytree/blob/master/sandbox/unroot-dist.ipynb
The fix is now available on the master branch and will appear in the next tagged conda version.
This may be due to some "legacy" behavior with the ete library, but unrooting a rooted tree does not preserve the pairwise distances between the leaves. A minimal example is shown below:
The correct unrooted tree in this case should be
The issue seems to be that the distance for one of the children of the root is not properly updated.