This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Did Biopython's NCBIWWW qblast suddenly stopped supporting entrez_query parameter?

I'm using Biopython 1.73 with Python 3.7.2.

Until yesterday, the following code produced BLAST results as intended:

entrquery = '"Arabidopsis thaliana"[organism]'

result_handle = NCBIWWW.qblast(program="blastp",database="swissprot", sequence=mainfastafile.read(), entrez_query=entrquery, hitlist_size=1)

However, as of today, I get the following error:

ValueError: Error message from NCBI: Entrez Query: "Arabidopsis thaliana"[organism] is not supported

I tried this with and without quotation marks, changed uppercase and lowercase, added a whitespace, even tried other formats I've seen working previously, like txid:3702 [ORGN], but nothing works. Does anyone know what might be the source of this problem?

biopython qblast blast entrez_query ncbiwww

Actually, what jrj.healey suggested might have just solved the issue - I've manually updated Biopython with all dependencies via pip, and now the qblast is working again, specifically for entrez_query = '"Arabidopsis thaliana"[organism]'.

Thanks!

If an answer was helpful, you should upvote it; if the answer resolved your question, you should mark it as accepted. You can accept more than one if they work.
Upvote|Bookmark|Accept

1 answer

Did you actually update BioPython between yesterday and today?

I don't think so, unless my IDE (Thonny) updates the packages automatically. Checked it manually now, the Biopython package should be up to date.

Other than that, the only change I've made in the code is that I've deleted some lines with imports that were not currently in use, but Bio.Blast NCBIWWW, SeqIO and SearchIO libraries are still there.

Actually, an update - after several more hours of working after the problem was fixed, it returned again. Therefore, I suspect it is not directly linked with the Biopython update, but maybe rather with the NCBI server load, which results in denying/failing a qblast request.

Log in to answer this question.