Gene IDs turn into mutiple Ensembl IDs?
2
1
Entering edit mode
6.2 years ago
iannos ▴ 10

Hi!

I am trying to use the MyGene python module to convert Gene IDs into Ensembl IDs. However an issue I noticed was that some Gene IDs turn into multiple Ensembl IDs. Why is this? For example:

A1BG turns into ENSG00000121410 and ENSG00000268895

Here is the code I'm using:

import mygene

mg = mygene.MyGeneInfo()

result = mg.query("A1BG", scopes='symbol', fields=['ensembl'], species="human")

for hit in result["hits"]:
     if "ensembl" in hit and "gene" in hit["ensembl"]:
          print(hit["ensembl"]["gene"])

Thank you!

python ensembl genome • 2.8k views
ADD COMMENT
3
Entering edit mode
2.6 years ago

Alternatively, you could use gget search to find Ensembl IDs linked to a gene symbol, and then check the returned Ensembl IDs with gget info.

pip install gget, then simply:

# Command-line
gget search -s human A1BG
gget info ENSG00000121410
# Python
import gget
gget.search("A1BG", "human")
gget.info("ENSG00000121410")
ADD COMMENT
2
Entering edit mode
6.2 years ago

Haplotypes, maybe, after looking at the Ensembl records for those two accessions. Why am I getting different ensembl gene ids for a given gene symbol?

ADD COMMENT

Login before adding your answer.

Traffic: 1798 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