I am looking for a method to determine if a given ensembl_gene_id maps to the primary assembly or an alternate/patched chromosome.
For example, I have multiple ensembl_gene_ids for TNF alpha, but only one maps to the primary assembly:
- ENSG00000228321
- ENSG00000206439
- ENSG00000232810
- ENSG00000228978
- ENSG00000228849
- ENSG00000228321
- ENSG00000206439
- ENSG00000232810 * maps to primary assembly
- ENSG00000228978
- ENSG00000228849
Is there an API or web service that provides this functionality?
2 answers
You could use BioMart. Just filter by your list of IDs and the location, selecting all the normal chromosome numbers. Alternatively, filter by IDs and get the chromosomes as attributes. There's a help video on using BioMart here.
Or use the REST API:
http://rest.ensembl.org/lookup/id/ENSG00000228321?content-type=application/json will give you:
{"source":"ensembl_havana","object_type":"Gene","logic_name":"ensembl_havana_gene","species":"homo_sapiens","description":"tumor necrosis factor [Source:HGNC Symbol;Acc:HGNC:11892]","display_name":"TNF","biotype":"protein_coding","end":31617784,"seq_region_name":"CHR_HSCHR6_MHC_MANN_CTG1","db_type":"core","strand":1,"id":"ENSG00000228321","start":31615015}
and
http://rest.ensembl.org/lookup/id/ENSG00000232810?content-type=application/json will give you:
{"source":"ensembl_havana","object_type":"Gene","logic_name":"ensembl_havana_gene","species":"homo_sapiens","description":"tumor necrosis factor [Source:HGNC Symbol;Acc:HGNC:11892]","display_name":"TNF","biotype":"protein_coding","end":31578336,"seq_region_name":"6","db_type":"core","strand":1,"id":"ENSG00000232810","start":31575567}
As you can see the "seq_region_name" gives you name of the chromosome on which the gene in question is located.
Log in to answer this question.