ó
šxTc           @   sý  d  d l  m Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 d  d l
 Z
 d  d l Z d  d l Z d  d l Z d  d l Z d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d	 e j f d
 „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e j f d „  ƒ  YZ d e f d „  ƒ  YZ e j ƒ  j e ƒ Z e j ƒ  j e ƒ Z  e j ƒ  j e ƒ Z! e j ƒ  j e ƒ Z" e j ƒ  j e ƒ Z# e j ƒ  j e ƒ Z$ e j ƒ  j e ƒ Z% e j ƒ  j e ƒ Z& e j ƒ  j e ƒ Z' e j ƒ  j e ƒ Z( e j ƒ  j e ƒ Z) e j ƒ  j e ƒ Z* e j+ e e  e! g ƒ Z, e- d k rùe j. d d ƒ j/ e, ƒ n  d S(   iÿÿÿÿ(   t   proxiesNt   TestDownloaderBasec           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   sI   t  j ƒ  |  _ d |  j _ d |  _ t j |  j ƒ |  _ i  |  j _ d  S(   Nt   encodings   Some random data(   R    t   DownloaderBaset
   downloadert   ENCODINGt   datat   StringIOt   data_streamt   headers(   t   self(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   setUp   s
    	c         C   s¢   d |  j  j t j j <|  j |  j j |  j  ƒ ƒ d |  j  j t j j <|  j |  j j |  j  ƒ ƒ |  j j |  j  j t j j <|  j |  j j |  j  ƒ ƒ d  S(   Nt    t   gzip(	   R   R	   R    t   SimpleDownloadert   STREAM_HEADERt   assert_R   t   handlesR   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   testHandles   s    c         C   sq   |  j  |  j j d  ƒ ƒ |  j  |  j j d ƒ ƒ |  j  |  j j d ƒ ƒ |  j  |  j j |  j j ƒ ƒ d  S(   NR   t   unknown(   R   R   t   interpretable_encodingt   NoneR   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   testInterpretableEncoding(   s    c         C   sK   t  j d ƒ } |  j j | ƒ |  j |  j j | j |  j j ƒ k ƒ d  S(   Ns   http://foo/bar(   t   urllib2t   RequestR   t   enable_encodingR   R   t
   get_headert   REQUEST_HEADER(   R
   t   request(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   testEnableEcoding0   s
    (   t   __name__t
   __module__R   R   R   R   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR      s   	
		t   TestSimpleDownloaderc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s=   d |  _  t j |  j  ƒ |  _ i  |  j _ t j ƒ  |  _ d  S(   Ns   Some random data(   R   R   R   R	   R    R   R   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR   =   s    	c         C   sP   |  j  |  j j d ƒ ƒ |  j  |  j j d ƒ ƒ |  j  |  j j d ƒ ƒ d  S(   NR   t   identityR   (   R   R   R   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR   E   s    c         C   s&   |  j  |  j j |  j ƒ |  j ƒ d  S(   N(   t   assertEqualR   t   fetchR   R   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt	   testFetchL   s    (   R   R   R   R   R$   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR    ;   s   		t   TestGzipDownloaderc           B   s   e  Z d  „  Z d „  Z RS(   c         C   sˆ   d |  _  t j ƒ  } t j d | d d ƒ } | j |  j  ƒ | j ƒ  t j | j ƒ  ƒ |  _ i  |  j _ t	 j
 ƒ  |  _ | j ƒ  d  S(   Ns   Some random datat   fileobjt   modet   wb(   R   R   R   t   GzipFilet   writet   closet   getvalueR   R	   R    t   GzipDownloaderR   (   R
   t   compressed_datat   compressor_stream(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR   S   s    	
c         C   sN   |  j  |  j j |  j ƒ |  j ƒ |  j t j |  j j t j |  j ƒ ƒ d  S(   N(	   R"   R   R#   R   R   t   assertRaisesR    t   ProxyExceptionR   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR$   `   s
    "	(   R   R   R   R$   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR%   Q   s   	t   TestHTTPIntefacec           B   s   e  Z d  „  Z d „  Z RS(   c         C   s]   t  j ƒ  } |  j | j d d ƒ ƒ |  j | j d d ƒ ƒ |  j | j d d ƒ ƒ d  S(   Nt   urls#   http://dolphin/nightly_builds/indexs   http://foo/bars   http://dolphin/bar(   R    t   HTTPInterfaceR   t   resource_online(   R
   t   http_interface(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   testResourceOnlinel   s    
c         C   sŠ   t  j ƒ  } i d d 6i d d 6d d 6d 6} | j | ƒ } |  j d | k ƒ |  j d	 | k ƒ d
 | d <|  j t  j | j | ƒ d  S(   Ns'   http://dolphin/nightly_builds/build_logR3   s   perch-defaultt   platforms   build-2009-03-27t   idR   s   Python: 2.5.1 "/usr/bin/python"s   scons: done building targets.s   http://dolphin/foo(   R    R4   t	   http_callR   R0   R1   (   R
   R6   R   R   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   testHTTPCall{   s    
(   R   R   R7   R;   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR2   j   s   	t   TestOCAHTTPc           B   s/   e  Z d  Z d Z d „  Z d „  Z d „  Z RS(   sB  <title>Sequence for 3adk</title>
<pre>>3adk_  mol:protein-het length:195     Adenylate Kinase (E.C. 2.7.4.3) - Chain 
XMEEKLKKSKIIFVVGGPGSGKGTQCEKIVQKYGYTHLSTGDLLRAEVSSGSARGKMLSEIMEKGQLVPLETVLD
MLRDAMVAKVDTSKGFLIDGYPREVKQGEEFERKIGQPTLLLYVDAGPETMTKRLLKRGETSGRVDDNEETIKKR
LETYYKATEPVIAFYEKRGIVRKVNAEGSVDDVFSQVCTHLDTLK
</pre>c         C   s   |  j  s t j ƒ  |  _  n  d  S(   N(   t   ocaR    t   OCAHTTP(   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR   �   s    	c         C   s   |  j  t |  j ƒ d ƒ d  S(   Ns   OCA service at EBI(   R"   t   strR=   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   testName£   s    c         C   sg   |  j  |  j j d d ƒ |  j ƒ |  j  |  j j d d ƒ |  j ƒ |  j  |  j j d d ƒ d ƒ d  S(   Nt
   identifiert   3ADKt   3adKt   4BZQs,   <title>Sequence for 4bzq</title>
<pre></pre>(   R"   R=   R#   t   SEQUENCE_3ADK(   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   testRetrieve¨   s    

N(   R   R   RE   R   R=   R   R@   RF   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR<   ’   s
   		t   TestDbfetchHTTPc           B   s2   e  Z d Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s   |  j  s t j ƒ  |  _  n  d  S(   N(   t   dbfetchR    t   DbfetchHTTP(   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR   ½   s    	c         C   s   |  j  t |  j ƒ d ƒ d  S(   Ns   Dbfetch service at EBI(   R"   R?   RH   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR@   Ã   s    c         C   sg   |  j  j d d ƒ } |  j | ƒ |  j  j d d ƒ } |  j | ƒ |  j |  j  j d d ƒ d ƒ d  S(   NRA   RB   RC   RD   s   No entries found. 
(   RH   R#   t	   checkDataR"   (   R
   R   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyRF   È   s    c         C   sã   t  j j d | d d ƒ j ƒ  } |  j t | j ƒ  ƒ d ƒ |  j t | j ƒ  d j ƒ  ƒ d ƒ |  j t | j ƒ  d j ƒ  d j ƒ  ƒ d ƒ |  j t | j ƒ  d j ƒ  d j ƒ  ƒ d ƒ |  j t | j	 ƒ  ƒ d ƒ d  S(	   Nt   linest   source_infot   PDBi   i    i   iÃ   iù  (
   t   iotbxt   pdbt   inputt   construct_hierarchyR"   t   lent   modelst   chainst   residue_groupst   atoms(   R
   R   t	   hierarchy(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyRJ   Ö   s    !&##N(   R   R   R   RH   R   R@   RF   RJ   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyRG   ¹   s
   			t   TestRCSBHTTPc           B   s8   e  Z d  Z d Z d „  Z d „  Z d „  Z d „  Z RS(   sã   >3ADK:A|PDBID|CHAIN|SEQUENCE
XMEEKLKKSKIIFVVGGPGSGKGTQCEKIVQKYGYTHLSTGDLLRAEVSSGSARGKMLSEIMEKGQLVPLETVLDMLRDA
MVAKVDTSKGFLIDGYPREVKQGEEFERKIGQPTLLLYVDAGPETMTKRLLKRGETSGRVDDNEETIKKRLETYYKATEP
VIAFYEKRGIVRKVNAEGSVDDVFSQVCTHLDTLK
c         C   s   |  j  s t j ƒ  |  _  n  d  S(   N(   RO   R    t   RCSBHTTP(   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR   ñ   s    	c         C   s   |  j  t |  j ƒ d ƒ d  S(   Ns   PDB service at RCSB(   R"   R?   RO   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR@   ÷   s    c         C   sá   |  j  j d d d t ƒ } |  j | ƒ |  j  j d d d t ƒ } t j d t j | ƒ ƒ j ƒ  } |  j | ƒ |  j	 |  j  j d d d d ƒ |  j
 ƒ |  j	 |  j  j d d d d ƒ |  j
 ƒ |  j t j |  j  j d	 ƒ d  S(
   NRA   RB   t   compressionRC   R&   t   formatt   fastat   FASTARD   (   RO   R#   t   FalseRJ   t   TrueR   R)   R   t   readR"   RE   R0   R    R1   (   R
   R   t   uncompressed(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyRF   ü   s    !

	c         C   sã   t  j j d | d d ƒ j ƒ  } |  j t | j ƒ  ƒ d ƒ |  j t | j ƒ  d j ƒ  ƒ d ƒ |  j t | j ƒ  d j ƒ  d j ƒ  ƒ d ƒ |  j t | j ƒ  d j ƒ  d j ƒ  ƒ d ƒ |  j t | j	 ƒ  ƒ d ƒ d  S(	   NRK   RL   RM   i   i    i   iÃ   iù  (
   RN   RO   RP   RQ   R"   RR   RS   RT   RU   RV   (   R
   R   RW   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyRJ     s    !&##N(	   R   R   RE   R   RO   R   R@   RF   RJ   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyRX   ç   s   			t   TestNCBIBlastHTTPc           B   sG   e  Z d Z d Z d  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(   sã   >3ADK:A|PDBID|CHAIN|SEQUENCE
XMEEKLKKSKIIFVVGGPGSGKGTQCEKIVQKYGYTHLSTGDLLRAEVSSGSARGKMLSEIMEKGQLVPLETVLDMLRDA
MVAKVDTSKGFLIDGYPREVKQGEEFERKIGQPTLLLYVDAGPETMTKRLLKRGETSGRVDDNEETIKKRLETYYKATEP
VIAFYEKRGIVRKVNAEGSVDDVFSQVCTHLDTLK
c         C   s„   |  j  s t j ƒ  |  _  n  |  j s€ |  j  j d d d d d |  j ƒ |  _ x2 |  j  j d |  j ƒ d k r| t j d ƒ qN Wn  d  S(	   Nt   programt   blastpt   databaseRO   t   queryt   ridt   READYi   (	   t   ncbiR    t   NCBIBlastHTTPRg   t   putRE   t   statust   timet   sleep(   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR   0  s    		!c         C   s   |  j  t |  j ƒ d ƒ d  S(   Ns   BLAST service at NCBI(   R"   R?   Ri   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR@   @  s    c      	   C   s2   |  j  t j |  j j d d d d d |  j ƒd  S(   NRc   t   blastfRe   RO   Rf   (   R0   R    R1   Ri   Rk   RE   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   testPutE  s    c         C   s¡   |  j  j d |  j d d ƒ } t j j j | ƒ } | j d ƒ } |  j | d  k	 ƒ |  j
 | j d ƒ | j d ƒ } |  j | d  k	 ƒ |  j
 | j d ƒ d  S(   NRg   t   format_typet   XMLt   BlastOutput_programRd   t   BlastOutput_dbRO   (   Ri   t   getRg   t   xmlt   etreet   ElementTreet
   fromstringt   findR   R   R"   t   text(   R
   R   t   rootRc   t   db(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   testGetP  s    		c         C   s&   |  j  |  j j d |  j ƒ d ƒ d  S(   NRg   Rh   (   R"   Ri   Rl   Rg   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt
   testStatusa  s    N(   R   R   R   Ri   Rg   RE   R   R@   Rp   R~   R   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyRb   %  s   				t   TestNCBIBlastStandalonec           B   s>   e  Z d Z d Z d  Z d „  Z d „  Z d „  Z d „  Z	 RS(   sã   >3ADK:A|PDBID|CHAIN|SEQUENCE
XMEEKLKKSKIIFVVGGPGSGKGTQCEKIVQKYGYTHLSTGDLLRAEVSSGSARGKMLSEIMEKGQLVPLETVLDMLRDA
MVAKVDTSKGFLIDGYPREVKQGEEFERKIGQPTLLLYVDAGPETMTKRLLKRGETSGRVDDNEETIKKRLETYYKATEP
VIAFYEKRGIVRKVNAEGSVDDVFSQVCTHLDTLK
c         C   sX   |  j  s! t j d d
 ƒ |  _  n  |  j sT |  j  j d d d d d	 |  j ƒ |  _ n  d  S(   Nt   command_lines   /usr/bin/ssht   ulyssess$   /srs/blast/blast-2.2.20/bin/blastallRc   Rd   Re   s   /srs/srs/data/blast/pdbaaRf   (   s   /usr/bin/sshR‚   s$   /srs/blast/blast-2.2.20/bin/blastall(   t   blastR    t   NCBIBlastStandalonet   jobidt   submitRE   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR   q  s    			c         C   s   |  j  t |  j ƒ d ƒ d  S(   Ns   BLAST standalone executable(   R"   R?   Rƒ   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR@   ‚  s    c         C   s›   |  j  j d |  j ƒ } t j j j | ƒ } | j d ƒ } |  j | d  k	 ƒ |  j
 | j d ƒ | j d ƒ } |  j | d  k	 ƒ |  j
 | j d ƒ d  S(   NR…   Rs   Rd   Rt   s   /srs/srs/data/blast/pdbaa(   Rƒ   t   resultsR…   Rv   Rw   Rx   Ry   Rz   R   R   R"   R{   (   R
   R   R|   Rc   R}   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR~   ‡  s    c         C   s&   |  j  |  j j d |  j ƒ d ƒ d  S(   NR…   t   FINISHED(   R"   Rƒ   Rl   R…   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR   •  s    N(
   R   R   R   Rƒ   R…   RE   R   R@   R~   R   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR€   f  s   			t   TestClustalWLocalc           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   s1   t  j ƒ  |  _ t j d |  j d d ƒ |  _ d  S(   Nt   job_data_dirt
   executables:   /xtal/crystal/ccp4/ccp4-6.1.1/clustalw-2.0.9/bin/clustalw2(   t   tempfilet   mkdtempRŠ   R    t   ClustalWLocalt	   clustalw2(   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR   œ  s    		c         C   sV   x' |  j  j ƒ  D] } |  j  j | ƒ q Wt j j |  j ƒ rR t j |  j ƒ n  d  S(   N(   R�   t   existing_jobst   cleanupt   ost   patht   existsRŠ   t   rmdir(   R
   R…   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   tearDown¥  s    c         C   sU   |  j  t j t j |  j d ƒ t j ƒ  } t j | ƒ |  j  t j t j | ƒ d  S(   Nt   clustalx(	   R0   R    R1   RŽ   RŠ   RŒ   R�   R’   R•   (   R
   t   non_existent_dir(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt
   testCreate®  s    c         C   sy  d } d d d d d d d d	 d
 d } d } |  j  j d | ƒ } |  j |  j  j d | ƒ d k ƒ x, |  j  j d | ƒ d k r› t j d ƒ qp W|  j |  j  j d | ƒ d ƒ |  j |  j  j d | ƒ | ƒ |  j |  j  j d | ƒ j	 | ƒ d k ƒ |  j  j
 d | ƒ |  j |  j  j d | ƒ d ƒ |  j |  j  j d | ƒ d ƒ |  j |  j  j d | ƒ d ƒ d  S(   Ns  >1vkk
VVCEVDPELKETLRKFRFRKETNNAAIIMKVDKDRQMVVLEDELQNISPEELKLELPERQPRFVVYSYKYV
HDDGRVSYPLCFIFSSPVGCKPEQQMMYAGSKNRLVQTAELTKVFEIRTTDDLTETWLKEKLAFFR

>1ahq
GIAVSDDCVQKFNELKLGHQHRYVTFKMNASNTEVVVEHVGGPNATYEDFKSQLPERDCRYAIFDYEFQVD
GGQRNKITFILWAPDSAPIKSKMMYTSTKDSIKKKLVGIQVEVQATDAAEISEDAVSERAKK
s;   CLUSTAL 2.0.9 multiple sequence alignment


1vkk           s?    VVCEVDPELKETLRKFRFRKETNNAAIIMKVDKDRQMVVLEDELQNISPEELKLELPERQ
1s@   ahq            -GIAVSDDCVQKFNELKLGHQHRYVTFKMNAS-NTEVVVEHVGGPNATYs?   EDFKSQLPERD
                    *. :  :.:.:::: :: . .:: *:.. : s>   ::** .    * : *::* :****:

1vkk            PRFVVYSYKYVHDDGRVSYs?   PLCFIFSSPVGCKPEQQMMYAGSKNRLVQT-AELTKVFEIR
1ahq            CRYAIs?   FDYEFQVDGGQRNK-ITFILWAPDSAPIKSKMMYTSTKDSIKKKLVGIQVEVQAT
       s@             *:.::.*::  *.*: .  : **: :* ..  :.:***:.:*: : :. . :  s=    .:  

1vkk            TTDDLTETWLKEKLAFFR
1ahq            DAAs3   EISEDAVSERAKK--
                 : :::*  :.*:     
s*   CLUSTAL 2.0.9 Multiple Sequence Alignmentst	   sequencesR…   t   RUNNINGRˆ   i   iÿÿÿÿt   UNKNOWNR   (   R›   s   FINISHED(   R�   t   runR   Rl   Rm   Rn   R"   t	   fetch_alnt	   fetch_logRz   R‘   (   R
   Rš   t   alnt   titleR…   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   testRun¿  s     	*%(   R   R   R   R–   R™   R¢   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR‰   š  s   					t   TestPhaserMultiprocessingc           B   sb   e  Z d
 Z d  „  Z d „  Z d „  Z d „  Z d d „ Z d „  Z	 d „  Z
 d „  Z d	 „  Z RS(   c         C   s�   t  j j d t j j d d ƒ ƒ |  _ t  j j d t j j d d ƒ ƒ |  _ t  j j d t j j d d ƒ ƒ |  _ |  j	 s‹ |  j
 ƒ  n  d  S(   Nt   phasert   tutorials
   1D0D_B.pdbs   1BIK.pdbs   toxd.mtz(   t   libtbxt   envt
   under_distR’   R“   t   joint   model1_filet   model2_filet   hkl_fileR¤   t   create_proxy(   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR   ï  s    				c         C   s=   |  j  r9 x- |  j  j ƒ  D] } |  j  j d | ƒ q Wn  d  S(   Nt   job_name(   R¤   R�   R‘   (   R
   R®   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR–     s    	c         C   s   t  j ƒ  |  _ d  S(   N(   R    t   PhaserMultiprocessingR¤   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR­   
  s    c         C   sO  |  j  j d |  j d d d d ƒ } |  j d | g ƒ |  j  j d | ƒ } |  j t | ƒ d ƒ | \ } } } } } } |  j | ƒ |  j t | ƒ d	 ƒ |  j t | ƒ d	 ƒ |  j t | ƒ d	 ƒ |  j | d
 ƒ xB t | d d d d d d g ƒ D] \ }	 }
 |  j	 |	 |
 d ƒ qû W| |  _
 | |  _ | |  _ | |  _ | |  _ d  S(   NR¬   t   fp_labelt   FTOXD3t   sigfp_labelt	   SIGFTOXD3t   jobsR®   i   iY  s
   P 21 21 21g…ëQ¸eR@g=
×£p]C@gq=
×£07@g     €V@i   (   R¤   t   submit_mr_dat_jobR¬   t   wait_for_jobs_to_finishR‡   R   RR   R"   t   zipt   assertAlmostEqualt   hklt   fpt   sigfpt   space_groupt	   unit_cell(   R
   R®   t   resultt   successR¹   Rº   R»   R¼   R½   t   obst   exp(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   load_reflection_data  s(    		.				i   c         C   sz   |  j  j d |  j d |  j d |  j d |  j d |  j d d d i |  j d	 f |  j d
 f g d 6d d g d d d | ƒ 
S(   NR¹   Rº   R»   R¼   R½   t
   asu_weightiã  t
   models_forg²�ï§ÆK×?gTã¥›Ä Ø?t   toxdt   search_ensemblesi   t   high_resolutiong      @R´   (   RÅ   i   (	   R¤   t   submit_mr_auto_jobR¹   Rº   R»   R¼   R½   Rª   R«   (   R
   R´   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   start_mr_auto_job.  s    					"	c         C   s�   |  j  |  j j d | ƒ |  j j ƒ |  j j d | ƒ } |  j  t | ƒ d ƒ |  j | d ƒ |  j t | d t j ƒ ƒ |  j  | d d j	 d ƒ d  S(   NR®   i   i    i   s%    RFZ=3.7 TFZ=7.4 PAK=0 LLG=63 LLG=113(
   R"   R¤   Rl   t   STATUS_FINISHEDR‡   RR   R   t
   isinstancet   mr_solutiont
   ANNOTATION(   R
   R®   R¾   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt!   compare_job_results_with_expected@  s    c         C   sa   |  j  |  j j d | ƒ |  j j ƒ |  j j d | ƒ |  j  |  j j d | ƒ |  j j ƒ d  S(   NR®   (   R"   R¤   Rl   RÊ   R‘   t   STATUS_UNKNOWN(   R
   R®   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   cleanup_changes_statusP  s    c         C   s    xK | D]C } |  j  |  j j d | ƒ |  j j |  j j |  j j g k ƒ q WxK t g  | D]' } |  j j d | ƒ |  j j k ^ q[ ƒ r› t j d ƒ qQ Wd  S(   NR®   i   (	   R   R¤   Rl   t   STATUS_RUNNINGRÊ   RÏ   t   anyRm   Rn   (   R
   R´   R®   t   j(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR¶   ]  s    		4c         C   sÄ   |  j  ƒ  |  j ƒ  } |  j d | g ƒ |  j d | ƒ |  j d | ƒ |  j ƒ  } |  j ƒ  } |  j ƒ  } |  j d | | | g ƒ x7 | | | g D]& } |  j d | ƒ |  j d | ƒ q– Wd  S(   NR´   R®   (   RÂ   RÉ   R¶   RÎ   RÐ   (   R
   R®   t   job1t   job2t   job3(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR¢   o  s    
N(   R   R   R   R¤   R   R–   R­   RÂ   RÉ   RÎ   RÐ   R¶   R¢   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR£   ë  s   							t   TestPhaserOpenMPc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   t  j ƒ  |  _ d  S(   N(   R    t   PhaserOpenMPR¤   (   R
   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR­   …  s    c         C   s’   |  j  ƒ  |  j ƒ  } |  j d | g ƒ |  j d | ƒ |  j d | ƒ |  j d d ƒ } |  j d | g ƒ |  j d | ƒ |  j d | ƒ d  S(   NR´   R®   i   (   RÂ   RÉ   R¶   RÎ   RÐ   (   R
   R®   t   job_more_cpu(    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR¢   Š  s    
(   R   R   R­   R¢   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyR×   ƒ  s   	t   __main__t	   verbosityi   (0   t   phaser.pipelineR    R¤   t	   iotbx.pdbRN   t   libtbx.load_envR¦   t   unittestRŒ   R   R   R   Rm   t   xml.etree.ElementTreeRv   R’   t   TestCaseR   R    R%   R2   R<   RG   RX   Rb   R€   R‰   R£   R×   t
   TestLoadert   loadTestsFromTestCaset   suite_downloader_baset   suite_simple_downloadert   suite_gzip_downloadert   suite_http_intefacet   suite_oca_httpt   suite_dbfetch_httpt   suite_rcsb_httpt   suite_ncbi_blast_httpt   suite_ncbi_blast_standalonet   suite_clustalw_localt   suite_phaser_multiprocessingt   suite_phaser_openmpt	   TestSuitet   alltestsR   t   TextTestRunnerR�   (    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/tst_proxies.pyt   <module>   sj   +('.>A4Q˜												