skbio.tree.TreeNode.unrooted_deepcopy#

TreeNode.unrooted_deepcopy(parent=None)[source]#

Walk the tree unrooted-style and returns a new deepcopy.

Parameters:
parentTreeNode or None

Direction of walking (from parent to self). If specified, walking to the parent will be prohibited.

Returns:
TreeNode

A new copy of the tree rooted at the given node.

Warning

unrooted_deepcopy is deprecated as of 0.6.2, as it generates a redundant copy of the tree. Use unrooted_copy instead.

Notes

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

This method calls unrooted_copy which is recursive.