1

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?

gary
  • 4,227
  • 3
  • 31
  • 58
user1158803
  • 11
  • 1
  • 3
  • Does BioPython need any dependencies, e.g. some installation for BLAST support? Double-check it. It looks very much like the application startup code wants to start some native process (thus `subprocess.py`) and cannot find the executable. – 9000 Jan 19 '12 at 18:04
  • 3
    Have you installed 'blastn', included with blast+? http://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=BlastDocs&DOC_TYPE=Download Biopython calls the native program, so that needs to be installed and on your path. – Brad Chapman Jan 19 '12 at 20:32

1 Answers1

0

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 is r"C:\Biopython\cucumber.fasta". Is that correct?

MRAB
  • 20,356
  • 6
  • 40
  • 33
  • MRAB: If Biopython is not able to find a necessary file it prints another error, ealier than this one. The path format is not the case here. I have checked all the possibilites with 2 backslashes, slashes, no drive letters and full paths specified. About processes: Yes, biopython needs NumPy, but it is supposed to be installed automatically with Biopython. I will check that dependency, maybe there is a problem with NumPy installation. – user1158803 Jan 19 '12 at 18:21