[Biopython] Bio.Blast.Applications issue with outfmt="quoted string"

Peter Cock p.j.a.cock at googlemail.com
Tue Aug 2 16:14:25 UTC 2011


On Tue, Aug 2, 2011 at 4:47 PM, IRVIN, STEVEN (AG-Contractor/1000)
<steven.irvin at monsanto.com> wrote:
> Hello,
>
> I am having an issue with the Biopython module making BLAST+ queries.
>
> I am wondering if there is any support in Bio.Blast.Applications  for using the multiple arguments to -outfmt allowed by NCBI BLAST+ programs such as blastn.
>
> I need to use this for example:
>
>    blastn_cline = NcbiblastnCommandline(query='somefastafile.fas', db='tomato_cdna.db', evalue=1000, word_size=7, outfmt='10 qseqid sseqid length pident', out='outfile.txt')
>
> The multiple arguments allowed to blastn -outfmt  allow the choice of specific columns output to the csv or tab separated file such subject_id, etc.

Yes, and they are very useful. Try:

blastn_cline = NcbiblastnCommandline(query='somefastafile.fas',
db='tomato_cdna.db', evalue=1000, word_size=7, outfmt='"10 qseqid
sseqid length pident"', out='outfile.txt')

i.e. Include the extra quotes explicitly. That's single quote, double
quote, text, double quote, single quote.
(There are other ways to embed double quote characters in a Python
string but that works for me.)

Peter




More information about the Biopython mailing list