[ensembl-dev] protein tree id and tagvalue

Matthieu Muffato muffato at ebi.ac.uk
Tue Jul 3 15:36:22 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.

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.

Regards,
Matthieu

On 03/07/12 15:14, Moretti Sébastien wrote:
> Hi
>
> It looks the compara API has again a bit changed between releases 66 and
> 67.
> I have a script running on ensembl 64 but don't know how to make it
> compatible with ensembl 67 (API 66 code style does not work).
>
>
> Here is a sample of my script:
>
> my $protein_tree_adaptor = $reg->get_adaptor('Multi', 'compara',
> 'ProteinTree');
> my $root = $protein_tree_adaptor->fetch_node_by_node_id(1);
>
> my @children = @{$root->children()};
> for my $tree (@children){
>      print $tree->node_id;
>      print $tree->get_tagvalue('Duplication');
>      print $tree->get_tagvalue('taxon_name');
> }
>
>
>
> $tree->get_tagvalue('Duplication') and $tree->get_tagvalue('taxon_name')
> are undefined.
>
>
> Using my @children = @{$protein_tree_adaptor->fetch_all}; gives less
> undefined variables but yet not what's expected.
>
>
> Any idea ?
> Regards
>


-- 
Matthieu Muffato, Ph.D.
Ensembl Developer - Comparative Genomics
European Bioinformatics Institute (EMBL-EBI)
Wellcome Trust Genome Campus, Hinxton
Cambridge, CB10 1SD, United Kingdom




More information about the Dev mailing list