skbio.tree.TreeNode.observed_node_counts

TreeNode.observed_node_counts(tip_counts)[source]

Returns counts of node observations from counts of tip observations

State: Experimental as of 0.4.1.

Parameters:

tip_counts (dict of ints) – Counts of observations of tips. Keys correspond to tip names in self, and counts are unsigned ints.

Returns:

Counts of observations of nodes. Keys correspond to node names (internal nodes or tips), and counts are unsigned ints.

Return type:

dict

Raises:
  • ValueError – If a count less than one is observed.
  • MissingNodeError – If a count is provided for a tip not in the tree, or for an internal node.