我遵循了网页上的教程:http://pythonhosted.org/bioservices/compound_tutorial.html
在我执行以下命令之前,一切都运行正常:
uni = UniChem()然后我收到了错误消息:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "P:\Anaconda\lib\site-packages\bioservices\unichem.py", line 84, in __init__
maxid_service = int(self.get_all_src_ids()[-1]['src_id'])
TypeError: list indices must be integers, not str作为最小的工作示例:
from bioservices import *
uni = UniChem()然后我收到了这个错误。我理解这个错误(在很大程度上),但我不知道如何修复它。所以我的问题是,我如何修复这个函数或解决它?
总体目标是将1000个药物名称的列表(希望在不久的将来会有更多)映射到Chembl ID。
发布于 2014-05-30 17:38:34
您看到的错误可能与以下事实有关:当您尝试连接到UniChem服务时,它正在进行维护,或者它花费了太多的时间进行初始化。结果是服务没有启动,因此出现了错误消息。
我刚刚尝试过(bioservices 1.2.6)
from bioservices import *
uni = UniChem()而且它起作用了。以下请求也起作用:
>>> mapping = uni.get_mapping("kegg_ligand", "chembl")
'CHEMBL278315'https://stackoverflow.com/questions/22202184
复制相似问题