I'm using the standalone BLAST 2.2.17 with python. However, I'm having a problem with the cmd. When running the script the cmd stops responding at the 15th blast record. It doesn't matter if I change the proteins, it's always the 15th.
from Bio.Blast import NCBIStandalone
from Bio.Blast import NCBIXML
my_blast_db = r"C:\Niek\Test2.2.17\Worm\c_elegans.protein.WS200.fasta"
my_blast_file = r"C:\Niek\Test2.2.17\Worm\worm-HD.fasta"
my_blast_exe = r"C:\Niek\blast-2.2.17\bin\blastall.exe"
result_handle, error_handle = NCBIStandalone.blastall(my_blast_exe, "blastp",
my_blast_db, my_blast_file, matrix="BLOSUM62")
blast_records = NCBIXML.parse(result_handle)
y = 0
#see if target is in TF list
for blast_record in blast_records:
if blast_record:
y+=1
print y
It worked normally like this earlier today and with other databases.
Has anyone else had this problem/know how to fix it?
Thanks,
Niek
Edit: I used blast 2.2.17 in command line directly (using same commands as used above) to create an xml file and read that in as result_handle. That works.
@Michael's comment:
from Bio.Blast.Applications import NcbiblastpCommandline
my_blast_db = r"C:\Niek\Test2.2.17\Worm\c_elegans.protein.WS200.fasta"
my_blast_file = r"C:\Niek\Test2.2.17\Worm\worm-HD.fasta"
blastp_cline = NcbiblastpCommandline(cmd='blastp', query=my_blast_file, db=my_blast_db, evalue=0.01,
outfmt=5, out="wormAll-HD.xml")
print blastp_cline
print blastp_cline()
print blastp_cline gives:
blastp -query C:\Niek\Test2.2.17\Worm\worm-HD.fasta -db C:\Niek\Test2.2.17\Worm\c_elegans.protein.WS200.fasta -out wormAll-HD.xml -evalue 0.01 -outfmt 5
When I copy that in the blast-2.2.24+ command line tool it works, but in the script it gives :
File "C:/Niek/Test2.2.24/Worm/test.py", line 11, in <module>
print blastp_cline()
File "C:\Python27\lib\site-packages\Bio\Application\__init__.py", line 472, in __call__
shell=(sys.platform!="win32"))
File "C:\Python27\lib\subprocess.py", line 672, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 882, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified
Please consider upgrading to Linux.
Please consider updating to a current version of BLAST (and maybe BioPython) and see if the problem persists, thus making it easier for us to help you.
It doesn't happen with blast 2.2.24+
with the blast 2.2.24+ I have the problem that I get "WindowsError: [Error 2] The system cannot find the file specified", but when I paste the "print cline" result that I used in the command line it does work.
Can you update your code to the one you are using with 2.2.24+ and paste the print cline here?