[ensembl-dev] core API question

nconte at ebi.ac.uk nconte at ebi.ac.uk
Fri Jul 19 15:27:50 BST 2013


HI,
I am fetching ensembl genes from HGNC gene list using the core API
I am using these methods below to fetch ensembl gene objects from my HGNC
Ids called $key:

my $all_genes=$gene_adaptor->fetch_all_by_external_name($key,'HGNC');
#then I am parsing through my gene reflist to get gene related attributes
print  OUTFILE2 $key, "\t",$value, "\t",defined($gene->external_name) ?
'map with '. scalar (@{$all_genes}). '  ensembl_gene(s):
'.$gene->external_name :'no_ensembl_gene',"\t", defined($gene->stable_id)
? $gene->stable_id : 'no_stableID', "\n";

for some genes I get ensmebl Ids for haplotypes or  LRG or pseudoautomosal
or  assembly patches/fixes regions. see below
 AIF1	1	map with 6  ensembl_gene(s): AIF1	ENSG00000206428
 AIF1	1	map with 6  ensembl_gene(s): AIF1	ENSG00000235985
 AIF1	1	map with 6  ensembl_gene(s): AIF1	ENSG00000234836
AIF1	1	map with 6  ensembl_gene(s): AIF1	ENSG00000237727
AIF1	1	map with 6  ensembl_gene(s): AIF1	ENSG00000204472
 AIF1	1	map with 6  ensembl_gene(s): AIF1	ENSG00000235588

I will like only to get the GRCh37 gene IDs with chr:start-end
coordinates.In the abose example, only ENSG00000204472. Is there a clever
way to do this using a API method, or my only chance is to test the
$gene->seq_name content?
many thanks
Nathalie







More information about the Dev mailing list