This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Show More Blast Results Using Biopython?

Hi,

I'm using biopython to BLAST over the internet. However, it only saves 30 results (there are more than 30 results that are under the e-value I chose) in the xml. I've been looking all over but can't find how to make that number higher. So my question is, how can you show more results from BLAST using biopython. I'm using NCBIWWW.qblast from BIO.BLAST.

from Bio.Blast import  NCBIWWW
File = "MIF"
fasta_string = open(File+".fasta").read()
result_handle = NCBIWWW.qblast("blastp", "nr", fasta_string)

Thanks, Niek

biopython blast python

Which blast service are you using?

NCBIWWW.qblast
File = "MIF" fasta_string = open(File+".fasta").read() result_handle = NCBIWWW.qblast("blastp", "nr", fasta_string)

NCBIWWW.qblast

File = "MIF"
fasta_string = open(File+".fasta").read()
result_handle = NCBIWWW.qblast("blastp", "nr", fasta_string)

NCBIWWW.qblast

File = "MIF"
fasta_string = open(File+".fasta").read()
result_handle = NCBIWWW.qblast("blastp", "nr", fasta_string)

3 answers

From here:

qblast(program, database, sequence, 
       ncbi_gi=None, descriptions=None,
       alignments=None, expect=None,
       matrix=None, filter=None,
       format_type=None, hitlist_size=None,
       entrez_query='(none)')

Did you try setting descriptions, alignments, and/or hitlist_size?

Yes thank you! I've been looking for a site like that.

According to this post here (a little outdated I admit), you will want to override the hitlist_size defaults.

Hello Niek,

Daniel pointed out an email to the Biopython mailing list which answers your question - basically try reading the built in documentation. This is also mentioned in the Biopython Tutorial, quote:

For more about the optional BLAST arguments, we refer you to the NCBI’s own documentation, or that built into Biopython:
from Bio.Blast import NCBIWWW
help(NCBIWWW.qblast)

Also audyyy pointed out some old (but apparently still relevant) documentation from Andrew Dalke's homepage.

You said

I've been looking all over but can't find how to make that number higher.

so you probably looked at some of these bits of documentation (right?). Could you suggest how it could be made clearer for newcomers? Feedback does help to improve the docs.

Thanks,
Peter

Log in to answer this question.