I have a file that contains some gene Ensembl IDs. My goal is to get all the GO Terms associated to those gene Ensembl IDs with a python script.
Anyone knows about the existence of some python package that allows me to reach my goal ? I'm currently aware of package as mygene, godb, etc. However, none of them as the option to get the GO Terms from gene Ensembl IDs. I've used R as well to get this done and worked just fine. However, I really want to do it with a python script and I'm getting a lot of difficulties.
copy/pasted and modified from ensembl rest page (for python 3):
Thanks! That's what I was looking for!
Do you know if there is a limit to input genes ID to query? I've adapt into a loop to perform the code to several ensembl IDs. What I notice so far is that when the number of input IDs is a large one, it gets me the following error message:
That Ensembl ID is the 21 input. I guess that it only takes 19/20 consecutive inputs, because when I reduce to 19 inputs it works just fine.
For more ids, use post instead of get. Examples are here https://rest.ensembl.org/documentation/info/lookup_post
For what I briefly read of the last link, that option does not give the GO ids...
I just now understand why that error. It was because some of the input ID's had no result. I've readapted the code and it works perfectly now, thanks!
jopealfe You are right. Ontologies and Taxonomy doesn't support post (as of now).