Question: Convert Ensembl Transcript Id To Gene Name With Perl Api Tools?
3
gravatar for Krisr
8.2 years ago by
Krisr460
United States
Krisr460 wrote:

I have a script that returns ensembl API info from the variation module. Currently, using the example code it returns the transcript ID of the variant queried, with this code:

   my $gene = $gene_adaptor->fetch_by_transcript_id($tv->transcript->dbID);
  return $gene->stable_id if (defined $gene->external_name);

I would like to return the gene name, instead of the ENSG#### ID that this command returns. Is anyone familiar with this tool set, and how I might adjust the code to return the gene name instead of the transcript id?

perl ensembl api conversion • 4.4k views
ADD COMMENTlink modified 8.2 years ago by Bert Overduin40 • written 8.2 years ago by Krisr460
4
gravatar for Bert Overduin
8.2 years ago by
United Kingdom
Bert Overduin40 wrote:

Hello,

$gene->external_name will usually get you the (official) gene symbol. For human genes this would be the HGNC symbol, e.g. "BRCA2".

$gene->description will give you the gene name, e.g. "breast cancer 2, early onset".

Note that Ensembl-specific questions can also send to the Ensembl helpdesk (helpdesk@ensembl.org) or the Ensembl developers mailing list (dev@ensembl.org).To the latter you first have to subscribe, though: http://www.ensembl.org/info/about/contact/mailing.html.

Cheers, Bert

Bert Overduin, Ph.D. Vertebrate Genomics Team

EMBL - European Bioinformatics Institute Wellcome Trust Genome Campus Hinxton, Cambridge CB10 1SD United Kingdom

http://www.ebi.ac.uk/~bert

ADD COMMENTlink written 8.2 years ago by Bert Overduin40
0
gravatar for Gareth Palidwor
8.2 years ago by
Gareth Palidwor1.6k
Ottawa
Gareth Palidwor1.6k wrote:

I believe you're looking for $gene->external_name(); this should return the gene symbol.

ADD COMMENTlink written 8.2 years ago by Gareth Palidwor1.6k

That method is already called in the code listed...

ADD REPLYlink written 8.2 years ago by Egon Willighagen5.2k

This is the correct answer. $gene->external_name() does return the gene symbol. As called in the code listed, if defined then the stable_id is returned (see answer from Bert Overduin).

ADD REPLYlink written 8.2 years ago by Gareth Palidwor1.6k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 650 users visited in the last hour