Limiting the number of hits in a Biopython NCBIWWW Search
0
0
Entering edit mode
5.0 years ago

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 • 1.9k views
ADD COMMENT
1
Entering edit mode

Shouldn't you be using alignments=3 (ref: http://biopython.org/DIST/docs/api/Bio.Blast.NCBIWWW-module.html ) then?

ADD REPLY

Login before adding your answer.

Traffic: 2969 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6