如何在不指定使用生物服务的生物体的情况下访问KEGG条目?

2024-05-19 03:07:01 发布

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

我试图通过bioservices访问KEGG,以获得有关基因列表的某些信息。问题是我事先不知道每个基因属于哪个有机体;在我的列表中可能有很多基因都属于不同的有机体。我的问题是,我不知道如何检索所需的有关基因的信息,而不指定生物体。在

举个例子:

gene_list = ['YMR293C', 'b3640']

first gene属于酵母,而{a4}属于大肠杆菌。在

如果我现在尝试:

^{pr2}$

我最后得到了一个TypeError,因为

kegg_con.get('b3640', parse=True)

不返回字典,只返回一个数字(因为我没有指定它所属的有机体)。但是,当我指定有机体时(这里是eco,它代表大肠杆菌):

kegg_con.get('eco:b3640', parse=True)['NAME']

退货

[u'dut']

这是正确的,我们可以看到here

enter image description here

然后,我试图通过使用find来获取相关有机体的信息。对于YMR293C效果良好,但对于b3640则失败:

kegg_con.find('genes', 'YMR293C')

退货

u'sce:YMR293C\tHER2, GEP6, QRS1, RRG6; glutamyl-tRNA(Gln) amidotransferase subunit HER2 (EC:6.3.5.7); K02433 aspartyl-tRNA(Asn)/glutamyl-tRNA(Gln) amidotransferase subunit A [EC:6.3.5.6 6.3.5.7]\ncal:CaO19.11438\tlikely amidase similar to S. cerevisiae YMR293C mitochondrial putative glutamyl-tRNA amidotransferase\ncal:CaO19.3956\tlikely amidase similar to S. cerevisiae YMR293C mitochondrial putative glutamyl-tRNA amidotransferase; K02433 aspartyl-tRNA(Asn)/glutamyl-tRNA(Gln) amidotransferase subunit A [EC:6.3.5.6 6.3.5.7]\n'

但是,当我运行

 kegg_con.find('genes', 'b3640')

我明白了

u'cnb:CNBB3640\thypothetical protein; K06316 oligosaccharide translocation protein RFT1\ncgi:CGB_B3640C\thypothetical protein\neco:b3640\tdut; deoxyuridinetriphosphatase (EC:3.6.1.23); K01520 dUTP pyrophosphatase [EC:3.6.1.23]\nsea:SeAg_B3640\tbfd; bacterioferritin-associated ferredoxin; K02192 bacterioferritin-associated ferredoxin\nyps:YPTB3640\tconserved hypothetical protein\nreu:Reut_B3640\tconserved hypothetical protein\nbbr:BB3640\tphage-related exported protein\nmag:amb3640\thypothetical protein\nbcg:BCG9842_B3640\tflagellar hook-associated protein; K02407 flagellar hook-associated protein 2\ncbi:CLJ_B3640\tconserved hypothetical protein; K09963 uncharacterized protein\nmmo:MMOB3640\thypothetical protein\nmbo:Mb3640c\tftsH; membrane-bound protease FTSH (cell division protein) (EC:3.4.24.-); K03798 cell division protease FtsH [EC:3.4.24.-]\n'

它没有提供关于大肠杆菌的信息。在

因此,我的问题是:

1)有没有一种方法可以让我只根据基因ID就可以访问有关该基因的信息,而不必指定它所属的有机体?在

2)检索基因属于哪种有机体的信息的最佳方法是什么?为什么当我搜索大肠杆菌基因时{}失败了?在


Tags: 信息基因findconeckeggproteinassociated
1条回答
网友
1楼 · 发布于 2024-05-19 03:07:01

但是我认为在输出的字符串中找不到一个简单的信息。在第三行,您可以看到:

eco:b3640

现在,我不确定KEGG的输出格式是否总是具有相同的结构。如果是这样,假设兴趣线是第三条,则可以使用:

^{pr2}$

您可以进一步检查它是否是有效的组织,如下所示:

assert organism in kegg_con.organismIds

为了安全起见,您可以在字符串中搜索标识符(而不是使用第三行):

[x for x in res.split() if "b3640" in x]

希望有帮助

《生物服务》的主要作者

相关问题 更多 >

    热门问题