Reputation: 33
I am trying to get the Entrezgene names for my RNA seq EdgeR output. I found mygene and thought I'd try it out, but regardless of what I do (have tried on home system and server), I get this error:
import mygene as mg
import pandas as pd
data = pd.read_csv("EdgeR-results.csv", header=0)
col_a = list(data.GeneID)
out = mg.querymany(col_a, scopes='ensembl.gene', fields='entrezgene', species='human')
Traceback (most recent call last):File "", line 1, in AttributeError: 'module' object has no attribute 'querymany'
Attempt with just a typed out list:
mg.getgenes(['ENSG00000176658.17','ENSG00000085224.22','ENSG00000112562.18','ENSG00000184347.14','ENSG00000183117.19','ENSG00000149218.5','ENSG00000123572.17','ENSG00000146938.16','ENSG00000206195.10'], fields="entrezgene")
Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'getgenes'
I am at a loss. This code is straight out of several manuals and tutorials. Can anyone help me? I have thousands of ensemble gene IDs I need to convert and somehow merge back into my dataframe.
Thanks!
Upvotes: 0
Views: 281
Reputation: 51
Add the following before the query:
mg = mygene.MyGeneInfo()
I just came across the same error and found that snippet in someone else's example code. It resolved the error for me.
Upvotes: 2