Returns distance matrix between pairs of tips, and a tip order.
By default, all pairwise distances are calculated in the tree. If endpoints are specified, then only the distances between those tips are computed.
Parameters: | endpoints : list of TreeNode or str, or None
|
---|---|
Returns: | DistanceMatrix
|
Raises: | ValueError
NoLengthError
|
See also
Examples
>>> from six import StringIO
>>> from skbio import TreeNode
>>> tree = TreeNode.read(StringIO("((a:1,b:2)c:3,(d:4,e:5)f:6)root;"))
>>> mat = tree.tip_tip_distances()
>>> print(mat)
4x4 distance matrix
IDs:
a, b, d, e
Data:
[[ 0. 3. 14. 15.]
[ 3. 0. 15. 16.]
[ 14. 15. 0. 9.]
[ 15. 16. 9. 0.]]