This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Limiting the number of hits in a Biopython NCBIWWW Search

I'm working on trying to automate some BLAST searches. I need to pick up only the top three results from the BLAST results, however the parameter hitlist_size doesn't seem to be limiting my searches to only three results. No matter what size I specify I still end up getting > 3 hits for most samples (in others I get three, although I'm not sure if this is simply coincidence) . Does anyone have any insight to this?

import Bio
from Bio import SeqIO
from Bio.Blast import NCBIWWW
from Bio.Blast import NCBIXML
fasta_string = open("FASTA_Files/48_50.fasta").read()
result_handle = NCBIWWW.qblast("blastn", "nt", fasta_string, hitlist_size=3)
with open("XML_Files/48_50.xml", "w") as save_to:
    save_to.write(result_handle.read())
    result_handle.close()
python biopython ncbiwww blast hitlist_size

0 answers

No answers yet.

Log in to answer this question.