iqtree / decenttree

Fast Neighbor-Joining and other distance-based methods for phylogenetics
GNU General Public License v2.0
10 stars 6 forks source link

UPGMA trees generated by DecentTree might not be ultrametric #6

Open apcamargo opened 1 year ago

apcamargo commented 1 year ago

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.

bqminh commented 1 year ago

I've now disable UPGMA with commit 6009d03 until this problem is fixed