Convert Ensembl Transcript Id To Gene Name With Perl Api Tools?
2
3
Entering edit mode
13.8 years ago
Krisr ▴ 470

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?

ensembl perl api conversion • 6.3k views
ADD COMMENT
4
Entering edit mode
13.8 years ago

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 COMMENT
0
Entering edit mode
13.8 years ago
Gareth Palidwor ★ 1.6k

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

ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 2518 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6