[Biopython] help with ncbiWWW
Pejvak Moghimi
pejvak.moghimi at york.ac.uk
Wed Jul 26 15:50:14 UTC 2017
Signals would not work in my case, as I am writing this for Windows users.
On 26 July 2017 at 16:18, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> On Wed, Jul 26, 2017 at 1:37 PM, Nabeel Ahmed
> <chaudhrynabeelahmed at gmail.com> wrote:
> > Hi,
> >
> > Disclaimer: I haven't used ncbiWWW module.
> >
> > Suggestion 1: if you're using a *NIX system. Can make use of Signals.
> Wrap
> > your call with the signal. Define the signal handler:
>
> I think that approach would work here - thanks!
>
> > Suggestion 2: using Multiprocessing or multithreading - for it, kindly
> share
> > your script/snippet.
>
> Again that would likely work, but will be more complicated.
>
> > Suggestion 3: Make direct API calls using 'requests' package.
> > In case the API calls are simple (you can easily do so) use request to
> make
> > a call, with timeout flag, once the HTTP request will timeout it'll raise
> > Timeout exception, which you can catch and in that block make the second
> > call (which as per you, works perfectly fine):
>
> This is essentially the idea I was initially suggesting, but the problem
> isn't actually in the online request (currently done by urlopen).
>
> With the NCBI BLAST you typically submit a query, wait, check for
> progress, wait (repeat), and then download the results. This loop in
> Biopython has no timeout - it relies on the NCBI returning results
> eventually - or giving an error.
>
> Peter
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.open-bio.org/pipermail/biopython/attachments/20170726/13e3da75/attachment.html>
More information about the Biopython
mailing list