[ensembl-dev] protein tree id and tagvalue

Moretti Sébastien sebastien.moretti at unil.ch
Tue Jul 3 16:04:30 BST 2012

> Hi Sébastien


> The fetch_node_by_node_id(1) trick might not work any more as (1) we are
> now storing tree of trees (called "super trees" in Compara), (2) we have
> merged the API and the SQL tables of protein and ncRNA trees.
> If you want all the protein trees as they were in the previous release,
> please use fetch_all(-tree_type => 'tree', -member_type => 'protein')
> from the GeneTreeAdaptor. This will return an arrayref of GeneTree
> objects. Each tree has a stable_id and other general properties / tags.
> Then, by calling "->root()" on a tree, you will jump to its root node,
> on which you can call children() recursively.

Do I have also to change the adaptor like this ?
my $protein_tree_adaptor = $reg->get_adaptor('Multi', 'compara', 
my $protein_tree_adaptor = $reg->get_adaptor('Multi', 'compara', 

> Regarding the node tags, they have been cleaned up and rationalized.
> "Duplication" does not exist any more. Please use "node_type" instead,
> which is one of {speciation,duplication,dubious,gene_split} and roughly
> maps to Duplication = 0, 2, 1 (respectively). taxon_name still exists
> $protein_tree_adaptor->fetch_all returns all the roots of protein trees
> and super-trees. You would still need to update the "Duplication" tag
> call and filter out super-trees.

So, doing this should work:

my $protein_tree_adaptor = $reg->get_adaptor('Multi', 'compara', 
my @children = @{$protein_tree_adaptor->fetch_all()};

for my $tree (@children){
     my $node_id  = $tree->root->node_id;
     my $taxon    = $tree->root->get_tagvalue('taxon_name')

And $tree->root->get_tagvalue('node_type') to get duplication status.

Does $tree->tree->stable_id(); from API 66 work again ?

> Regards,
> Matthieu
Sébastien Moretti
Department of Ecology and Evolution,
Biophore, University of Lausanne,
CH-1015 Lausanne, Switzerland
Tel.: +41 (21) 692 4221/4079
http://selectome.unil.ch/ http://bgee.unil.ch/

More information about the Dev mailing list