[Biopython] Problem running blastp

John Connolly j.connolly at sheffield.ac.uk
Wed Jan 29 14:43:28 UTC 2014


Hi,

I am very new to Biopython and python, so please excuse me if this is a
very basic question.

I have installed Blast+, which runs fine from the command line. I have also
used Biopython to produce a program that parses xml output, which works
fine.

My problem is that I would like to run a local blast from within a python
program, tacked on to the start of my parsing program.

I have used the program in the tutorial:

from Bio.Blast.Applications import NcbiblastpCommandline

cline = NcbiblastpCommandline(query="seqs.txt", db="NADB", outfmt=5,
remote=True)

cline
NcbiblastpCommandline(cmd='blastp', query='seqs.txt', db='NADB', outfmt=5,
remote=True)
print(cline)
blastp -query seqs.txt -db NADB -outfmt 5 -remote
stdout, stderr = cline()

I don't expect any output, but I get the following:

  File "test.py", line 8
    blastp -query seqs.txt -db NADB -outfmt 5 -remote
                     ^
SyntaxError: invalid syntax


I appreciate any help you could give.



More information about the Biopython mailing list