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: 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; '"': 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 Date: Sun, 22 Dec 2013 11:06:56 -0700 Subject: Getting updates and restarting a long running url request. To: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 --089e013d0960af076e04ee2361f4 Content-Type: text/plain; charset=UTF-8 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 --089e013d0960af076e04ee2361f4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I am using biopython's=C2=A0NCBIWWW.qblast which sends a=C2=A0req= uest=C2=A0to the ncbi website and waits=C2=A0for a result. The=C2=A0relevan= t=C2=A0code can be found at the link below starting at about 151.=C2=A0Basi= cally=C2=A0it is a while loop waiting for the blast query.=C2=A0

<= /font>
My problem; I am=C2=A0submitting about 75 request (one at a time and with = delays) and they can each take minutes to complete. I think sometimes the r= equest/response/query fails which results in me needing to restart the=C2= =A0process.

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

I am us= ing the following code to submit the query/
def get_BLAST(taxid, queryseq, args=3DNone)= :
=C2=A0 =C2=A0 '''
=C2=A0 =C2=A0 Input taxid to BLAST queryseq against
=C2=A0 =C2=A0 '''
=C2=A0 =C2=A0 e_query =3D "txid" + taxid + &qu= ot; [ORGN]"
=C2=A0 =C2=A0 #, other_advanced=3D'-G 4 -E= 1'
=C2=A0 =C2=A0 blast_result =3D NC= BIWWW.qblast("blastn", "nt", queryseq, megablast=3DTrue= , entrez_query=3De_query, word_size=3D'11', other_advanced=3D'-= G 5 -E 2')
=C2=A0 =C2=A0 return NCBIXML.read(blast_result= )

=
Vincent Davis

--089e013d0960af076e04ee2361f4--