Mygene显示AttributeError,即使代码与handb相同

2024-04-29 05:08:17 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试为我的RNA-seq-EdgeR输出获取Entrezgene名称。我找到了mygene,并认为我应该尝试一下,但不管我做了什么(在家庭系统和服务器上尝试过),我都会遇到以下错误:

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')

回溯(最近一次调用last):文件“”,第1行,在 AttributeError:“module”对象没有“querymany”属性

仅使用键入的列表进行尝试:

mg.getgenes(['ENSG00000176658.17','ENSG00000085224.22','ENSG00000112562.18','ENSG00000184347.14','ENSG00000183117.19','ENSG00000149218.5','ENSG00000123572.17','ENSG00000146938.16','ENSG00000206195.10'], fields="entrezgene")

回溯(最近一次呼叫): 文件“”,第1行,在 AttributeError:“module”对象没有属性“getgenes”

我不知所措。这段代码直接来自几个手册和教程。有人能帮我吗?我有成千上万的集成基因ID,我需要转换并以某种方式合并回我的数据帧

谢谢


Tags: 文件csvimportfieldsdataascolmygene