Fork me on GitHub"

# skbio.tree.TreeNode.shear

`TreeNode.``shear`(names)

  Lop off tips until the tree just has the desired tip names.

  State: Experimental as of 0.4.0.

  Parameters:

  names : Iterable of str

  > The tip names on the tree to keep

  Returns:

  TreeNode

  > The resulting tree

  Raises:

  ValueError

  > If the names do not exist in the tree

  See also

  `prune`, `remove`, `pop`, `remove_deleted`

  Examples

      >>> from skbio import TreeNode
      >>> t = TreeNode.read(['((H:1,G:1):2,(R:0.5,M:0.7):3);'])
      >>> sheared = t.shear(['G', 'M'])
      >>> print(sheared)
      (G:3.0,M:3.7);