[ensembl-dev] getting EntrezGene IDs from Ensembl $gene

Sergei Manakov manakov at ebi.ac.uk
Tue Sep 14 17:54:34 BST 2010


Thanks! This worked:

        foreach my $dbes ($gene->get_all_DBLinks("EntrezGene")){
            foreach my $dbe (@{$dbes}){
                print $dbe->primary_id(), "\t";
            }
        }


Sergei




On 14 September 2010 16:10, ian Longden <ianl at ebi.ac.uk> wrote:
> use get_all_DBLinks method from the gene :-)
> You can also pass it the database name too this will reduce the number
> of entries returned
>
> i.e.
>
> foreach my $dbe ($gene->get_all_DBLinks("EntrezGene")){
>
>
> -Ian
>
>
> On Tue, Sep 14, 2010 at 3:12 PM, Sergei Manakov <manakov at ebi.ac.uk> wrote:
>> Hello,
>>
>> I found a way of getting EntrezGene IDs from $translation (the code is
>> below), but is there a way of getting EntrezGene IDs directly from
>> $gene ?
>>
>> thanks,
>> Sergei
>>
>>
>>        foreach my $transcript (@{$gene->get_all_Transcripts}) {
>>            my $translation = $transcript->translation;
>>            if (defined $translation) {
>>                my $tln_dbentries = $translation->get_all_DBEntries;
>>                foreach my $dbe (@$tln_dbentries) {
>>                    if ($dbe->dbname eq 'EntrezGene') {
>>                        print $dbe->primary_id, "\t";
>>                    }
>>                }
>>            }
>>        }
>>
>>
>>
>>
>>
>> --
>> EMBL-EBI and Wellcome Trust Sanger Institute
>>
>> tel: 00441223492675
>>
>> _______________________________________________
>> Dev mailing list
>> Dev at ensembl.org
>> http://lists.ensembl.org/mailman/listinfo/dev
>>
>



-- 
EMBL-EBI and Wellcome Trust Sanger Institute

tel: 00441223492675




More information about the Dev mailing list