ó
šxTc           @   s  d  d l  m Z d  d l  m Z d  d l  m Z d  d l  m Z d  d l  m Z d  d l  m Z d  d l  m Z d  d l m	 Z	 d  d	 l
 m Z d  d
 l
 Z
 d  d
 l Z d  d
 l Z d
 d „ Z g  d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z e d k re ƒ  n  d
 S(   iÿÿÿÿ(   t	   phaser_ai(   t   knowledge_sources(   t   process_model(   t   openbba(   t   event(   t   strategy(   t   engine(   t   analyser(   t   pickle_supportNc         C   si  t  j ƒ  } | j |  ƒ | j | | ƒ | j t ƒ | rL | j | ƒ n  t  j | ƒ } | j ƒ  rs t	 | ‚ n  t  j
 ƒ  } | j | j ƒ  | j ƒ  | j ƒ  ƒ | j | j ƒ  ƒ | j | j ƒ  ƒ | j t ƒ | j t ƒ t  j | ƒ } | j ƒ  rt	 | ‚ n  t j d | j ƒ  d | j ƒ  d | j ƒ  ƒ } t j d | j ƒ  d | j ƒ  ƒ } | | f S(   Nt   millert   fpt   sigfpt   space_group_hallt	   unit_cell(   t   phasert   InputMR_DATt   setHKLIt   setLABIt   setMUTEt   Truet   setHIRESt	   runMR_DATt   Failedt	   Exceptiont   InputANOt   setREFLt	   getMillert   getFt   getSIGFt   setCELL6t   getUnitCellt   setSPAC_HALLt   getSpaceGroupHallt   setHKLOt   Falset   runANOR   t   XrayDatat   getCorrectedFt   getCorrectedSIGFt   Symmetry(   t	   file_nameR
   R   t   hirest   inpt   resultt	   xray_datat   symmetry(    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyt	   read_data   s4    %		c      	   C   sU   t  j d t j d |  ƒ g d t j d | ƒ t j ƒ  t j d | ƒ t j ƒ  g ƒ S(   Nt
   initiatorst   mr_set_selection_strategyt
   processorst   optional_analysersR   (   R    t
   ControllerR   t   ExtensionStanceFindt   ExtensionResultAnalyset   ExtensionCalculationProcesst   ExtensionCalculationExecutet    RegularExtensionCalculationSetup(   t   selection_strategyR   t	   analysers(    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyt   get_mr_solver9   s    				c         C   s@   t  j d t  j j ƒ  ƒ } x |  D] } | j d | ƒ q" W| S(   Nt   memoryt
   blackboard(   R   t
   BlackboardR<   t	   Transientt	   attach_to(   t   startup_objectsR=   t   bbobj(    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyt   setup_solution_blackboardL   s    c        	   C   sp   t  j d t j d d „  d t j ƒ t  j d t j d d „  d t j ƒ t  j d t j d d „  d t j ƒ g S(   Nt
   event_typet   displayc         S   s
   t  |  ƒ S(   N(   t   str(   R   (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyt   <lambda>[   s    t   streamc         S   s
   t  |  ƒ S(   N(   RF   (   R   (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyRG   `   s    c         S   s
   t  |  ƒ S(   N(   RF   (   R   (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyRG   e   s    (   R    t   StreamLoggerR   t   Messaget   syst   stdoutt   CalculationCompleteR3   (    (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyt   get_loggersV   s    											c          C   sÉ  d }  t  j j |  d ƒ } d } t  j j |  d ƒ } t | d d d ƒ \ } } t j d d	 d
 d ƒ } t j j d | g ƒ } t j j	 d | d d ƒ } t j
 d | d | g d d ƒ }	 t j j	 d | d d ƒ }
 t j
 d | d |
 g d d ƒ } t j d | d | d | ƒ } t d t j j ƒ  d t j ƒ  d t j ƒ  t j ƒ  g ƒ } t j ƒ  } t j ƒ  } t ƒ  } t d | | |	 | | | g ƒ } x | D] } | j | ƒ qžW| j d | ƒ d  S(   Ns*   /home/gaborb/workspace/phaser/src/tutorials   iod_scala-unique.mtzs(   /home/gaborb/data/lyso2001/193l_prot.pdbs   1fkq_prot.pdbt   F_Newt   SIGF_Newg      @t   sequencet<   KVFGRCELAAAMKRHGLDNYRGYSLGNWVCAAKFESNFNTQATNRNTDGSTDYGILQINSt<   RWWCNDGRTPGSRNLCNIPCSALLSSDITASVNCAKKIVSDGNGMNAWVAWRNRCKGTDVt	   QAWIRGCRLt
   componentst   pdb_filet   valuegÍÌÌÌÌÌì?t	   componentt   modelst   scoregÍÌÌÌÌÌÜ?R,   R-   t   compositionR9   R   R:   RA   R=   (   t   ost   patht   joinR.   R   t	   Componentt   Compositiont   FromComponentst   MRModelt   Identityt
   MREnsemblet	   MRProblemR;   R   t   mr_sett   LocalTopR   t   MultiprocessingR   t   SolutionIdentifyt   SearchThreadTerminatet   CPURN   RC   t   registert   run(   t   roott   mtz_filet	   pdb_file1t	   pdb_file2R,   R-   RX   R[   t	   mr_model1t   mr_ensemble1t	   mr_model2t   mr_ensemble2t   problemt   solvert   cpu1t   cpu2t   loggersR=   t   logger(    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyt   lysozymel   sF    											c          C   s�  d }  t  j j |  d ƒ } t  j j |  d ƒ } t | d d ƒ \ } } t j d d d ƒ } t j j d	 | g d
 ƒ } t j j	 d | d d ƒ } t j
 d | d | g d d ƒ } t j d | d | d | ƒ }	 t d t j j ƒ  d t j ƒ  d t j ƒ  t j ƒ  g ƒ }
 t j ƒ  } t j ƒ  } t ƒ  } t d |	 | | | | g ƒ } x | D] } | j | ƒ qVW|
 j d | ƒ d  S(   Ns*   /home/gaborb/workspace/phaser/src/tutorials   A31P_3A.mtzs	   helix.pdbt   FPt   SIGFPRQ   t   Ai   RU   i   RV   RW   g      ð?RX   RY   RZ   gÍÌÌÌÌÌÜ?R,   R-   R[   R9   R   R:   RA   R=   (   R\   R]   R^   R.   R   R_   R`   Ra   Rb   t   RmsRd   Re   R;   R   Rf   t   FrozenGlobalTopR   Rh   R   Ri   Rj   Rk   RN   RC   Rl   Rm   (   Rn   Ro   RV   R,   R-   RX   R[   t   mr_modelt   mr_ensembleRv   Rw   Rx   Ry   Rz   R=   R{   (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyt   a31p¡   s:    								c       	   C   sq  d }  t  j j |  d ƒ } t  j j |  d ƒ } t | d d ƒ \ } } t j d d ƒ } t j j d | g d	 ƒ } t j j	 d
 | d d ƒ } t j
 d | d | g d d ƒ } t j d | d | d | ƒ }	 t d t j j ƒ  d t j ƒ  d t j ƒ  t j ƒ  t j ƒ  g ƒ }
 t ƒ  } t d |	 | | t j ƒ  g ƒ } x | D] } | j | ƒ qFW|
 j d | ƒ d  S(   Ns   /home/gaborb/data/slt_is   1bos.mtzs   monomer.pdbt   FOBS_Xt	   SIGFOBS_XRQ   tE   TPDCVTGKVEYTKYNDDDTFTVKVGDKELFTNRWNLQSLLLSAQITGMTVTIKTNACHNGGGFSEVIFRRU   i   RV   RW   gš™™™™™é?RX   RY   RZ   gÍÌÌÌÌÌÜ?R,   R-   R[   R9   R   R:   RA   R=   (   R\   R]   R^   R.   R   R_   R`   Ra   Rb   R€   Rd   Re   R;   R   Rf   t   DynamicGlobalTopR   t   RealtimeR   Ri   t   CombinatorialExtensiont   SpeculativeCalculationAssessRN   RC   Rk   Rl   Rm   (   Rn   Ro   RV   R,   R-   RX   R[   R‚   Rƒ   Rv   Rw   Rz   R=   R{   (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyt   slt_iÌ   s8    										c          C   sß  d }  t  j j |  d ƒ } t  j j |  d ƒ } t  j j |  d ƒ } t | d d ƒ \ } } t j d d d	 d
 d ƒ } t j d d d	 d	 d ƒ } t j j d | g d | g d ƒ } t j j	 d | d d ƒ }	 t j j	 d | d d ƒ }
 t j
 d | d |	 g d d ƒ } t j
 d | d |
 g d d ƒ } t j d | d | d | ƒ } t d t j j ƒ  d t j ƒ  t j ƒ  g ƒ } t ƒ  } t d | | | | | g ƒ } x | D] } | j | ƒ q´W| j d | ƒ d  S(   Ns   /home/gaborb/data/proteosome/s	   scale.mtzs	   alpha.pdbs   beta.pdbt   scalet   SIGscaleRQ   t9   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAt@   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAt@   AAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAt$   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAt   AAAAAAAAAAAAAAAAAARU   i   RV   RW   g      ð?RX   RY   RZ   gÍÌÌÌÌÌÜ?gš™™™™™á?R,   R-   R[   t   job_setup_strategyt   additional_actorsRA   R=   (   R\   R]   R^   R.   R   R_   R`   Ra   Rb   R€   Rd   Re   R;   R   Rf   t	   GlobalTopt   actorsRi   Rj   RN   RC   Rl   Rm   (   Rn   Ro   t	   pdb_alphat   pdb_betaR,   R-   t
   component1t
   component2R[   t   mr_model_alphat   mr_model_betat   mr_ensemble_alphat   mr_ensemble_betaRv   Rw   Rz   R=   R{   (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyt
   proteosomeö   sJ    												t   __main__(   t   phaser.pipelineR    R   R   R   R   R   R   t   phaser.pipeline.componentR   R   R   RK   t   os.pathR\   t   NoneR.   R;   RC   RN   R|   R„   RŒ   R    t   __name__(    (    (    sG   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/test_jobs.pyt   <module>   s*   (	
		5	+	*	>