Biopython 错误 - 系统找不到指定的文件
我遇到了无法解决的错误。
我正在尝试执行最简单的一组命令来执行 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 上使用相同的代码并且运行良好。
有谁知道如何修复这个错误?
I have encountered an error which I am not able to resolve.
I am trying to perform the easiest set of commands that will perform a tBLASTn algorithm,
looking for a sequence (sequence specified as a "pytanie.fasta" file) in a database (also specified as file -> cucumber.fasta). The result will be saved in the "wynik.txt" file.
The code looks as following:
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()
And the error I get:
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
I am using:
- Eclipse SDK Version: 3.7.1
- Python version 2.7
- OS: 64 bit Windows 7
I have tried this also on 32-bit Windows XP and it produces the same error.
Biopython package should work fine since it went through the tests suggested by biopython website. I have also tried other formats of the path where the files are located, but it did not work. My friend uses the same code on Ubuntu and it works fine.
Does anybody know how to fix this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
文件的路径是什么?
例如,路径 r"\Biopython\cucumber.fasta" 是当前驱动器上的绝对路径(因为它以反斜杠开头并且没有驱动器号),我认为在您的情况下是
r“C:\Biopython\cucumber.fasta”
。这是正确的吗?What are the paths of the files?
The path
r"\Biopython\cucumber.fasta"
, for example, is an absolute path on the current drive (because it starts with a backslash and no drive letter), which I think in your case isr"C:\Biopython\cucumber.fasta"
. Is that correct?