1. is there any way to retrieve a BLAST request made using the Biopython library using the request's query_id?
  2. Alternatively is it possible to retrieve a query_id before the blast result is complete, and checking on it later?
  3. (bit off-topic) I seem to only retrieve 60 results even at higher hitlist_size although i get much more results when blasting the same entry on uniprot

I'm working on a script which processes a BLAST result and having to re-request the search every time is quite temporally cumbersome since i'm still learning the library. currently i'm using: blastResult = NCBIWWW.qblast("blastp", "swissprot", targetAminoAcids,format_type="Tabular", hitlist_size=200)

  • $\begingroup$ Welcome to the site. This sounds like you just want to add some cache, is that right? Thats fairly easy via Python. Setting up a cache database is more complicated however - but absolutely doable - details about when you are running the different requests and how would help here. $\endgroup$
    – M__
    Nov 1, 2023 at 15:07
  • $\begingroup$ Please edit your question and give us i) a script that we can run locally to reproduce your issue and ii) an example input so we can test it. $\endgroup$
    – terdon
    Nov 2, 2023 at 9:23

1 Answer 1


1 and 2 —> Yes, but you need to have the query ID in order to do so: having the description would be a bonus, but not required. If you go to 8.1.1 Query Result of the Biopython manual, it will tell you how to get a query id, if you don’t already have it! Go to section 7.1 as a reminder of how to run BLAST via the internet. Go to section 7.2 to. Run BLAST locally. Weigh your options out with running via Internet or locally. Running BLAST locally is faster usually and gives you more user freedom to create your own database with your own parameters, etcetera., but certain tools will need to be downloaded via the command line/terminal. Follow this link for the BLAST command line user manual: https://www.ncbi.nlm.nih.gov/books/NBK279690/ I will paste the link to the Biopython user manual if you do not already have it: http://biopython.org/DIST/docs/tutorial/Tutorial.html#sec123

3 —> Try the Protein Data Bank (PDB) instead of UniProt or you can combine both UniProt and PDB (I recommend this route as it’s a combination of the 2 databases). You can use these two databases to process a BLAST result! I have found in my experience, combining data from more than 1 database has been beneficial in my case!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.