This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Does Ncbitblastncommandline Reads The Outfmt (Options 6, 7, And 10 ) Correctly?

I am trying to call

tblastn_hits = NcbitblastnCommandline(cmd='tblastn',
                                         query=query_handle,
                                         db=db_handle,
                                         num_threads=6,
                                         evalue=0.001,
                                         outfmt="6 qstart qend evalue bitscore",
                                         dbsize=10000000,
                                         out="%s%s.txt" % (result_handle,orf_name))

But, when i run the script, it ignores anything after 6 in outfmt, so the blast results only have default columns. Is this a problem with the Biopython version or i am doing something wrong?

biopython blast blast

I'm having the same issue when running blast+ executables straight from command line.

1 answer

You need to quote it, the easiest way would be:

tblastn_hits = NcbitblastnCommandline(cmd='tblastn',
                                     query=query_handle,
                                     db=db_handle,
                                     num_threads=6,
                                     evalue=0.001,
                                     outfmt='"6 qstart qend evalue bitscore"',
                                     dbsize=10000000,
                                     out="%s%s.txt" % (result_handle,orf_name))

Here I am using single quotes for the Python string, which means I can use double quotes inside the string.

Yes, thank you! I was having this problem on blast+ on the command line when combining it with GNU Parallel.

Log in to answer this question.