# skbio.tree.TreeNode.unrooted_copy¶

TreeNode.unrooted_copy(parent=None)[source]

Walks the tree unrooted-style and returns a copy

State: Experimental as of 0.4.0.

Perform a copy of self and return a new copy of the tree as an unrooted copy. This is useful for defining new roots of the tree as the TreeNode.

This method is recursive.

Warning, this is _NOT_ a deepcopy

Parameters

parent (TreeNode or None) – Used to avoid infinite loops when performing the unrooted traverse

Returns

A new copy of the tree

Return type

TreeNode

Examples

>>> from skbio import TreeNode