This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Convert Ensembl Transcript Id To Gene Name With Perl Api Tools?

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

2 answers

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

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

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

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

Log in to answer this question.