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

ian Longden ianl at ebi.ac.uk
Tue Sep 14 16:10:32 BST 2010


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
>




More information about the Dev mailing list