[ensembl-dev] $protein_tree_adaptor->fetch_all_roots

Matthieu Muffato muffato at ebi.ac.uk
Tue Jan 10 16:11:23 GMT 2012


Hi Sébastien

The following code is working for me, and prints the taxon name of the 
tree starting at node_id=8 (also works with 248).

my $tree = $protein_tree_adaptor->fetch_node_by_node_id(8);
my $tax_level = $tree->get_tagvalue('taxon_name');
print $tree->node_id, " ", (defined $tax_level ? $tax_level : 
"MISSING"), "\n";

Is it working for you as well ? If so, the error must be a side effect 
of another part of your script. Could you then attach it ? (at least its 
beginning)

Thank you,
Matthieu

On 10/01/12 15:48, Moretti Sébastien wrote:
>> Hi Sébastien
>>
>> There was indeed some work on tags in rel 65, but this should be
>> transparent for users.
>> However, missing tags are now returning "undef" instead of an empty
>> string. Does it match your error ?
>
> I have always tested $tax_level this way:
> if ( defined $tax_level && $tax_level ne '' ){ ... }
>
> Currently the script does not go into this if statement.
>
>> That said, every internal node should have a 'taxon_name' tag, and
>> leaves shouldn't (same behaviour as in rel 64). Can you give me an
>> example of a failing $node_id ?
>
> Here are 2 failing node_id
> 8 (for ENSGT00470000042273)
> 248 (for ENSGT00530000064177)
>
>
> Sébastien
>
>> Cheers,
>> Matthieu
>>
>> On 10/01/12 15:19, Moretti Sébastien wrote:
>>> Hi Matthieu,
>>>
>>> this method works now. Thanks
>>>
>>>
>>> But later in our script things are broken now.
>>> my $tree = $protein_tree_adaptor->fetch_node_by_node_id($node_id);
>>> my $tax_level = $tree->get_tagvalue('taxon_name');
>>>
>>> We use this piece of code to parse protein trees and extract specific
>>> sub-trees with a chosen taxonomic root.
>>>
>>> Now, it looks like the taxon_name tag does not exist anymore in tree
>>> object.
>>>
>>> An 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