skbio.tree.TreeNode.observed_node_counts#

TreeNode.observed_node_counts(tip_counts)[source]#

Return counts of node observations from counts of tip observations.

Parameters:
tip_countsdict of ints

Counts of observations of tips. Keys correspond to tip names in self, and counts are unsigned ints.

Returns:
dict

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

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.