Problem With Blastp Of Biopython: Returned Non-Zero Exit Status 1
3
2
Entering edit mode
14.2 years ago
Niek De Klein ★ 2.6k

I want to do a local BLAST using blastp from the Bio.Blast.Applications. However, when I run it I get a runtime error: returned non-zero exit status 1. According to the manual it is
Exit Code Meaning: 1 Error in query sequence(s) or BLAST options. The query used is fasta format protein sequences.

The command line I used, with the BLAST options, was:
'>>> print blastpcline
C:\Program Files\NCBI\blast-2.2.24+\bin\blastp.exe -query "C:\Documents and Settings\newintern\Desktop\Microproteins
niek\arabidopsis-HD.fasta" -db C:\Documents and Settings\newintern\Desktop\Microproteins_niek\arabidopsis-smallproteins.fasta -out test.xml -evalue 0.001 -outfmt 5

Anyone know how to fix that error?

Thanks
Niek

edit:

RuntimeError: Command C:\Niek\blast-2.2.17\bin\blastall.exe -query C:\Niek
\Test\arabidopsis-HD.fasta -db C:\Niek\Test\arabidopsis-smallproteins.fasta -out 
test.xml -evalue 0.001 -outfmt 5 returned non-zero exit status 1

I changed it to a path without spaces, still gives me the same error.

biopython python error blast blast • 11k views
ADD COMMENT
1
Entering edit mode

In your edit, you are calling the older blastall executable, but your query parameters look to be for blast+ blastp. To debug further, you should try running the command line from a prompt to see the error messages.

ADD REPLY
0
Entering edit mode

have you tried the same query from command line?

ADD REPLY
0
Entering edit mode

You were right, after I changed the path I accidentally changed the blast path to the wrong blast. It's working now thanks!

ADD REPLY
5
Entering edit mode
14.2 years ago
Peter 6.0k

Like Paulo, I would also have suggested trying this with paths without spaces. It can be made to work but can be complicated - mainly with the db parameter where spaces are also used to separate multiple database names.

I don't have access to a Windows machine today, but I would first try this as the command (both at the command line, and via Python):

"C:\Program Files\NCBIblast-2.2.24+\bin\blastp.exe" -query "C:\Documents and Settings\newintern\Desktop\Microproteins_niekarabidopsis-HD.fasta" -db "C:\Documents and Settings\newintern\Desktop\Microproteins_niekarabidopsis-smallproteins.fasta" -out test.xml -evalue 0.001 -outfmt 5

i.e quotes round the executable name and database name as well as the query name.

A more complete example of the Python code would help, including version numbers.

ADD COMMENT
0
Entering edit mode

Seems likely to me too, that this is the actually the problem.

ADD REPLY
0
Entering edit mode

I changed it to a path without spaces (forgot to edit it in my first post), but it still gives me the same error

ADD REPLY
2
Entering edit mode
14.2 years ago
Paulo Nuin ★ 3.7k

I guess the error might be in the spaces you have in your file locations. It would depend on which version of Windows you are using (I guess XP), but there are many problems in parsing spaces on Windows, especially XP. Try moving your files to a location without spaces in the directory names.

ADD COMMENT
0
Entering edit mode

I've done that now, but it still gives the same error.

ADD REPLY
2
Entering edit mode
14.2 years ago
User 59 13k

Still haven't switched to blast+ but shouldn't you still run against a database that has been formatted with formatdb or similar rather than blasting against another fasta file? (unless of course your blast database is really called arabidopsis-HD.fasta, which I personally wouldn't do to avoid the obvious confusion)

edit: looks like formatdb is called makeblastdb in blast+

ADD COMMENT
2
Entering edit mode

If you don't name the db explicitly in either version, it will be called the fasta file name. Sometimes I do this for convenience.

ADD REPLY
1
Entering edit mode

The database is called arabidopsis-HD.fasta. And if somethings wrong with the db it gives a 'returned non-zero exit status 2' error.

ADD REPLY
1
Entering edit mode

@Niek : At first view I would respond the same as Daniel. So did you format the file named arabidopsis-smallproteins.fasta using formatdb. Because according to your command line option -db it seems that this is your database.

ADD REPLY
1
Entering edit mode

I just did the formatdb again and I'm sure that the database is correct, it's working fine when I'm using the command prompt directly, and with the blastall from blast-2.2.17 it's also working. I use the same db and query there.

ADD REPLY
0
Entering edit mode

It's called arabidopsis-HD.fasta. And if somethings wrong with the db it gives a 'returned non-zero exit status 2' error.

ADD REPLY
0
Entering edit mode

I just did the formatdb again and I'm sure that the database is correct, it's working fine when I'm using the command prompt directly.

ADD REPLY

Login before adding your answer.

Traffic: 1886 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6