Take the tour ×  I'm testing out various phylogenetic libraries
in Python. I want to read in a Newick tree, then, given a list
of taxa, generate the smallest tree that contains them all. This
task is quite simple and efficient in dendropy and ete2:  newick
= '((raccoon, bear),((sea_lion,seal),((monkey,cat),
weasel)),dog);' taxa = ['raccoon', 'sea_lion']  import ete2 tree
= ete2.Tree(newick) pruned = tree.prune(taxa)  import dendropy
tree = dendropy.Tree.get_from_string(newick, 'newick') pruned =
tree.prune_taxa_with_labels(taxa)  I'm trying but failing to
find equivalent functionality in the Bio.Phylo package. Trees do
have a "prune" method, but it prunes a single node from the
tree.  share|improve this question add comment  2 Answers  up
vote 3 down vote accepted  The common_ancestor function should
give you the result you want: it gives you the tree (I think)
that is the most recent common ancestor of all the given
targets.  share|improve this answer Perfect! Thank you. –  Ben
Morris Nov 20 '12 at 16:35 add