我正在尝试使用 Biopython 的 NcbiblastxCommandline 工具使用“nr”数据库在本地运行 blastx,但我总是收到有关蛋白质数据库搜索路径的以下错误:
>>> from Bio.Blast.Applications import NcbiblastxCommandline
>>> nr = "/Users/Priya/Documents/Python/ncbi-blast-2.2.26+/bin/nr.pal"
>>> infile = "/Users/Priya/Documents/Python/Tutorials/opuntia.txt"
>>> blastx = "/Users/Priya/Documents/Python/ncbi-blast-2.2.26+/bin/blastx"
>>> outfile = "/Users/Priya/Documents/Python/Tutorials/opuntia_python_local.xml"
>>> blastx_cline = NcbiblastxCommandline(blastx, query = infile, db = nr, evalue = 0.001, out = outfile)
>>> stdout, stderr = blastx_cline()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/Bio/Application/__init__.py", line 443, in __call__
stdout_str, stderr_str)
Bio.Application.ApplicationError: Command '/Users/Priya/Documents/Python/ncbi-blast-2.2.26+/bin/blastx -out /Users/Priya/Documents/Python/Tutorials/opuntia_python_local.xml -query /Users/Priya/Documents/Python/Tutorials/opuntia.txt -db /Users/Priya/Documents/Python/ncbi-blast-2.2.26+/bin/nr.pal -evalue 0.001' returned non-zero exit status 2, 'BLAST Database error: No alias or index file found for protein database [/Users/Priya/Documents/Python/ncbi-blast-2.2.26+/bin/nr.pal] in search path [/Users/Priya::]'
我不确定如何更改路径以指向我下载的 nr 数据库,但我认为我正确地指出了它,因为我可以从命令行运行此代码而没有任何问题:
Priyas-iMac:~ Priya$ /Users/priya/Documents/Python/ncbi-blast-2.2.26+/bin/blastx -query /Users/priya/Documents/Python/Tutorials/opuntia.txt -db /Users/priya/Documents/Python/ncbi-blast-2.2.26+/bin/nr -out /Users/priya/Documents/Python/Tutorials/opuntia_local.xml -evalue 0.001 -outfmt 5
如我所料,上面的命令行代码创建了爆炸结果的 xml 文件。
任何使用 Biopython NCBI 命令行工具解决此问题的帮助将不胜感激!