1

我遇到了一个我无法解决的错误。

我正在尝试执行将执行 tBLASTn 算法的最简单的命令集,在数据库(也指定为文件-> cucumber.fasta)中查找序列(指定为“pytanie.fasta”文件的序列)。结果将保存在“wynik.txt”文件中。

代码如下所示:

from Bio.Blast. Applications import NcbitblastnCommandline
database = r"\Biopython\cucumber.fasta"
qr = r"\Biopython\pytanie.fasta"
output = r"\Biopython\wynik.txt"
e = raw_input("Enter e-value: ")
tblastn_cline = NcbitblastnCommandline(cmd='blastn', db=database, query=qr, out=output, evalue=e, outfmt=7)

print tblastn_cline

stdout, stderr = tblastn_cline()

我得到的错误是:

 File "C:\Users\IBM_ADMIN\Desktop\PYTHON\Workspace\Biopython\blast.py", line 20, in <module>
stdout, stderr = tblastn_cline()
File "C:\Python27\lib\site-packages\Bio\Application\__init__.py", line 435, in __call__
shell=(sys.platform!="win32"))
File "C:\Python27\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 893, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

我在用:

  • Eclipse SDK 版本:3.7.1
  • Python 2.7 版
  • 操作系统:64 位 Windows 7

我也在 32 位 Windows XP 上尝试过这个,它产生了同样的错误。Biopython 包应该可以正常工作,因为它通过了 biopython 网站建议的测试。我也尝试过文件所在路径的其他格式,但没有奏效。我的朋友在 Ubuntu 上使用了相同的代码,并且运行良好。

有谁知道如何解决这个错误?

4

1 回答 1

0

文件的路径是什么?

r"\Biopython\cucumber.fasta"例如, path 是当前驱动器上的绝对路径(因为它以反斜杠开头且没有驱动器号),我认为在您的情况下是r"C:\Biopython\cucumber.fasta". 那是对的吗?

于 2012-01-19T17:57:02.857 回答