ó
ª ^Ic        )   @   s  d  Z  d d l Z y d d l Z Wn e k
 rA d d l Z n Xd d l Td e f d „  ƒ  YZ d f  d „  ƒ  YZ e	 e	 e	 e	 d d	 e	 e	 e	 d
 e	 e	 e	 e	 e	 e	 e	 e	 e	 e	 e	 e	 e	 e	 e	 e	 e	 e	 d e	 d e	 e	 e	 e	 e	 d e	 e	 e	 d „( Z
 d „  Z d S(   s4  
This module provides code to work with the WWW version of BLAST
provided by the NCBI.
http://blast.ncbi.nlm.nih.gov/

Functions:
qblast        Do a BLAST search using the QBLAST API.

Deprecated classes:
BlastParser   Parses output from WWW blast.
_Scanner      Scans output from NCBI's BLAST WWW server.


iÿÿÿÿN(   t   *t   BlastParserc           B   s    e  Z d  Z d „  Z d „  Z RS(   s†   Parses WWW BLAST data into a Record.Blast object (DEPRECATED).

    This is a parser for the NCBI's HTML (web page) BLAST output.
    c         C   sU   d d l  } | j d d d t ƒ d d l } t ƒ  |  _ t | j ƒ  ƒ |  _ d S(   s)   Create a BlastParser object (DEPRECATED).iÿÿÿÿNs,   Bio.Blast.NCBIWWW.BlastParser is deprecated.s)    We recommend you use the XML output withs)    the parser in Bio.Blast.NCBIXML instead.(	   t   warningst   warnt   DeprecationWarningt   NCBIStandalonet   _Scannert   _scannert   SGMLStrippingConsumert   _BlastConsumert	   _consumer(   t   selfR   R   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyt   __init__%   s    c         C   s    |  j  j | |  j ƒ |  j j S(   s   parse(self, handle)(   R   t   feedR
   t   data(   R   t   handle(    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyt   parse1   s    (   t   __name__t
   __module__t   __doc__R   R   (    (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR       s   	R   c           B   s°   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   sô   Scanner for the HTML BLAST parser (PRIVATE, DEPRECATED).
    
    Scan BLAST output from NCBI's web server at:
    http://www.ncbi.nlm.nih.gov/BLAST/
    
    Tested with BLAST v2.0.10

    Methods:
    feed     Feed data into the scanner.
    c         C   sÀ   d d l  m } t | | j ƒ r+ | } n | j | ƒ } t | | j d t j d ƒ ƒ|  j | | ƒ |  j	 | | ƒ |  j
 | | ƒ |  j | | ƒ x  | j ƒ  r» t | | j ƒ qœ Wd S(   sð   S.feed(handle, consumer)

        Feed in a BLAST report for scanning.  handle is a file-like
        object that contains the BLAST report.  consumer is a Consumer
        object that will receive events as the report is scanned.

        iÿÿÿÿ(   t   Filet   has_res
   <b>.?BLASTN(   t   BioR   t
   isinstancet
   UndoHandlet   read_and_call_untilt   noeventt   ret   compilet   _scan_headert   _scan_roundst   _scan_database_reportt   _scan_parameterst   peeklinet   read_and_call(   R   R   t   consumerR   t   uhandle(    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR   A   s    	c         C   s,  | j  ƒ  t | | j d d ƒt | | j d d ƒxK | j ƒ  } | d  d k sb | j ƒ  rs | j | ƒ Pn  | j | ƒ q9 Wt | | j d d ƒt | | j ƒ | j	 ƒ  j
 d	 ƒ d
 k rè |  j | | ƒ |  j | | ƒ n  |  j | | ƒ |  j | | ƒ t | | j d d ƒ| j ƒ  d  S(   Nt   containst   BLASTt   blanki   i   s   <p>t   startt   RIDs   Query=i    (   t   start_headerR"   t   versiont   read_and_call_whileR   t   readlinet   stript	   referencet   attempt_read_and_callR!   t   findt   _scan_query_infot   _scan_database_infot
   end_header(   R   R$   R#   t   line(    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR   r   s$    "
c         C   se   t  | | j d d ƒra xF | j ƒ  } t | ƒ r7 Pn d | k rG Pn  | j | j ƒ  ƒ q Wn  d  S(   NR%   t	   BLASTFORMs   Query=(   R0   R   R!   t   is_blank_lineR-   (   R   R$   R#   R5   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyt   _scan_blastform¶   s    	c         C   sÿ  t  | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt  | | j d d ƒ|  j | | ƒ t  | | j d d ƒt  | | j d d	 ƒrt | | j d d
 ƒ| j | j ƒ  ƒ t | | j d d ƒn  t  | | j d d ƒt  | | j d d ƒrKt | | j d d ƒn  t  | | j d d ƒt  | | j d d ƒråt | | j d d ƒxS | j ƒ  } | d  d k sÄ| j d ƒ d k rÈPn  t | | j d d ƒq’Wn  t	 | | j d d ƒd  S(   NR(   s   <p>R%   t   Databases
   sequences;R'   i   s   problems or questionss   <table border=0 width=600s   </table>s   Taxonomy reportss   <BR>s   <PRE>s   </PRE>i   s   Query=i    (
   R0   R   R"   t   database_infoR   R8   R-   R!   R1   R,   (   R   R$   R#   R5   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR3   Á   s:    			&c         C   s‡   t  | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒrs t | | j d d ƒn  |  j | | ƒ d  S(   NR%   s   Query=R'   i   R(   s   <PRE>(   R"   t
   query_infoR   R,   R   R0   R8   (   R   R$   R#   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR2   ï   s    c         C   s$   |  j  | | ƒ |  j | | ƒ d  S(   N(   t   _scan_descriptionst   _scan_alignments(   R   R$   R#   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR   ø   s    c         C   sì   | j  ƒ  t | | j d t j d ƒ ƒse t | | j d d ƒt | | j d d ƒ| j ƒ  d  St	 | | j d d ƒt	 | | j d d ƒt | | j
 d d	 d d
 ƒt | | j d d ƒsÞ t | | j d d ƒn  | j ƒ  d  S(   NR   s   Score {4,5}ER%   s   No significant similarityR'   i   R(   s   Sequences producingi    s   <as   </PRE>(   t   start_descriptionsR0   t   description_headerR   R   t   no_hitsR,   R   t   end_descriptionsR"   t   description(   R   R$   R#   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR<   ü   s$    

	c         C   sñ   t  | ƒ } t  | ƒ } | j | ƒ | j | ƒ d } } d | k rQ d } nj | j d ƒ rc nX | j d ƒ ru nF | j d ƒ r d } n. | j d ƒ r¥ d } n t d | | f ƒ ‚ | rÔ |  j | | ƒ n | rí |  j | | ƒ n  d  S(	   Ni    t
   Alignmentsi   s
     Databases   Lambda     K      Ht	   blast_tmps   <PRE>s'   Cannot resolve location at lines:
%s
%s(   t   safe_readlinet   savelinet
   startswitht
   ValueErrort   _scan_pairwise_alignmentst   _scan_masterslave_alignment(   R   R$   R#   t   line1t   line2t   is_pairwiset   is_masterslave(    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR=   $  s*    
			c         C   sÉ   xÂ t  | | j d d ƒt | ƒ } t | ƒ } | j | ƒ | j | ƒ | j d ƒ d k sŠ | j d ƒ d k sŠ | j d ƒ d k rŽ Pn  | d  d k r± |  j | | ƒ q |  j | | ƒ q Wd  S(   NR(   s   <PRE>R9   i    s   Lambda     K      Hi   s   Query:(   R   R   RE   RF   R1   t$   _scan_abbreviated_pairwise_alignmentt   _scan_one_pairwise_alignment(   R   R$   R#   RK   RL   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyRI   W  s    *c         C   sR   | j  ƒ  | j ƒ  t | | j d d ƒ|  j | | ƒ | j ƒ  | j ƒ  d  S(   NR(   s   <PRE>(   t   start_alignmentt	   start_hspR"   R   t   _scan_hsp_alignmentt   end_hspt   end_alignment(   R   R$   R#   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyRO   n  s    	


c         C   s  | j  ƒ  t | | j d d ƒ|  j | | ƒ xØ t | ƒ } t | ƒ } t | ƒ } | j | ƒ | j | ƒ | j | ƒ t j d ƒ } | j d | ƒ } | j d | ƒ } | j d | ƒ } | d  d k r÷ | d  d k r÷ | d  d k r÷ Pn  |  j	 | | ƒ q3 W| j
 ƒ  d  S(   NR(   s   <PRE>s
   </?a[^>]*>t    i   s    Score(   RQ   R"   R   t   _scan_alignment_headerRE   RF   R   R   t   subt	   _scan_hspRU   (   R   R$   R#   RK   RL   t   line3t   rea(    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyRP   ~  s&    
 c         C   s–   x^ t  | ƒ } | j ƒ  j d ƒ r5 | j | ƒ Pn t | ƒ rP t d ƒ ‚ n  | j | ƒ q Wt | | j d d ƒs’ t	 | | j d d ƒn  d  S(   Ns   Length =s*   I missed the Length in an alignment headerR(   s
             R'   i   (
   RE   t   lstripRG   t   lengthR7   RH   t   titleR0   R   R"   (   R   R$   R#   R5   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyRW   ¦  s    	c         C   s8   | j  ƒ  |  j | | ƒ |  j | | ƒ | j ƒ  d  S(   N(   RR   t   _scan_hsp_headerRS   RT   (   R   R$   R#   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyRY   ¸  s    
c         C   s§   t  | | j d d ƒt  | | j d d ƒt | | j d t j d ƒ ƒt | | j d d ƒt  | | j d d ƒt  | | j d d	 ƒt | | j d d ƒd  S(
   NR(   s   <PRE>R'   i   R   s   ^ (<a[^>]*></a>)*Scores    Identitiess    Strands    Frame(	   R0   R   R"   t   scoreR   R   t
   identitiest   strandt   frame(   R   R$   R#   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR_   ¾  s    
c         C   s«   xx t  | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt  | | j d d ƒs Pq q Wt | | j d d ƒt | | j d d ƒd  S(   NR(   s        t   Queryt   SbjctR'   i   s   </PRE>(   R0   R   R"   t   queryt   alignt   sbjctR,   (   R   R$   R#   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyRS   Ó  s    c         C   s¡   | j  ƒ  t | | j d d ƒxZ t | ƒ } t | ƒ rK | j | ƒ q# | d  d k rl | j | ƒ Pq# | j | ƒ q# Wt | | j d d ƒ| j ƒ  d  S(   NR(   s   <PRE>i   s   </PRE>R'   i   (   RQ   R"   R   RE   R7   t	   multalignR,   RU   (   R   R$   R#   R5   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyRJ   ê  s    
c         C   s  | j  ƒ  | j ƒ  } | j d ƒ d k  rD t | | j d d ƒn  | j ƒ  } | j d ƒ d k  rì t | | j d d ƒt | | j d d ƒt | | j d d	 ƒt | | j d d
 ƒt | | j	 d d ƒt | | j d d ƒn  t | | j d d ƒt | | j
 ƒ t | | j d d ƒt | | j d d ƒt | | j d d ƒrit | | j ƒ n  t | | j d d ƒ| j ƒ  d  S(   NR9   i    R(   s   <PRE>s   Lambda     K      HR%   s
     Databaset   Posteds
       Posteds     Number of letterss     Number of sequencess     t   LambdaR'   i   t   Gapped(   t   start_database_reportR!   R1   R"   R   t   databaseR   t   posted_datet   num_letters_in_databaset   num_sequences_in_databaset	   ka_paramsR0   t   gappedt   ka_params_gapR,   t   end_database_report(   R   R$   R#   R5   RL   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR   ù  s,    
c         C   s²  | j  ƒ  t | | j d d ƒt | | j d d ƒt | | j d d ƒrg t | | j d d ƒn, t | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j	 d d ƒt | | j
 d d	 ƒryt | | j d d
 ƒr4t | | j d d ƒt | | j d d ƒqyt | | j d d ƒt | | j d d
 ƒt | | j d d ƒn  t | | j d d ƒrt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒnš t | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d ƒt | | j d d  ƒt | | j d d! ƒt | | j d d" ƒt | | j d d# ƒt | | j d$ d% ƒt | | j d d& ƒt | | j d d' ƒ| j ƒ  d  S((   NR(   t   Matrixt   Gaps   Number of Hitss   Number of Sequencess   Number of extensionss   Number of successfuls   Number of sequencess   Number of HSP's betters   Number of HSP's successfullys   Number of HSP's thats   Number of HSP's gappeds   Number of extra gappeds   Length of querys   Length of databases   Length adjustments   Effective length of querys   Effective length of databases   Effective search space:s   Effective search space useds   length of querys   length of databases   effective HSPs   effective length of querys   effective length of databases   effective search space:s   effective search space usedt
   frameshiftt   Tt   At   X1t   X2t   X3t   S1t   S2R'   i   s   </PRE>s   </form>(    t   start_parametersR0   t   matrixt   gap_penaltiest   num_hitsR"   t   num_sequencest   num_extendst   num_good_extendst   num_seqs_better_et   hsps_no_gapt   hsps_prelim_gappedt   hsps_prelim_gap_attemptedt   hsps_gappedt   no_eventt   query_lengtht   database_lengtht   effective_query_lengtht   effective_database_lengtht   effective_search_spacet   effective_search_space_usedt   effective_hsp_lengthRx   t	   thresholdt   window_sizet   dropoff_1st_passt   gap_x_dropofft   gap_x_dropoff_finalt   gap_triggert   blast_cutoffR   t   end_parameters(   R   R$   R#   (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR    ,  s    
	
		

	
(   R   R   R   R   R   R8   R3   R2   R   R<   R=   RI   RO   RP   RW   RY   R_   RS   RJ   R   R    (    (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyR   6   s&   
	1	D		.				(	3			(						3s   (none)g      $@i2   iô  t   XMLc+   >   !   C   s   d d l  }+ d d l }, d d l }- |  d@ k s6 t ‚ d | f d	 | f d
 | f d | f d | f d | f d | f d |	 f d |
 f d | f d | f d | f d | f d | f d | f d | f d | f d | f d | f d | f d |  f d | f d | f d | f d  | f d! | f d" | f d# | f d$ | f d% | f d& | f dA g  }. g  |. D] }/ |/ d) d k	 r]|/ ^ q]}0 |+ j |0 ƒ }1 |, j d* |1 i d+ d, 6ƒ }2 |, j |2 ƒ }3 t |3 ƒ \ }4 }5 d- | f d. |  f d/ |! f d0 |" f d1 |# f d2 |$ f d3 |% f d4 |& f d5 |' f d6 |( f d7 |4 f d8 |) f d# | f d9 |* f dB g }. g  |. D] }/ |/ d) d k	 rY|/ ^ qY}0 |+ j |0 ƒ }1 d; }6 |- j ƒ  }7 xô t	 r’|- j ƒ  }8 |7 |6 |8 }9 |9 d< k rå|- j
 |9 ƒ |8 |9 }7 n |8 }7 |, j d* |1 i d+ d, 6ƒ }2 |, j |2 ƒ }3 |3 j ƒ  }: |: j d= ƒ d< k  r;Pn  |: j d= ƒ }; |: j d> |; ƒ }< |: |; t d= ƒ |< !j ƒ  }= |= j ƒ  d? k rŸPqŸqŸWt j |: ƒ S(C   sH  Do a BLAST search using the QBLAST server at NCBI.

    Supports all parameters of the qblast API for Put and Get.
    Some useful parameters:
    program        blastn, blastp, blastx, tblastn, or tblastx (lower case)
    database       Which database to search against (e.g. "nr").
    sequence       The sequence to search.
    ncbi_gi        TRUE/FALSE whether to give 'gi' identifier.
    descriptions   Number of descriptions to show.  Def 500.
    alignments     Number of alignments to show.  Def 500.
    expect         An expect value cutoff.  Def 10.0.
    matrix_name    Specify an alt. matrix (PAM30, PAM70, BLOSUM80, BLOSUM45).
    filter         "none" turns off filtering.  Default no filtering
    format_type    "HTML", "Text", "ASN.1", or "XML".  Def. "XML".
    entrez_query   Entrez query to limit Blast search
    hitlist_size   Number of hits to return. Default 50

    This function does no checking of the validity of the parameters
    and passes the values to the server as is.  More help is available at:
    http://www.ncbi.nlm.nih.gov/BLAST/blast_overview.html

    iÿÿÿÿNt   blastnt   blastpt   blastxt   tblastnt   tblastxt   AUTO_FORMATt   COMPOSITION_BASED_STATISTICSt   DATABASEt   DB_GENETIC_CODEt	   ENDPOINTSt   ENTREZ_QUERYt   EXPECTt   FILTERt   GAPCOSTSt   GENETIC_CODEt   HITLIST_SIZEt   I_THRESHt   LAYOUTt
   LCASE_MASKt   MATRIX_NAMEt   NUCL_PENALTYt   NUCL_REWARDt   OTHER_ADVANCEDt
   PERC_IDENTt   PHI_PATTERNt   PROGRAMt   QUERYt
   QUERY_FILEt   QUERY_BELIEVE_DEFLINEt
   QUERY_FROMt   QUERY_TOt   SEARCHSP_EFFt   SERVICEt	   THRESHOLDt   UNGAPPED_ALIGNMENTt	   WORD_SIZEt   CMDt   Puti   s'   http://blast.ncbi.nlm.nih.gov/Blast.cgit   BiopythonClients
   User-Agentt
   ALIGNMENTSt   ALIGNMENT_VIEWt   DESCRIPTIONSt   ENTREZ_LINKS_NEW_WINDOWt
   EXPECT_LOWt   EXPECT_HIGHt   FORMAT_ENTREZ_QUERYt   FORMAT_OBJECTt   FORMAT_TYPEt   NCBI_GIR)   t   RESULTS_FILEt   SHOW_OVERVIEWt   Getg      @i    s   Status=s   
t   READY(   R   Rž   RŸ   R    R¡   (   RÁ   RÂ   (   RÁ   RÐ   (   t   urllibt   urllib2t   timet   AssertionErrort   Nonet	   urlencodet   Requestt   urlopent   _parse_qblast_ref_paget   Truet   sleept   readR1   t   indext   lenR.   t   uppert   StringIO(>   t   programRn   t   sequencet   auto_formatt   composition_based_statisticst   db_genetic_codet	   endpointst   entrez_queryt   expectt   filtert   gapcostst   genetic_codet   hitlist_sizet   i_thresht   layoutt
   lcase_maskt   matrix_namet   nucl_penaltyt   nucl_rewardt   other_advancedt
   perc_identt   phi_patternt
   query_filet   query_believe_deflinet
   query_fromt   query_tot   searchsp_efft   serviceR”   t   ungapped_alignmentt	   word_sizet
   alignmentst   alignment_viewt   descriptionst   entrez_links_new_windowt
   expect_lowt   expect_hight   format_entrez_queryt   format_objectt   format_typet   ncbi_git   results_filet   show_overviewRÒ   RÓ   RÔ   t
   parameterst   xRf   t   messaget   requestR   t   ridt   rtoet   delayt   previoust   currentt   waitt   resultst   it   jt   status(    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyt   qblast¦  s¢    %																																)																)		c         C   sS  |  j  ƒ  } | j d ƒ } | d k r0 d
 } n/ | j d | ƒ } | | t d ƒ | !j ƒ  } | j d ƒ } | d k rƒ d
 } n/ | j d | ƒ } | | t d ƒ | !j ƒ  } | rÏ | rÏ t d ƒ ‚ n> | sî t d t | ƒ ƒ ‚ n | st d t | ƒ ƒ ‚ n  y | t | ƒ f SWn+ t k
 rNt d d	 t | ƒ ƒ ‚ n Xd
 S(   sÛ   Extract a tuple of RID, RTOE from the 'please wait' page (PRIVATE).

    The NCBI FAQ pages use TOE for 'Time of Execution', so RTOE is proably
    'Request Time of Execution' and RID would be 'Request Identifier'.
    s   RID =iÿÿÿÿs   
s   RTOE =sd   No RID and no RTOE found in the 'please wait' page. (there was probably a problem with your request)s<   No RID found in the 'please wait' page. (although RTOE = %s)s<   No RTOE found in the 'please wait' page. (although RID = %s)s   A non-integer RTOE found in s   the 'please wait' page, %sN(   RÝ   R1   RÖ   Rß   R.   RH   t   reprt   int(   R   t   sR  R  R  R  (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyRÚ   3  s0    		(   R   R   t	   cStringIORá   t   ImportErrort   Bio.ParserSupportt   AbstractParserR   R   RÖ   R  RÚ   (    (    (    s„   /oak/stanford/groups/akundaje/marinovg/programs/biopython-1.50.tar.gz/biopython-1.50/build/lib.linux-x86_64-2.7/Bio/Blast/NCBIWWW.pyt   <module>   s0   
ÿ ÿ s							€