[ensembl-dev] How to get a tree stable id ?

Matthieu Muffato muffato at ebi.ac.uk
Wed Apr 18 14:03:31 BST 2012


Hi

Sorry, my message was not clear. You only need $tree->tree->stable_id 
with no "->tree()";

Other tree_wide parameters are available, like $tree->tree->tree_type, 
$tree->tree->method_link_species_set_id, etc

Matthieu

On 18/04/12 13:14, Moretti Sébastien wrote:
>> Hi Sébastien
>
> Hi
>
>> We have updated the class hierarchy for gene trees in e66, and will
>> finish to do so in e67
>>
>> The new way of getting the tree stable_id from a node (e.g. the return
>> value of fetch_node_by_node_id) is $node->tree->stable_id
>>
>> ->tree() returns a GeneTree object which contains the tree-wide values,
>> leaving in the nodes the node-specific attributes.
>
> I cannot get that.
>
> with
> my $tree = $protein_tree_adaptor->fetch_node_by_node_id($node_id);
>
> What should I do to get the stable_id ?
>
> $tree->tree->stable_id->tree() does not work.
>
>> Matthieu
>>
>> On 18/04/12 11:23, Moretti Sébastien wrote:
>>> Hi
>>>
>>> with the ensembl 66 API, I cannot get the gene tree stable id I used to
>>> get before with previous ensembl API.
>>>
>>> I build a protein tree adaptor, fetch a node with a node_id but cannot
>>> get the ENSGT00* id anymore.
>>>
>>>
>>> e.g. with node_id = 2
>>>
>>> my $tree = $protein_tree_adaptor->fetch_node_by_node_id($node_id);
>>> my $stable_id = $tree->node_id;
>>>
>>> This returns 2, and not the ENSGT00* id I expect.
>>> I cannot see any ENSGT00* strings with Data:Dumper in the $tree object.
>


-- 
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