Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #62537

Getting updates and restarting a long running url request.

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <vincent@vincentdavis.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.096
X-Spam-Evidence '*H*': 0.81; '*S*': 0.00; 'subject:Getting': 0.07; 'received:209.85.219': 0.09; 'restart': 0.09; 'def': 0.12; "'''": 0.16; 'url:bio': 0.16; 'basically': 0.19; 'result.': 0.19; 'input': 0.22; 'to:name:python-list@python.org': 0.22; 'sends': 0.24; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'submitting': 0.31; '&quot;': 0.31; 'received:209.85': 0.35; 'received:google.com': 0.35; 'complete.': 0.36; 'url:org': 0.36; 'received:209': 0.37; 'starting': 0.37; 'sometimes': 0.38; 'skip:& 10': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; '8bit%:29': 0.60; 'skip:n 30': 0.60; 'skip:n 10': 0.64; 'needing': 0.65; 'minutes': 0.67; 'results': 0.69; '8bit%:21': 0.69; 'blast': 0.84; 'subject:long': 0.84
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=oMjOF3bzRlvL3LAROBi241Zcu37JvG2J2c3sPZcV6XY=; b=PgSW/49HXgLI5MYLuDYOLn+URGFVLLlbObnwpqCcMZVbY8MHX/8Sm3pPra34inzm4r DYcV1eXKg1HbTdO1CbZtAKKjkX0pFo+CJK3bNaKEZs/KAS/3cgWyVZ5u1vMZEC0jAAf3 icDxifJIGhTG+goOEbG8rXDmPB6yf5RYA4YvbkLb1CO40NKwt9hxUFn8BkjgterBn5KY AgDpBhcSYdmymU0C47Yq2SMP5BarMtt2Lk4cb0R/zBb0i6RYk5QZ20fZITVV2+o7eMj7 p2JCuTDbdxqSnh4QJGc3BSZ7yo/R5rD04XcCTaby0xV+V8gpKNbTfZy6zEQ+ySKInWj5 i2nA==
X-Gm-Message-State ALoCoQkcHj1Z9p+QRQP4mjmDCw1di6amh7jLxXBd+gFW0/AaXqS1pLz7ZApRgrNplrfebKHAMp+g
X-Received by 10.60.46.162 with SMTP id w2mr9680407oem.48.1387735636961; Sun, 22 Dec 2013 10:07:16 -0800 (PST)
MIME-Version 1.0
From Vincent Davis <vincent@vincentdavis.net>
Date Sun, 22 Dec 2013 11:06:56 -0700
Subject Getting updates and restarting a long running url request.
To "python-list@python.org" <python-list@python.org>
Content-Type multipart/alternative; boundary=089e013d0960af076e04ee2361f4
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4496.1387735647.18130.python-list@python.org> (permalink)
Lines 82
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1387735647 news.xs4all.nl 2877 [2001:888:2000:d::a6]:35059
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:62537

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

I am using biopython's NCBIWWW.qblast which sends a request to the ncbi
website and waits for a result. The relevant code can be found at the link
below starting at about 151. Basically it is a while loop waiting for the
blast query.
http://biopython.org/DIST/docs/api/Bio.Blast.NCBIWWW-pysrc.html

My problem; I am submitting about 75 request (one at a time and with
delays) and they can each take minutes to complete. I think sometimes the
request/response/query fails which results in me needing to restart
the process.

I am looking for suggestion on how to monitor and restart the process if I
think it has failed.

I am using the following code to submit the query/
def get_BLAST(taxid, queryseq, args=None):
    '''
    Input taxid to BLAST queryseq against
    '''
    e_query = "txid" + taxid + " [ORGN]"
    #, other_advanced='-G 4 -E 1'
    blast_result = NCBIWWW.qblast("blastn", "nt", queryseq, megablast=True,
entrez_query=e_query, word_size='11', other_advanced='-G 5 -E 2')
    return NCBIXML.read(blast_result)


Vincent Davis

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Getting updates and restarting a long running url request. Vincent Davis <vincent@vincentdavis.net> - 2013-12-22 11:06 -0700

csiph-web