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

Moretti Sébastien sebastien.moretti at unil.ch
Wed Apr 18 13:14:24 BST 2012


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

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