skbio.tree.TreeNode.root

TreeNode.root()[source]

Returns root of the tree self is in

Returns:

TreeNode

The root of the tree

Examples

>>> from six import StringIO
>>> from skbio import TreeNode
>>> tree = TreeNode.read(StringIO("((a,b)c,(d,e)f)root;"))
>>> tip_a = tree.find('a')
>>> root = tip_a.root()
>>> root == tree
True