Lop off tips until the tree just has the desired tip names.
Parameters: | names : Iterable of str
|
---|---|
Returns: | TreeNode
|
Raises: | ValueError
|
See also
Examples
>>> from six import StringIO
>>> from skbio import TreeNode
>>> t = TreeNode.read(StringIO('((H:1,G:1):2,(R:0.5,M:0.7):3);'))
>>> sheared = t.shear(['G', 'M'])
>>> print(sheared.to_newick(with_distances=True))
(G:3.0,M:3.7);