skbio.tree.TreeNode.subsets

TreeNode.subsets()[source]

Return all sets of names that come from self and its descendants

Compute all subsets of tip names over self, or, represent a tree as a set of nested sets.

Returns:

frozenset

A frozenset of frozensets of str

Examples

>>> from six import StringIO
>>> from skbio import TreeNode
>>> tree = TreeNode.read(StringIO("(((a,b)c,(d,e)f)h)root;"))
>>> for s in sorted(tree.subsets()):
...     print(sorted(s))
['a', 'b']
['d', 'e']
['a', 'b', 'd', 'e']