我在自己编写的生物信息学管道内的Python中使用ete3(http://etetoolkit.org/)包。
运行此脚本时,出现以下错误。对于没有任何问题并且没有给出任何错误的其他数据集,我已经大量使用了此脚本。我正在使用Python3.5和miniconda。解决此错误的任何修复/见解将不胜感激。
[错误]
Traceback (most recent call last):
File "/Users/d/miniconda2/envs/py35/bin/ete3", line 11, in <module>
load_entry_point('ete3==3.1.1', 'console_scripts', 'ete3')()
File "/Users/d/miniconda2/envs/py35/lib/python3.5/site-packages/ete3/tools/ete.py", line 95, in main
_main(sys.argv)
File "/Users/d/miniconda2/envs/py35/lib/python3.5/site-packages/ete3/tools/ete.py", line 268, in _main
args.func(args)
File "/Users/d/miniconda2/envs/py35/lib/python3.5/site-packages/ete3/tools/ete_ncbiquery.py", line 168, in run
collapse_subspecies=args.collapse_subspecies)
File "/Users/d/miniconda2/envs/py35/lib/python3.5/site-packages/ete3/ncbi_taxonomy/ncbiquery.py", line 434, in get_topology
lineage = id2lineage[sp]
KeyError: 3
从注释部分继续,以获得更好的格式。
假设sp
包含错误消息所建议的3
(请自行检查)。您可以按照其定义检查ete3代码(current version),可以将其追溯到line:
def get_lineage_translator(self, taxids):
"""Given a valid taxid number, return its corresponding lineage track as a
hierarchically sorted list of parent taxids.
所以我去了https://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi并检查3
是否有效taxid
,似乎无效。
# relevant section from ncbi taxonomy browser
No result found in the Taxonomy database for taxonomy id
3
在我看来,您唯一的选择是跟踪3
的计算方式。因为根本原因仅仅是taxid 3
不是函数要求的valid taxid number
。