Expand description
Phylogenetic tree construction from a distance matrix: UPGMA and neighbor joining.
See the book entry Hierarchical clustering and phylogenetic trees.
Structs§
- Phylogenetic
Tree - A weighted tree over
leaveslabelled leaves (ids0..leaves) and internal nodes (idsleaves..). UPGMA trees are rooted; neighbour-joining trees are unrooted and are drawn rooted at the final join for printing.
Functions§
- neighbor_
joining - Neighbour joining (Saitou and Nei): repeatedly joins the pair that minimises the total tree length, using the net divergence of each taxon to correct for unequal rates. Returns an unrooted tree and recovers the true tree exactly from additive distances.
- upgma
- UPGMA (unweighted pair group method with arithmetic mean): repeatedly merges the two closest clusters, placing the new node at half their distance, and averages distances weighted by cluster size. Assumes a constant evolutionary rate (a molecular clock) and returns a rooted, ultrametric tree; it is exact when the input is ultrametric.