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!