Artificial intelligent assistant

How to get smallest subtree containing a set of nodes from BioPhylo? 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.

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.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 919a67e20dbf0c3c04147d0a43306230