ValueObject
Table of Contents
Classes
- DistanceMatrix
- Validates, once and for all at construction, every invariant NeighborJoiningTreeBuilder relies on :
square, zero diagonal, symmetric, non-negative, unique non-empty labels. A distance is itself
always non-negative by definition (it is a measurement, unlike the branch lengths the neighbor-
joining algorithm later derives from it, which can legitimately go negative).
- PhylogeneticNode
- A leaf is a node with no children and must carry a name (the taxon it represents) ; an internal
node commonly has no name, since Newick and neighbor-joining rarely name ancestral nodes. Branch
length is the distance to this node's OWN parent, so it is meaningless - and left null - on the
root of a tree. Negative branch lengths are accepted without validation : neighbor-joining can
legitimately produce one when the input distances are slightly non-additive (measurement noise),
a well documented property of the algorithm, not an error this value object should reject.