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?
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 thestable_id
is returned (see answer from Bert Overduin).