This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BLASTp in python (solved)

I'm having some problems when running BLAST+ blastp from python.

What I have done is this:

from Bio.Blast.Applications import NcbiblastpCommandline
blastp_cline = NcbiblastpCommandline(query='target.fasta', out='target.out', db='/home/acastella/acastella/Database/pdbseq/PDBseq.fa')
print(blastp_cline)
blastp -out target.out -query target.fasta -db /home/acastella/acastella/Database/pdbseq/PDBseq.fa
stdout, stderr = blastb_cline()

and what I get is this:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/soft/devel/python-2.7/lib/python2.7/site-packages/biopython-1.62b-py2.7-linux-x86_64.egg/Bio/Application/__init__.py", line 488, in __call__
    stdout_str, stderr_str)
Bio.Application.ApplicationError: Command 'blastp -out hola.out -query target.fasta -db /home/acastella/acastella/Database/pdbseq/PDBseq.fa' returned non-zero exit status 127, '/bin/sh: blastp: command not found'

When I run this on command line directly blast runs perfectly and generate the file I want.

python blastp blast

1 answer

it's a PATH problem https://www.google.fr/search?q=site%3Abiostars.org+%22command+not+found

Log in to answer this question.