Biopython错误 - 系统找不到指定的文件

时间:2012-01-19 15:48:06

标签: python eclipse pydev biopython

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

我正在尝试执行将执行tBLASTn算法的最简单的命令集, 在数据库中查找序列(指定为“pytanie.fasta”文件的序列)(也指定为file - > cucumber.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上使用相同的代码,它工作正常。

有人知道如何修复此错误吗?

1 个答案:

答案 0 :(得分:0)

文件的路径是什么?

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

相关问题