Skip to content

Unifurcating root causes erroneous abort #15

@mmore500

Description

@mmore500

Hi! Thanks for publishing tqdist Python interface on PyPi --- very useful tool to have available.

It looks like there may be an issue handling trees with unifurcating roots. I've prepared a minimal example that reproduces the erroneous abort I've encountered,

>>> tqdist.quartet_distance("(B,(A,C,E),D);", "(B,((A,C,E)),D);") # ok
0.0
>>> tqdist.quartet_distance("(B,(A,C,E),D);", "(B,(A,C,E),D);")  # ok
0.0
>>> tqdist.quartet_distance("(B,(A,C,E),D);", "(B,((A,C,E)),D);") # internal unifurcation ok
0.0
>>> tqdist.quartet_distance("(B,(A,C,E),D);", "((B,(A,C,E),D));")  # one root unifurcation fails
Leaves doesn't agree! Aborting! ( didn't exist in first tree)
The two trees do not have the same set of leaves.
Aborting.
-1.0610772061522669e-14
>>> tqdist.quartet_distance("((B,(A,C,E),D));", "((B,(A,C,E),D));")  # but not for identical trees with root unifurcations
0.0

Here's the structure of the failing tree
image

Some more experiments,

>>> tqdist.quartet_distance("(B,(A,C,E),D);", "((B,((A,C),E),D));")
Leaves doesn't agree! Aborting! ( didn't exist in first tree)
The two trees do not have the same set of leaves.
Aborting.
-1.0610772061522669e-14
>>> tqdist.quartet_distance("(B,(A,C,E),D);", "(B,((A,C),E),D);")
0.4
>>> tqdist.quartet_distance("((B,(A,C,E),D));", "((B,((A,C),E),D));")
0.2

Some details:

  • tqdist Python package installed via PyPi with pip
  • version 1.0
  • Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux

Hope this helps, let me know if there's any other information I can provide!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions