This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Biopython: qBLAST only retrieving 50 hits, inserting "hitlist_size=100" does not change it.

I've been wanting to retrieve the first 100 hits from my blast, but it always produces only the first 50 hits (as set by default) and I am unable to change it.

save_file = open("C:/Users/.../my_blast.xml", "w")
result_handle = NCBIWWW.qblast("blastp", "nr", "4504191", "hitlist_size=100", entrez_query="mammalia[Orgn]")
save_file.write(result_handle.read())
save_file.close()
result_handle.close()

This is the snippet of code that I am using. Is there any other way of changing it?

biopython blast

1 answer

"hitlist_size=100" shouldn't be in quotes.

Thank you, that did the trick! Is everything else quoted properly?

Looks fine to me. Remember, anything in quotes becomes a string. In this case you wanted to refer to one of the named arguments of qbast (hitlist_size), so you want to use that name and not a string in setting the arguments value.

Log in to answer this question.