skbio.core.tree.TreeNode.root

TreeNode.root()[source]

Returns root of the tree self is in

Returns:

TreeNode

The root of the tree

Examples

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