UPGMA
Inference: UPGMA¶
UPGMA infers an ultrametric tree from a distance matrix. This example constructs a distance matrix from a random tree, then infers a UPGMA tree and draws it.
In [ ]:
Copied!
import toytree
tree = toytree.rtree.unittree(8, seed=123)
dist = tree.distance.get_tip_distance_matrix()
upgma = toytree.infer.upgma_tree(dist)
c, a, m = upgma.draw(layout='r', tip_labels=True, scale_bar=True)
c
import toytree
tree = toytree.rtree.unittree(8, seed=123)
dist = tree.distance.get_tip_distance_matrix()
upgma = toytree.infer.upgma_tree(dist)
c, a, m = upgma.draw(layout='r', tip_labels=True, scale_bar=True)
c