Skip to content

UPGMA trees generated by DecentTree might not be ultrametric #6

Description

@apcamargo

I noticed that DecentTree generates non-ultrametric trees when using the UPGMA algorithm. For example:

import numpy as np
import pydecenttree

taxa = ["a", "b", "c", "d"]
d = np.array([
    [0, 3, 4, 3],
    [3, 0, 4, 5],
    [4, 4, 0, 2],
    [3, 5, 2, 0]
])

print(pydecenttree.constructTree("UPGMA", taxa, d))

Generates this tree:

(a:1.25,b:1.5,(c:1,d:1):1);

I get the same results with the CLI interface.

I haven't conducted extensive testing to check if this happens with every single distance matrix.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions