ó
šxTc           @€  sW  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 m Z d  d l Z d  d l m Z d  d l m Z d  d l m Z m Z m Z d  d l Z d  d l Z d  d l Z d Z d Z d „  Z d „  Z d „  Z d e _ d „  Z  d e  _ i e d 6e  d 6Z! d „  Z" d e" _ d „  Z# d e# _ d „  Z$ d „  Z% d e% _ d  „  Z& d! e& _ d" „  Z' d# e' _ i e" d 6e# d 6e% d$ 6e& d% 6e' d& 6Z( d' „  Z) d( e) _ d) „  Z* d* e* _ d+ „  Z+ d, e+ _ i e) d( 6e* d* 6e+ d, 6Z, d- „  Z- d( e- _ d. „  Z. d* e. _ d/ „  Z/ d, e/ _ i e- d( 6e. d* 6e/ d, 6Z0 d0 „  Z1 d1 „  Z2 i e1 d2 6e2 d3 6Z3 i e j4 j5 d4 6e j4 j6 d5 6e j4 j7 d6 6Z8 d7 „  Z9 d8 „  Z: d9 „  Z; i e9 d: 6e; d; 6e: d< 6Z< e j= j> d= i
 e	 j? d> e( d: d ƒ d? 6d@ j@ dA „  e( jA ƒ  Dƒ ƒ dB 6e	 j? d> e8 d: d4 ƒ dC 6e	 j? d> e3 d: d2 ƒ dD 6e	 j? d> e! d: eB ƒ dE 6d@ j@ dF „  e! jA ƒ  Dƒ ƒ dG 6e	 j? d> e jC ƒ  d: dH ƒ dI 6e	 j? d> e, d: d( ƒ dJ 6e	 j? d> e0 d: d* ƒ dK 6e	 j? d> e< d: d: ƒ dL 6dM eD ƒZE dN „  ZF dO „  ZG dP „  ZH dQ „  ZI dR „  ZJ dS „  ZK dT „  ZL dU „  ZM dV „  ZN dW „  ZO dX „  ZP dY „  ZQ dZ „  ZR d[ „  ZS d\ „  ZT d] „  ZU d^ „  ZV d_ „  ZW d` eD da „ ZX eS db „ ZY dc „  ZZ dd „  Z[ de „  Z\ df „  Z] dg e j^ f dh „  ƒ  YZ_ di e` f dj „  ƒ  YZa d S(k   iÿÿÿÿ(   t   with_statement(   t	   mr_object(   t   engine(   t   expert(   t	   phaser_ai(   t   style(   t	   tbx_utils(   t   output(   t   cli(   t   sculptorN(   t   runtime_utils(   t   easy_pickle(   t   Sorryt   Usaget   null_outt   MRages   0.1.0c   
      €  s�  ˆ  j  j d ƒ rg d d l m } ˆ  j ƒ  } y | j d | ƒ } Wn t k
 rb } t | ‚ n X| Sˆ  j  j d ƒ rÿ d d l m	 } d d l m
 } | | g } xÌ | D]C } y | j d ˆ  ƒ } Wn# t k
 rí } ˆ  j d	 ƒ q¬ n X| SWt d
 ‚ nu t ‡  f d †  d d d d d d g Dƒ ƒ rtd d l m }	 y |	 j d ˆ  ƒ } Wn t k
 rot d ‚ n X| St d ‚ d  S(   Ns   .hhriÿÿÿÿ(   t   bioinformaticsR   s   .xml(   t   ncbi_blast_xml(   t   ebi_wu_blast_xmlt   sourcei    s+   No XML parser was able to process this filec         3€  s!   |  ] } ˆ  j  j | ƒ Vq d  S(   N(   t   namet   endswith(   t   .0t   ext(   t   file_object(    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>=   s    s   .pirs   .alns   .clustals   .fastas   .fas   .ali(   t   alignment_as_hsearchs1   No alignment parser was able to process this files   Unknown homology search file(   R   R   t   iotbxR   t   readt   hhsearch_parsert
   ValueErrorR   t   iotbx.bioinformaticsR   R   t   parset   SyntaxErrort   seekt   anyR   t   RuntimeError(
   R   R   t   datat   resultt   eR   R   t   parse_modulest   pmR   (    (   R   sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   read_homology_search_file   s<    c         C€  s    t  j j t  j j |  ƒ ƒ d S(   Ni    (   t   ost   patht   splitextt   basename(   t	   file_name(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   convert_to_file_rootN   s    c   	      C€  s¯   d d l  m } d | } | j d d ƒ | j d |  j d | ƒ } | j d d | ƒ d d	 l m } | j ƒ  } y | d
 | ƒ } Wn t k
 r¤ t	 d ‚ n X| | f S(   Niÿÿÿÿ(   t   fetchs   ncbi_blast_%s.xmlt   msgs   Starting BLAST search at NCBIt   sequenceR.   s   Search results saved in %s(   t   homologyR$   s!   Invalid BLAST XML format received(
   t	   iotbx.pdbR0   t   infot   get_ncbi_pdb_blastR2   t   phaser.pipelineR3   t   get_ncbi_blast_parserR    R   (	   R2   R   t   loggerR0   R.   R$   R3   t   parserR%   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   perform_ncbi_homology_searchS   s    
			t
   NCBI_BLASTc         C€  s4  d } | j  d d	 ƒ y. t j | d
 t j d t j d t j ƒ} Wn  t k
 rf } t d | ‚ n X| j d t |  ƒ ƒ \ } } | r› t d | ‚ n  d | } t | d ƒ � }	 |	 j	 | ƒ Wd  QX| j  d d | ƒ d d l
 m }
 |
 j ƒ  } y | d | ƒ } Wn t k
 r)t d ‚ n X| | f S(   Nt   blastalls   -pt   blastps   -dt   pdbs   -mt   7R1   s   Starting local BLAST searcht   stdint   stdoutt   stderrs   Cannot execute 'blastall': %st   inputs   Error exit from BLAST: %ss   local_blast_%s.xmlt   ws   Search results saved in %siÿÿÿÿ(   R3   R$   s!   Invalid BLAST XML format received(   R=   s   -pR>   s   -ds   pdbs   -mR@   (   R5   t
   subprocesst   Popent   PIPEt   OSErrorR   t   communicatet   strt   opent   writeR7   R3   R8   R    (   R2   R   R9   t   cmdlinet   processR&   t   outt   errR.   t   foutR3   R:   R%   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt#   perform_local_blast_homology_searchp   s6       		
t   Local_BLASTt   ncbit   localc         C€  s   t  j S(   N(   R   t   MPJob(   t   paramsR9   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   get_proxy_for_multiprocessing§   s    t   multiprocessingc         C€  s   t  j S(   N(   R   t   TJob(   RX   R9   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   get_proxy_for_threading®   s    t	   threadingc         C€  s¨   | d  k	 rJ | j d d | |  f ƒ d d  l } t | j | ƒ ƒ } n  d | k  rm | j d d | ƒ n  d d l m } | t j j	 d | d | ƒ d	 | d
 | ƒS(   NR1   s$   Using %s as submission command to %siÿÿÿÿi   s   Using %d cpus for single jobs(   t   partialt
   qinterfacet   commandt   factoryt
   qslot_cpus(
   t   NoneR5   t   shlext   tuplet   splitt	   functoolsR^   R   t   QueueJobt   Generic(   R   R`   Ra   t   qinterface_typeRb   R9   Rd   R^   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   get_proxy_for_queueµ   s    	c         C€  sG   d d l  m } t d d d |  j d | j d | j d |  j d	 | ƒ S(
   Niÿÿÿÿ(   t   genericR   t   LSFR`   Ra   Rj   Rb   R9   (   t   libtbx.queuing_system_utilsRl   Rk   t   submission_commandt   Jobt   lsf_interfaceRb   (   RX   R9   Rl   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   get_proxy_for_lsfÍ   s    				t   Load_Sharing_Facilityc         C€  sG   d d l  m } t d d d |  j d | j d | j d |  j d	 | ƒ S(
   Niÿÿÿÿ(   Rl   R   t   SGER`   Ra   Rj   Rb   R9   (   Rn   Rl   Rk   Ro   Rp   t   sge_interfaceRb   (   RX   R9   Rl   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   get_proxy_for_sgeÝ   s    				t   Sun_Grid_Enginec         C€  sG   d d l  m } t d d d |  j d | j d | j d |  j d	 | ƒ S(
   Niÿÿÿÿ(   Rl   R   t   PBSR`   Ra   Rj   Rb   R9   (   Rn   Rl   Rk   Ro   t   PBSJobt   pbs_interfaceRb   (   RX   R9   Rl   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   get_proxy_for_pbsí   s    				t   Portable_Batch_Systemt   lsft   sget   pbsc           C€  s   t  j j ƒ  S(   N(   R   t   AssemblyCreatet   Always(    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt%   get_assembly_acceptance_always_policy  s    t   alwaysc           C€  s   t  j j ƒ  S(   N(   R   R€   t   Observed(    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt'   get_assembly_acceptance_observed_policy  s    t   observedc           C€  s   t  j j ƒ  S(   N(   R   R€   t   Never(    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt$   get_assembly_acceptance_never_policy  s    t   neverc           C€  s   t  j j ƒ  S(   N(   R   t   SearchModelMaintenanceR�   (    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt,   get_assembly_ensemble_creation_always_policy"  s    c           C€  s   t  j j ƒ  S(   N(   R   RŠ   R„   (    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt.   get_assembly_ensemble_creation_observed_policy)  s    c           C€  s   t  j j ƒ  S(   N(   R   RŠ   R‡   (    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt+   get_assembly_ensemble_creation_never_policy0  s    c      
   C€  s  t  j d |  j ƒ } t  j ƒ  } t  j ƒ  t  j ƒ  t  j ƒ  | | t  j ƒ  t  j d |  j	 ƒ t  j
 d |  j ƒ g } t  j ƒ  t  j ƒ  t  j d |  j ƒ t  j d | ƒ g } t  j ƒ  t  j d t ƒ t  j ƒ  t  j ƒ  t |  j ƒ  t |  j ƒ  t  j ƒ  | g } | | | f S(   Nt   cutofft	   protocolst   sitet   poolt   rotation_search_expertt   remove_unsupported_symmetry(   R   t   RotationSearcht   rotation_peaks_cutofft   RotationPeakSalvaget   FindEnsemblet   TranslationSearcht   PeakEvaluatet	   Ensemblert   Sculptort   sculptor_protocolst	   DataFetcht
   pdb_mirrort   Coordinatort   SuperposeSolvet   PooledPackingCheckt   packing_poolt   ApplyRotationSearchResultst   Amalgamationt   LocalSymmetryExpertt   Falset   AssemblyRemovet   AssemblyUpdatet   ASSEMBLY_ACCEPTANCE_POLICY_FORt   assembly_acceptance_policyt%   ASSEMBLY_ENSEMBLE_CREATION_POLICY_FORt!   assembly_ensemble_creation_policyt   ObjectCompletion(   RX   t
   rot_expertt
   rps_expertt   level1t   level2t   postprocessors(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   get_ks_for_quick_mode>  s.    											c      	   C€  s‚   t  j d |  j ƒ } t  j ƒ  t  j d |  j ƒ t  j ƒ  t  j d | ƒ | t  j d |  j	 ƒ t  j
 d |  j ƒ g } g  | g  f S(   NRŽ   R‘   R’   R�   R�   (   R   R”   R•   R—   R¡   R¢   R˜   R£   R›   Rœ   R�   Rž   (   RX   R®   R±   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   get_ks_for_full_mode`  s    		t   quickt   fullt   datasett   enantiomorpht
   pointgroupc         C€  s%   d d  l  } | j j d |  d | ƒ S(   Niÿÿÿÿt   identityt   num_residues(   t   phasert   rms_estimatet   rms(   Rº   R»   R¼   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   calculate_rmsd_with_phaser|  s    c         C€  s.   d d  l  } t | j j d |  ƒ | j j ƒ S(   NiÿÿÿÿRº   (   R¼   t   maxR½   t   chothia_and_leskt   chothia_and_lesk_floor(   Rº   R»   R¼   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt(   calculate_rmsd_with_floored_chothia_lesk…  s    c         C€  s   |  S(   N(    (   Rº   R»   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   calculate_rmsd_from_rmsdŽ  s    t   defaultt   rmsdt   floored_chothia_and_lesks³.  
    hklin = None
        .type = path
        .short_caption = Reflections
        .style = bold file_type:hkl OnChange:update_phaser_hkl_info input_file
        
    labin = None
        .type = str
        .short_caption = Data labels
        .input_size = 160
        .style = bold renderer:draw_phaser_labin_widget

    resolution_cutoff = 2.5
        .type = float
        .input_size = 80
        .style = bold
        
    no_tncs = False
        .type = bool
        .optional = False
        .short_caption = Do not check for translational NCS
 
    crystal_symmetry
    {
        unit_cell = None
          .type=unit_cell
          .style = bold

        space_group = None
          .type = space_group
          .style = bold
    }
        
    mode = %(mode)s
        .type = choice
        .optional = False
        .short_caption = Search mode
    
    symmetry_exploration = %(symmetry)s
        .type = choice
        .optional = False
        .input_size = 160

    output
    {
        root = "mrage"
            .type = str
            .optional = False
            .style = hidden
            
        max_solutions_to_write = 0
            .type = int
            .optional = False
            .short_caption = Max. solutions to write
            .input_size = 50
            .style = spinner
            
        gui_base_dir = None
            .type = path
            .short_caption = Output folder
            .help = Base directory in which the PHENIX GUI will create a               folder containing the results.  Ignored when running the               program from the command line.
            .style = bold output_dir
        save_aniso_data = False
          .type = bool
          .expert_level = 3
        include scope libtbx.phil.interface.tracking_params
    }

    composition
    {
        count = None
            .type = int
            .optional = True
            .help = Overall number of copies of the complete molecule (which               may be multiple components).  If left blank, this will be               guessed based on the expected solvent content.
            .short_caption = Overall count
            .input_size = 50
            .style = spinner
            
        component
          .multiple = True
        {
            sequence = None
                .type = path
                .optional = True
                .short_caption = Component sequence
                .style = bold file_type:seq input_file
            
            stoichiometry = 1
                .type=int
                .optional = False
                .short_caption = Component stoichiometry
                .input_size = 50
                .help = Number of copies of this component relative to the                   overal macromolecule.  This is separate from the overall                   count parameter in the Basic Options tab, which defines the                   number of copies of the complete unit.   For instance, if                   you expect the basic molecule to be two copies of this                   component and one copy of a second component, the                   stoichiometry is 2.  If you are searching for an unknown                   number of copies of a single component, you should leave                   the stoichiometry set to 1.
                .style = bold spinner
            
            ensemble
                .multiple = True
                .optional=True
                .short_caption = Ensemble
            {
                coordinates
                    .multiple = True
                    .optional = True
                {
                    pdb = None
                        .optional = False 
                        .type = path
                        .style = input_file
                
                    identity = None
                        .optional = False
                        .type = float
                        
                    error_translation = %(error.translation)s
                        .optional = False
                        .type = choice
                        .help = "Identity to RMS conversion"
                }
            }
            
            model_collection
                .multiple = True
                .optional = True
            {
                trim = False
                    .type = bool
                    .optional = False
                    .short_caption = Trim superposed models
                    
                coordinates
                    .multiple = True
                    .optional = True
                {
                    pdb = None
                        .optional = False 
                        .type = path
                        .style = input_file
                
                    identity = None
                        .optional = False
                        .type = float
                        
                    error_translation = %(error.translation)s
                        .optional = False
                        .type = choice
                        .help = "Identity to RMS conversion"
                }
            }
            
            template
                .multiple = True
                .optional = True
            {
                pdb = None
                    .optional = False
                    .type = path
                    .style = input_file
                    
                alignment = None
                    .optional = True
                    .type = path
            }
            
            homology
                .multiple = True
                .optional = True
            {
                file_name = None
                    .optional = False
                    .type = path
                    .style = input_file
                    
                max_hits = 3
                    .optional = False
                    .type = int
            }
            
            search
                .optional = False
            {
                services = %(search.service)s
                    .type = choice(multi=True)
                    .optional = True
                    .caption = %(search.service.caption)s
                    .short_caption = Automatically search PDB with
                    .help = Performs a BLAST search of the PDB using either                       a locally installed version of BLAST and the PDB                       sequence database (requires separate installation), or                       the NCBI's BLAST server (requires Internet access).

                max_hits = 3
                    .optional = False
                    .type = int
                    .short_caption = Max. number of hits to use
                    .input_size = 50
                    .style = spinner
            }
        }
    }
    
    assembly
        .multiple = True
        .optional = True
        .help = "Define known assembly"
    {
        use_assembled = False
            .optional = False
            .type = bool
            .help = "Use assembly as model in search or only for completion"
            
        local_search
            .optional = False
            .help = "Define local search extent"
        {
            sweep = 5
                .optional = False
                .type = float
                .help = "Rotational search radius"
            
            extent = 5
                .optional = False
                .type = float
                .help = "Translational search extent"
        }
             
        component
            .multiple = True
            .optional = True
            .help = "Define a component of the assembly"
        {
            file_name = None
                .optional = False
                .type = path
                .help = "Assembly component structure"
                
            operation
                .optional = False
                .help = "Model transformation to participate in the assembly"
            {
                euler = 0 0 0
                    .optional = False
                    .type = floats( size = 3 )
                    .help = "Rotation"
                    
                displacement = 0 0 0
                    .optional = False
                    .type = floats( size = 3 )
                    .help = "Translation"
            }
        }
    }
    
    queue
    {
        technology = %(queue.technology)s
            .type = choice
            .optional = False
            .short_caption = Parallelization method
            .caption = %(queue.technology.caption)s
            .input_size = 160
            .style = bold renderer:draw_mrage_technology_choice
            
        cpus = 1
            .type = int
            .short_caption = Number of CPUs
            .style = renderer:draw_nproc_widget
            
        submission_command = None
            .type = str
            .short_caption = Queue submit command
            
        qslot_cpus = 1
            .type = int
            .optional = False
    }
    
    packing_pool = 20
        .type = int
        .optional = False
        
        
    rotation_peaks_cutoff = 0.75
        .type = float
        .optional = False
        
        
    post_refinement_cutoff = 0.75
        .type = float
        .optional = False
        
        
    final_selection_cutoff = 0.75
        .type = float
        .optional = False
        
    
    b_factor_refinement = True
        .type = bool
        .optional = False
        .short_caption = Refine B-factors of placed model
        
    significant_peak_threshold = 7.0
        .type = float
        .optional = False
        
    sculptor_protocols = %(sculptor.protocols)s
        .type = choice( multi = True )
        .optional = False
        
    template_equivalence = True
        .type = bool
        .optional = False
        
    assembly_acceptance_policy = %(assembly.acceptance)s
        .type = choice
        .optional = False
        
    assembly_ensemble_creation_policy = %(assembly.ensemble.creation)s
        .type = choice
        .optional = False
        
    pdb_mirror = *rcsb pdbe pdbj
        .type = choice
        .optional = False
        
    exclude_pdb_ids = None
        .type = strings
        .short_caption = Exclude PDB IDs from search
        .help = Developer option to prevent specific structures from being           used as search models, in order to test performance with lower           sequence identity structures.
        .expert_level = 3

    simple_run
      .style = noauto
      .help = Parameters for simplified GUI - not intended for command-line use.
    {
      enable = False
        .type = bool
        .help = GUI parameter - not intended for command-line use.
        .style = hidden
        .expert_level = 3
      component_sequence = None
        .type = path
        .style = input_file file_type:seq
        .short_caption = Component sequence
      template_model = None
        .type = path
        .multiple = True
        .optional = True
        .style = input_file file_type:pdb
        .short_caption = Template model
      alignment = None
        .type = path
        .multiple = True
        .optional = True
        .style = input_file file_type:aln,hhr
        .short_caption = Sequence alignment
      blast_services = %(search.service)s
        .type = choice(multi=True)
        .optional = True
        .caption = %(search.service.caption)s
        .short_caption = Automatically search PDB with
        .help = Performs a BLAST search of the PDB using either           a locally installed version of BLAST and the PDB           sequence database (requires separate installation), or           the NCBI's BLAST server (requires Internet access).
      max_blast_hits = 3
        .optional = False
        .type = int
        .short_caption = Max. number of hits to use
        .input_size = 50
        .style = spinner
    }
    t   possibles   queue.technologyt    c         c€  s   |  ] } | j  Vq d  S(   N(   t   CAPTION(   R   t   f(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>$  s    s   queue.technology.captiont   symmetryt   modes   search.servicec         c€  s   |  ] } | j  Vq d  S(   N(   RÊ   (   R   RË   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>3  s    s   search.service.captiont   alls   sculptor.protocolss   assembly.acceptances   assembly.ensemble.creations   error.translationt   process_includesc         C€  sK  d d l  m } | j |  ƒ } | j d ƒ d  } | j j ƒ  }	 | d  k	 rñ x{|	 D]. }
 |
 j ƒ  j ƒ  } | | k rT |
 } PqT qT W| j d d |  ƒ | j	 ƒ  x* |	 D]" } | j d | j ƒ  j ƒ  ƒ q« W| j
 ƒ  t d | |  f ‚ nÚ g  |	 D]0 } | j ƒ  s"| j ƒ  s"| j ƒ  rø | ^ qø } t | ƒ d k r¡| j d d |  ƒ | j	 ƒ  x* | D]" } | j d | j ƒ  j ƒ  ƒ qeW| j
 ƒ  t d	 ‚ n* | d
 } | j d d | j ƒ  j ƒ  ƒ | d  k	 sÝt ‚ | j d  k	 r| j d d | j ƒ | j d | j ƒ } n  | j d  k	 rY| j d d | j ƒ | j d | j ƒ } n  | j ƒ  d  k s}| j ƒ  d  k r�| j d d |  ƒ t d ‚ n  | j ƒ  r| j d d ƒ d d l m } | j d | d | j ƒ } | j d t j d d ƒ ƒ n  | j ƒ  r.| j d d ƒ | j ƒ  } n  | d  k	 rO| j d | ƒ } n  | j d d | j ƒ  ƒ | j ƒ  s…t d | ‚ n  d d  l } | j ƒ  j ƒ  } | j ƒ  j  ƒ  j! ƒ  } | j" ƒ  } | j# | j$ ƒ  | j% ƒ  | j& ƒ  ƒ | j' | ƒ | j( | ƒ | j) t* ƒ | j+ t, ƒ | j- | ƒ } | j. ƒ  r]| j d | j/ ƒ  ƒ t d ‚ n  | sÿ| j0 ƒ  } | j# | j1 ƒ  | j2 ƒ  | j3 ƒ  ƒ | j' | ƒ | j( | ƒ | j) t* ƒ | j+ t, ƒ | j4 | ƒ } | j5 ƒ  rït d ‚ qÿ| j d ƒ n  t6 j7 d | j1 ƒ  d  | j2 ƒ  d! | j3 ƒ  d" | d# | j ƒ  ƒ } | | f S($   Niÿÿÿÿ(   t   file_readert   hklR1   s   Arrays found in %s:s"   Couldn't find array %s in file %s.i   s   Suitable arrays found in %ss6   Could not select reflection array: multiple candidatesi    s   Reflection array selected: %ss   Changing space group to %st   space_group_infos   Changing unit cell to %st	   unit_cells2   No crystal symmetry information for the data in %ss/   Please define crystal_symmetry parameters firsts*   Running French-Wilson amplitude conversion(   t   french_wilsont   miller_arrayt   logt   texts   Amplitude conversion finisheds   Averaging Bijvoet pairst   d_mins"   Data high resolution limit: %.2f As   %s is not X-ray amplitude datas"   Error during anisotropy corrections=   TNCS detected in the data, and MRage does not handle TNCS yets   No TNCS detectedt   millert   fpt   sigfpt   cellt
   resolution(8   R   RÐ   t   any_filet   assert_file_typeRc   R   t   as_miller_arraysR5   t   label_stringt   indentt   dedentR   t   is_xray_amplitude_arrayt   is_xray_intensity_arrayt%   is_xray_reconstructed_amplitude_arrayt   lent   AssertionErrort   space_groupt   customized_copyRÓ   RÒ   t   cctbxRÔ   t   french_wilson_scaleR   t   section_closet   anomalous_flagt   average_bijvoet_matest   resolution_filterRØ   R¼   t
   parameterst   typet   hall_symbolt   InputANOt   setREFLt   indicesR$   t   sigmast   setCELL6t   setSPAC_HALLt   setMUTEt   Truet   setHKLOR¦   t   runANOt   Failedt   logfilet   InputNCSt	   getMillert   getCorrectedFt   getCorrectedSIGFt   runNCSt   hasTNCSR   t   XrayData(   t   hklint   labint   crystal_symmetryRÝ   t   no_tncsR9   RÐ   t   hkl_filet   input_arrayt   known_arraysRÕ   t   array_labelst   arrayt   suitable_arraysRÔ   R¼   RÜ   t   hallt   inpR%   t   tncsinpt   tncsrest	   xray_data(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   read_any_format_dataJ  s¾    
 

 

			$				%			c         C€  s‚   t  j j |  ƒ s" t d |  ‚ n  d d  l } | j j |  ƒ j ƒ  } | j ƒ  sb t d |  ‚ n  t	 t
 | j ƒ  d j ƒ  ƒ ƒ S(   Ns   Cannot find PDB file: %siÿÿÿÿs   PDB file empty: %si    (   R*   R+   t   isfileR   R4   R?   RD   t   construct_hierarchyt   modelsRç   t   listt   residue_groups(   R.   R   t   root(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   get_number_of_residuesØ  s    c   O      €  s+  | j  d t j d d t t f ƒ ƒ t j d t ƒ } | j d t j	 d d g d d	 ƒ ƒ x |  D] } | j
 d
 | ƒ qd Wy | j ƒ  } Wn t k
 r¬ } t | ‚ n X| j  d t j d d ƒ ƒ | j  d | j ƒ  ƒ y | j ƒ  ‰ Wn t k
 r} t | ‚ n Xˆ j j r5t ˆ ƒ ‰ t ˆ j _ n  t d ˆ ƒ t j d ˆ j d ˆ j d ˆ j d ˆ j d ˆ j ƒ } | j  d d ƒ | j d | ƒ ˆ j j rÐ| j  d d ƒ | j d ˆ j j  ƒ n  g  } g  } ˆ j! d  k	 r!t# d „  ˆ j! Dƒ ƒ ‰ | j  d d j$ ˆ ƒ ƒ n	 t# ƒ  ‰ x7	ˆ j% j& D])	‰ ˆ j' d  k r�| j( d d ƒ | j( d d ƒ | j( d d d d ƒ d d  l) }	 d d l* m+ }
 d d  l* m, } ˆ j- s¿t. ‚ g  ˆ j- D]L } g  | j/ D]6 } |
 j0 d |	 j1 j2 | j1 ƒ j3 ƒ  d! | j4 ƒ ^ qÙ^ qÉ} g  | D]" } | r"t5 | ƒ t6 | ƒ ^ q"} | sVt. ‚ t5 | ƒ t6 | ƒ } t j7 d" | ƒ } n� t j8 j9 d# ˆ j' ƒ } t6 | j: ƒ d$ k rÁt d% ˆ j' ‚ n  t j; d& | j: d' ƒ } d d( l< m= } t j> d& | d) | j? j@ d) tA g t6 | ƒ ƒ ƒ } | j  d d* | jB ƒ d' ˆ jC k  sJt. ‚ | jD | ˆ jC f ƒ xë ˆ j- D]à } | j/ st. ‚ g  } g  } x‚ | j/ D]w } tE | jF d+ | jG d, tH d# | j1 ƒ ƒ } | j  d d- | j1 | jG | jF | f ƒ | jD | ƒ | jD | j1 ƒ q•Wt jI d. | d/ | d0 t jJ d1 | g ƒ ƒ } | jD | ƒ qjWxô ˆ jK D]é } | j/ smt. ‚ g  } g  } x‚ | j/ D]w } tE | jF d+ | jG d, tH d# | j1 ƒ ƒ } | j  d d- | j1 | jG | jF | f ƒ | jD | ƒ | jD | j1 ƒ qƒWt jL d. | d/ | d2 | jM d0 t jJ d1 | g ƒ ƒ } | jD | ƒ qXWx›ˆ jN D]�} tO jP jQ | j1 ƒ s}t d3 | j1 ‚ n  | jR d  k r?ˆ j' s›t. ‚ tS | t j> ƒ s³t. ‚ | j  d d4 ƒ d d5 lT mU } d d6 lV mW } d d  l) }	 d d l* m+ }
 d d  l* m, } |	 j1 j2 | j1 ƒ j3 ƒ  } | d7 | j' j' | j' d8 | j1 d& |
 jX d9 | jY ƒ  d' jZ ƒ  d' j[ ƒ  d: t\ t] | j4 j^ | j4 j_ ƒ ƒ d; | j4 j` ƒ ƒ g ƒ } | j  d | ƒ d< ta d# ˆ j' ƒ ta d# | j1 ƒ f }  tb |  d= ƒ � }! |! jc td | ƒ ƒ Wd  QX| j  d d> |  ƒ t je d? | d8 |  ƒ }" n t je j9 d# | jR ƒ }" ˆ j' rœtS | t j> ƒ sxt. ‚ tf d@ | j' d? |" j: jg ƒ  ƒ }# n | }# t jh dA | j1 d? |" d0 t jJ d1 |# g ƒ ƒ }$ | jD |$ ƒ qOWx;ˆ ji D]0}% y tb |% jj ƒ }& Wn  tk k
 r(	} t dB | ‚ n Xtl dC |& ƒ }' ‡ f dD †  tm |' jn ƒ  dE d$ ƒDƒ }( xº t] to |% jp ƒ |( ƒ D]  \ }) \ }* }+ ˆ j' rÐ	tS | t j> ƒ s¬	t. ‚ tf d@ | j' d? |+ jR jg ƒ  ƒ }, n | }, t jq dF |* dG |% jj dH |+ d0 t jJ d1 |, g ƒ ƒ }- | jD |- ƒ qy	WqíWˆ jr js r7ˆ j' s<
t. ‚ tS | t j> ƒ sT
t. ‚ x	ˆ jr js D]ø }. tt |. d& | j' j' d8 ta d# ˆ j' ƒ d | ƒ \ }' }  ‡ f dI †  tm |' jn ƒ  dE d$ ƒDƒ }( x� t] to ˆ jr jp ƒ |( ƒ D]s \ }) \ }* }+ tf d@ | j' d? |+ jR jg ƒ  ƒ }/ t jq dF |* dG |  dH |+ d0 t jJ d1 |/ g ƒ ƒ }- | jD |- ƒ qâ
Wqa
Wq7q7W| svt dJ ‚ n  x! | D] } | ju jc dK | ƒ q}Wˆ j% jv d  k rœ| j  d dL ƒ d d  l* m, } d dM lw mx }0 |0 jy d1 g  | D]1 \ ‰ }1 |0 j& d" ˆ jB |1 dN | j4 jz ƒ ^ qìdO |0 j{ dP | j| ƒ  ƒ ƒ }2 |2 s`| j( d dQ ƒ t dR ‚ n  t} |2 dS dT „  ƒd' ˆ j% _v | j  d dU ˆ j% jv ƒ n  g  | D] } tS | t jI ƒ r£| ^ q£}3 d d  l~ }4 d d  l }4 xÇtm ˆ j€ dE d$ ƒD]°\ }5 }6 | j  d dV |5 ƒ | j� ƒ  g  }7 xá tm |6 j& dE d$ ƒD]Ê \ }8 ‰ | j  d dW |8 ˆ jj f ƒ ‡ f dX †  |3 Dƒ }9 y |9 j‚ ƒ  }: Wn! tƒ k
 r­t dY ˆ jj ‚ n X| j  d dZ |: ƒ |4 j„ j… |4 j† j‡ ˆ jˆ j‰ Œ  ˆ jˆ jŠ f ƒ }; |7 jD |: |; f ƒ q;W| j‹ ƒ  |7 st. ‚ t jŒ d[ |7 d\ t j� ƒ  d] t jŽ d^ |6 j� j� d_ |6 j� j‘ ƒ ƒ }< | ju jc dK |< ƒ |6 j’ rõt j“ d` |< ƒ }= | ju jc dK |= ƒ qõqõWˆ j” j• d$ k rï| j  d da ƒ t– j— db ˆ j” j• dc t– j˜ ƒ }> nT | j  d dd ˆ j” j• ƒ t– j— db ˆ j” j• dc t™ ˆ j” jš d ˆ j” d | ƒ ƒ }> d d  l› }? d de l< mœ }@ t� ˆ jž d0 t jJ d1 tŸ |? j  g  | D]# \ ‰ }1 ˆ g |1 ˆ j% jv ^ q…ƒ ƒ df | dg |> dh | di |@ j¡ dj |@ j¢ ƒ dk ˆ j£ dl t¤ ƒ }A t¥ ˆ j¦ d ˆ ƒ \ }B }C }D t§ j¨ dm |B dn |C do |D dp ‡ f dq †  dr ˆ j© ds ˆ jª ƒ }E |A j« dt |E ƒ | j  d t¬ j­ d du ƒ ƒ |A j® s†t. ‚ t6 |A j¯ ƒ t6 |A j® d ƒ k s®t. ‚ d d  l° }F g  }G xTt] |A j¯ |A j® d ƒ D]9\ ‰  }H |H d  k røqÚn  t± ‡  f dv †  ˆ  j² Dƒ ƒ rqÚn  t§ j³ dw ˆ  dx ˆ j´ dk ˆ j£ ƒ }I tµ d) |I d | ƒ | j  dy ƒ | j  |I j¶ d' ƒ t· dz |I j¶ d' dw ˆ  d{ | j  ƒ |I j¶ d' _¸ d| ˆ j j  |I j¹ jº ƒ  f }J tb d} |J d= ƒ �P }K | j  d d~ |K j» ƒ |F j¼ |J |I f |K ƒ |G jD tO jP j½ |K j» ƒ ƒ Wd  QXxè tm |I j¶ dE d$ ƒD]Ñ \ }* }L ˆ j j¾ |* k  r`Pn  | j  d t j d d |* ƒ ƒ t¿ d€ |I j¹ jÀ ƒ  dz |L d d� |J |* f d{ | j  ƒ \ }M }N | j� ƒ  | j  d d‚ |M ƒ | j  d dƒ |N ƒ | j‹ ƒ  | j  d t jÁ ƒ  ƒ q>WqÚW| j  d d„ ƒ |G S(…   NR1   R×   s   %s version %st   master_philt   handlert
   extensionss   .mtzt   templates   hklin=%st   accumulators   All configuration options:RX   R  R  R	  RÝ   R
  s   Reading data...R9   s   Saving corrected data...R  c         s€  s!   |  ] } | j  ƒ  j ƒ  Vq d  S(   N(   t   stript   upper(   R   t   c(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>"  s    s   Excluding PDB ids: %ss   , s   No sequences specifieds9   Molecular weight will be calculated from specified modelss&   This is suboptimal for distant models s(   and better results could be obtained by s   specifying the sequenceiÿÿÿÿ(   t   rsam(   t   mmtR'  t   mwR.   i   s-   Sequence file '%s' contain multiple sequencesR2   i    (   t   domain_analysist	   selections)   Molecular weight for this component: %.1fRº   R»   s.   %s: quality = %.2f, method = %s => rmsd = %.3ft   pdbst   rmsdst   compositiont
   componentst   trims   Cannot find PDB file: %ss!   Generating alignment for template(   t   get_muscle_alignment_ordered(   R   t	   sequencesR   t   rgst   one_letter_fort   unknowns   muscle_%s_%s.alnRE   s   Saved alignment as %st	   alignmentt   sequence_datat   pdb_files   Error while opening: %sR   c         3€  s6   |  ], \ } } | j  j ƒ  ˆ  k r | | f Vq d  S(   N(   t
   identifierR$  (   R   t   it   h(   t   excludes(    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>ò  s    	t   startt   indext   searcht   hitc         3€  s6   |  ], \ } } | j  j ƒ  ˆ  k r | | f Vq d  S(   N(   R8  R$  (   R   R9  R:  (   R;  (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>  s    	s   No models have been definedt   objs7   Guessing number of copies based on Matthews coefficient(   t   matthewst   rho_spect   density_calculatort   crystals*   Components do not fit into asymmetric units   Asymmetric unit too fullt   keyc         S€  s   |  d S(   Ni   (    (   t   p(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   <lambda>A  s    s   Most likely count: %ds   %s. assembly:s   %s. component: %sc         3€  s'   |  ] } ˆ  j  | j k r | Vq d  S(   N(   R.   R+  (   R   t   mfe(   t   comp(    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>R  s    s7   Cannot find component: %s is not defined as an ensembles   Corresponding ensemble: %st   definitionsRÌ   t   strategyt   sweept   extentt   assemblys+   Running all calculations on the main threadt   nproct   proxys2   Calculations will be run in parallel using %d CPUs(   t   superpositiont   problemt   queueR   RQ  t   methodt   template_equivalencet   identity_to_rmsR°   R±   R²   t	   criterionc         €  s   ˆ  j  |  j k S(   N(   t   significant_peak_thresholdt   tfz(   t   peak(   RX   (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRG  ¡  s    t   b_factor_refinementt   threshold_postrefinementt   plans   Solutions foundc         3€  s!   |  ] } | ˆ  j  j k Vq d  S(   N(   RR  R  (   R   t   st(   t   case(    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>¶  s    R_  t	   thresholds   Top solution:t	   structuret   streams   %s_%ss   %s_results.pkls   Writing results to %ss   Solution #%sR$   s   %s_%ds   PDB file: %ss   Map file: %st   Finished(Â   R5   R   t   bannert   PROGRAMt   VERSIONR   t   PhilAccumulatort   PHIL_MASTERt   register_file_handlert   ExtensionFileHandlerRO   t   mergeR#   R   t
   underlinedt   as_strt   extractt
   simple_runt   enablet   combine_simple_paramsR¦   t   validate_params_basicR   t   ProblemR  R  R	  t   resolution_cutoffR
  t   loadt   save_aniso_datat   enpickleR  t   exclude_pdb_idsRc   t   sett   joinR-  t	   componentR2   t   warningR4   R¼   R&  R'  t   ensembleRè   t   coordinatest   structure_weightR?   RD   R  t   PROTEINt   sumRç   t	   Componentt   SequenceObjectt	   from_filet   objectt   SequenceDataR7   R)  t   SequenceComponentt   ChainSequenceSelectiont   from_selectionRû   R(  t   stoichiometryt   appendt   CALCULATE_RMSD_WITHt   error_translationRº   R  t   MultifileEnsemblet   Compositiont   model_collectiont   ModelCollectionR/  R!  R*   R+   R  R5  t
   isinstancet	   mmtbx.msaR0  R   R   t   one_letter_sequenceR  t   chainsR  t   dictt   zipt   three_letter_codest   one_letter_codest   unknown_one_letterR/   RL   RM   RK   t   AlignmentObjectt   sequence_component_selectiont   copyt   TemplateR3   R.   t   IOErrorR)   t	   enumeratet   hitst   ranget   max_hitst   HomologySearchHitR>  t   servicest   HOMOLOGY_SEARCH_ONR$   t   countt   mmtbx.scalingRA  t   number_tablet   specific_volumeRC  RD  RÀ   t   scitbx.matht   scitbx.matrixRN  Râ   t   nextt   StopIterationt   matrixt   rtt   matht   euler_angles_zyz_matrixt	   operationt   eulert   displacementRã   t   Assemblyt
   PointGroupt   SearchStrategyt   local_searchRL  RM  t   use_assembledt   RegularEnsembleRS  t   cpusR   t   QueueRp   t	   PROXY_FORt
   technologyt   operatorRQ  t   SYMMETRY_OPTIONS_FORt   symmetry_explorationt   reducet   addt   Proxyt   simple_ssm_superpositionRU  R¿   t   MODE_SETUP_FORRÍ   R   t   PlanR[  t   post_refinement_cutofft   solveR   t   titlet   historyt   casest   pickleRÎ   t	   score_fort   SolutionSelectiont   final_selection_cutofft   print_solutions_as_textt	   solutionst   calculate_success_probabilityt   probabilityR_  t   space_group_suffix_symbolR   t   dumpt   abspatht   max_solutions_to_writet   run_llg_jobt   calculation_datat   blank(O   t   argsR9   R"  t   argumentt   merged_philR&   RR  R.  R  R   R&  R'  t   mdt   coort   weightsRE   t   averagesR(  R%  t   seqfileR2   R)  R+  R,  R¾   t   mt   mct   tmR0  R   R  t   aliR.   t   outfileR5  t   t_compt   tt   hsR   R>  t   hitgent   ctrR=  R?  t   h_compR:  t   servicet   s_compRA  t   stoicht   count_probabilitiest   multifile_ensemblest   scitbxt   i_assRN  RJ  t   i_compt	   ense_findt   enset   opt   at   regenseRS  RÀ  RQ  t   stateR°   R±   R²   R]  RÎ  t   result_filest   resultsR*  t   prefixRR   Ra  R7  t   mtz_file(    (   R_  RI  R;  RX   sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   runæ  sŽ   				
								Y/												 						(+				
(.			;	"
"	
			$				3					(&			""	

c         C€  s  t  |  d d  ƒ d  k	 r$ |  j } nãd d l m } | j d ƒ g  } d t |  j ƒ k  r[| j d ƒ d d l m } | j	 ƒ  } xÓ t
 |  j d  d d ƒD]µ \ } }	 | j d	 | d
 t j d g  |  j D] }
 |
 |	 k rÍ |
 ^ qÍ ƒ d |	 ƒ } | j ƒ  } | j d | ƒ } | j j } | j d | |	 | f ƒ | j | j d | ƒ ƒ qŸ Wn  |  j } | j d t |  j ƒ |  j d | f ƒ | j | j d | ƒ ƒ | j d | j d | j d | j ƒ  d | ƒ ƒ } | j d ƒ | j t | ƒ d ƒ | j } | S(   NRÕ  iÿÿÿÿ(   t
   evaluations"   Evaluating probability of success
i   sG   Multi-molecule structure: recalculate TFZs for molecules (except last)
(   t   calculationR<  R$   R^   t   peaksRZ  Rÿ  s   %d. %s: TFZ=%.2f
RY  t
   collectiont   descriptionRÒ   s6   Evaluation for probability of solution being correct:
s   
(   t   getattrRc   RÕ  R7   R  RM   Rç   R  R  RÛ  R   t   TFZCalculationR   t	   StructureR  RO   R$   RY  R‹  t"   TFZBasedProbabilityPeakDescriptiont   TFZBasedProbabilityt   TFZ_POLAR_NONPOLARt'   TFZBasedProbabilityStructureDescriptionRÒ   RK   t   total(   Ra  R_  Rb  RÕ  R  R  R  R$   R=  RZ  RF  t   calct   rawR%   RY  t   prob(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRÔ  ê  sF    &		+		$				c         C€  s²   d d l  m } | j d |  j d | d d ƒ d d l m } | j j d g  t | j	 d | j	 d ƒ D]* \ } } | | j
 k ri | | j
 k ^ qi ƒ } t j d |  d | ƒ S(	   Niÿÿÿÿ(   R&  R2   R5  R=  i    (   R)  R*  (   R¼   R&  t   alignment_stichR2   R7   R)  Rˆ  R‰  R—  t
   alignmentst   gapR   R‡  (   R6  R5  R&  R)  Rë  Rå  R*  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRœ  "  s    		''c      
   C€  sÄ   | j  d t j d d |  j j ƒ  ƒ ƒ |  j r° | j  d d t |  j ƒ ƒ | j  d t j ƒ  ƒ xX t |  j d d ƒD]. \ } } t	 d |  j d | d	 | d
 | ƒ q{ Wn | j  d d ƒ d  S(   NR1   R×   s    Solution list for space group %ss   %d solution(s) foundR<  i   R_  R=  Ra  R9   s   No solutions found(
   R5   R   t   subtitleR_  t   space_group_symbolRÓ  Rç   RÜ  R   t   print_solution_info(   R*  R9   R=  Ra  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRÒ  5  s    			"	c         C€  s\  d d l  m } m } | d d d i |  j j ƒ  d 6t t |  j ƒ ƒ d 6ƒ } xÕt |  j d d	 ƒD]¾\ } } | d d
 d i t | ƒ d 6d |  j j	 | d 6t | j
 ƒ d 6ƒ } t d | ƒ } | j ƒ  }	 | d d ƒ }
 | j |
 ƒ x$| D]} t | j ƒ t |	 j ƒ } d | k  s,t ‚ | d d d i | j d  k	 rWd | j n d d 6d | j d 6d |  j j	 | d 6d |  j j	 | |  j j	 |	 d 6ƒ } xT g  | j | D] } | j ^ q¼D]. } | d d d t | ƒ ƒ } | j | ƒ qÏW| }	 |
 j | ƒ qø W| j | ƒ qg W| d | ƒ j | j ƒ | j d t j ƒ  ƒ d  S(   Niÿÿÿÿ(   t   Elementt   ElementTreet   tagRÓ  t   attribRé   R§  R<  i   t   solutionR=  s   %.2ft   LLGt   significantRa  RÌ  i    t	   extensions   %.1fs   n/at   RFZt   TFZt   DLLGR}  R×   t   elementR1   (   t   xml.etree.ElementTreeR  R  R_  R  RK   Rç   RÓ  R   RÏ  R  t   search_history_forR­  R‹  R  Rè   t   rfzRc   RY  R}  RM   R5   R   RÜ  (   R*  R9   R  R  R  R=  Ra  R  R+   t   previoust
   annotationt   currentt   extraR   RF  RI  t   found(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   print_solutions_as_xmlM  sH    "#+c         C€  s³  | j  d d |  j j ƒ  ƒ | j  d t j ƒ  ƒ d d  l } t t | j g  |  j	 D]% } g  | j
 D] } | j ^ qe ^ qU ƒ ƒ } | j  d d ƒ x$ | D] } | j  d | j ƒ  ƒ q� W| j  d t j ƒ  ƒ | j  d d ƒ xÉ |  j	 D]¾ } | j ƒ  } t d | ƒ } | j ƒ  }	 g  | D]B }
 d |
 j d  k	 rFd |
 j n d	 |
 j |  j j |
 f ^ q!} d
 d j | ƒ | _ | j  d | j ƒ  ƒ | j  d t j ƒ  ƒ qí Wd  S(   NR1   s   SPACEGROUP %siÿÿÿÿs   # Ensemble definitionss   # SolutionsRa  s   RFZ=%s TFZ=%.2f LLG=%.2fs   %.1fs   n/as    %sRÉ   (   R5   R_  R  R   RÜ  RÀ  Ry  RÃ  RÄ  RÓ  R  R}  t   phaser_keyword_formatt   mr_setR&  R­  R'  Rc   RY  RÏ  Rz  t
   ANNOTATIONt   unparse(   R*  R9   RÀ  Ra  RZ  t	   ensemblesRù  R/  R+   R(  R*  R)  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   print_solutions_as_scriptƒ  s,    8Lc      	   C€  sW  | j  d d | |  j | f ƒ | j ƒ  | j  d t | ƒ ƒ | j  d t j d d ƒ ƒ t d | ƒ } | j ƒ  } | j rß | j  d d | |  j | f ƒ | j ƒ  | j  d t | ƒ ƒ | j	 ƒ  | j  d d ƒ n  g  } xù | D]ñ } t
 | j ƒ t
 | j ƒ } d | k  s t ‚ g  | j | D] }	 |	 j ^ q/}
 t
 |
 ƒ d	 k rsd
 d j d „  |
 Dƒ ƒ n t |
 d ƒ } | j | | j d  k	 r¨d | j n d | j |  j | |  j | |  j | g ƒ | } qì Wt j d d d d d d g d d d d d d g d | ƒ } | j  d t j d | ƒ ƒ | j	 ƒ  | j  d d ƒ d  S(   NR1   s   Solution %d, score=%.3fR×   s   Search historyRa  s   Starting point, score=%.3ft    i    i   s   [ %s ]s    + c         s€  s   |  ] } t  | ƒ Vq d  S(   N(   RK   (   R   R&   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>Å  s    s   %.1fs   n/at   captionst   ModelR!  R"  R  R#  t   formatss   %st   lines(   R5   RÏ  Râ   RK   R   Rl  R&  R­  R  Rã   Rç   Rè   R}  Rz  R‹  R'  Rc   RY  R   t   format_table_entriest   assemble_table(   R_  R=  Ra  R9   RÌ  R(  R8  R*  R+  RF  t   compst   mentryt	   formatted(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyR  «  sD    	
		

$?

		
c         C€  s<  t  d | ƒ } | j ƒ  } g  } xÚ | D]Ò } t | j ƒ t | j ƒ } d | k  s\ t ‚ g  | j | D] } | j ^ qk } t | ƒ d k r¯ d d j d „  | Dƒ ƒ n t | d ƒ }	 | j |	 | j	 |  j
 | |  j
 | |  j
 | g ƒ | } q( Wt j d d d	 d
 d g d d d d d g d | ƒ }
 |
 d S(   NRa  i    i   s   [ %s ]s    + c         s€  s   |  ] } t  | ƒ Vq d  S(   N(   RK   (   R   R&   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>å  s    R5  R6  R"  R  R#  R7  s   %ss   %.1fR8  (   R&  R­  Rç   R  Rè   R}  Rz  RK   R‹  RY  RÏ  R   R9  (   R_  Ra  RÌ  R(  R8  R*  R+  RF  R;  R<  R=  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   format_solution_historyÜ  s&    $?

		c         C€  s;   |  g } x% | d j  r0 | j | d j  ƒ q Wt | ƒ S(   Niÿÿÿÿ(   t   predecessorR‹  t   reversed(   Ra  RÌ  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyR&  ù  s    	c         C€  s´   g  } g  |  D] \ } } | ^ q }  t  |  d „  ƒ } xv | D]n } | j } | j ƒ  } xP t | j d d ƒD]9 \ } }	 | t | ƒ d | j |	 g }
 | j |
 ƒ qo Wq> W| S(   Nc         S€  s   t  | j |  j ƒ S(   N(   t   cmpt
   best_score(   t   xt   y(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRG    s    R<  i   s   %.2f(   t   sortedR_  R  R   RÓ  RK   RÏ  R‹  (   Rÿ  t   tableRF  t   rt   results_t	   sg_resultR_  Ré   R=  R  t   row(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   format_solution_list  s    	" c         C€  s±   | d k s t  ‚ t |  t ƒ r0 t | t ƒ s6 t  ‚ xt |  D]l \ } } | j j ƒ  } | | k r= xB t | j d d ƒD]( \ } } | | k rz t | j | ƒ Sqz Wq= q= Wd  S(   Ni    R<  i   (
   Rè   R’  R  RK   R_  R  R   RÓ  R>  Rc   (   Rÿ  Ré   t   solution_idR   RI  t   sgR=  R  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   get_solution_history  s    $"c         C€  sô   d d  l  } d d l m } | j j j ƒ  } | j ƒ  } | j ƒ  } x~ |  j D]s }	 |	 j	 d | ƒ }
 |
 j
 ƒ  sz t ‚ xF |
 j
 ƒ  d j ƒ  D]. } | j ƒ  } | j ƒ  | _ | j | ƒ q‘ WqP W| j j j	 ƒ  } | j | ƒ | j ƒ  | S(   Niÿÿÿÿ(   t   chiselRÜ   i    (   R4   R¼   RO  R?   t	   hierarchyt   modelt	   chain_idst   uctbx_unit_cellR  R  R  Rè   R•  t   detached_copyR­  t   idt   append_chaint   append_modelt   atoms_reset_serial(   Ra  R$   R  Rb  R   RO  RQ  RR  RÜ   RF  RG  R%  R�  R  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   structure_output_single  s     
c         C€  sŽ  d d  l  } d d l m } d d  l } d d  l } | j j j ƒ  } | j ƒ  }	 | j	 ƒ  }
 x |  j
 D]õ } | j | j ƒ } xÚ | j d |
 ƒ D]Æ } x½ | j ƒ  D]¯ } x¦ | j ƒ  D]˜ } | j ƒ  } |	 j ƒ  | _ | j ƒ  } x[ | j ƒ  D]M } | j ƒ  } | st ‚ | | d _ x | d D] } | j | ƒ q)Wqó W| j | ƒ q¹ Wq¦ Wq“ Wqh W| j j j ƒ  } | j | ƒ | j ƒ  | S(   Niÿÿÿÿ(   RO  RÜ   i    i   (   R4   R¼   RO  t	   itertoolst   stringR?   RP  RQ  RR  RS  R  t   cyclet   ascii_uppercaset   rootsR  R•  RT  R­  RU  R  t   atom_groupsRè   t   altloct   remove_atom_groupRV  R  RW  RX  (   Ra  R$   R  Rb  R   RO  RZ  R[  RQ  RR  RÜ   RF  t   altlocsRG  Rå  R%  R�  R`  t   rgt   agst   agR  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   structure_output_ensemble4  s4    
c         C€  s�  d d l  m } | d d  d | d d ƒ \ } } } | d } d d l m }	 g  }
 | j ƒ  } x–t |  j d | ƒ d	 d
 ƒD]v\ } } | j d | ƒ g  } xb | j	 j
 D]T } y | j ƒ  } Wn% t k
 rì | j d | ƒ q¯ n X| j d j | ƒ ƒ q¯ Wd d j | ƒ } | j s)t ‚ t d | j d j ƒ } xi | j d
 D]Z } |	 j d d d d g d t d | d | d t d | j ƒ d | d | ƒ } | j } qPW| j ƒ  } t | j ƒ  ƒ d
 k sØt ‚ |
 j | j ƒ  d j ƒ  ƒ q Wd d l m } t j j j ƒ  } | j ƒ  } x6 |
 D]. } | j ƒ  } | j  ƒ  | _! | j" | ƒ q.Wt j j j# ƒ  } | j$ | ƒ | j% ƒ  | S(   Niÿÿÿÿ(   t   get_array_dictt   map_coeffs_arrayt   mtz_int
   map_coeffss   FWT,PHWT(   t   combine_modelsRÜ   R<  i   s    ### Combining chain group %d ###s&   WARNING: no sequence available for %s
R4  s   >SEQUENCE
%s
s   
RQ  i    RÝ  s   output_files.pdb_out=Nones   output_files.log=Nones   output_files.params_out= Nonet   quietRP   t	   pdb_inputt   second_pdb_inputt   seq_file_as_string(   RO  (&   t*   solve_resolve.resolve_python.resolve_utilsRg  Rc   t   phenix.command_lineRk  RS  R   t   chain_model_groupsRM   R-  R.  t   residue_sequencet   AttributeErrorR‹  Rz  R  Rè   t   to_pdb_input_objectRQ  R¦   t
   pdb_outputR  Rç   t   extendR•  R¼   RO  R   R?   RP  RR  RT  R­  RU  RV  R  RW  RX  (   Ra  R$   R  Rb  Rg  t
   array_dictt   high_resolutionR	  Rh  Rk  t   combined_chainsRÜ   R=  t   cmgR8  RI  t   seqR2   R*  t   othert   combinationR  RO  RQ  RR  t   chainR�  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   structure_output_combined[  s`    
+			!
c         C€  s(  d d  l  } d d l m } | j j j ƒ  } | j ƒ  } | j ƒ  } t |  j	 d | ƒ ƒ }	 | j
 d t |	 ƒ ƒ xƒt |	 d d ƒD]o\ }
 } g  |	 D] } | | k r› | ^ q› } t | j j ƒ  ƒ } t | ƒ d k sæ t ‚ g  } | j
 d |
 t | d j ƒ f ƒ x*t | d j d d ƒD]\ } } | j j j ƒ  } | j | j ƒ t j d	 | g d
 | j g d | d j ƒ } t j d | d | j d | j d | j ƒ } t d | d t j d | | g ƒ d t ƒ } t | j ƒ  ƒ d k sÿt ‚ | j ƒ  d } | j | | f ƒ | j
 d | | f ƒ q*Wt  | d d „  ƒ} | j
 d | j! | ƒ d | d f ƒ | d j d | ƒ } t | j ƒ  ƒ d k s®t ‚ xF | j ƒ  d j" ƒ  D]. } | j# ƒ  } | j$ ƒ  | _% | j& | ƒ qÅWqˆ W| j j j ƒ  } | j | ƒ | j' ƒ  | S(   Niÿÿÿÿ(   RO  RÜ   s+   There are %s constituents in the structure
R<  i   s   %d. constituent: %s models
i    R^  R,  R-  R}  t   rotationt   translationt   bfactorR$   Ra  R  t   hklos     %d. model: score = %.2f
RE  c         S€  s   |  d S(   Ni   (    (   RF  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRG  Î  s    s!     Best: index = %d, score = %.2f
((   R4   R¼   RO  R?   RP  RQ  RR  RS  R  t   atomic_constituentsRM   Rç   R   R}  Rr  Rè   R  R  RW  R   t   MultimodelEnsembleRÆ   R-  t   PeakR�  R‚  Rƒ  t   calculate_llg_mapR
  R¦   t	   getValuesR‹  RÀ   R=  R•  RT  R­  RU  RV  RX  (   Ra  R$   R  Rb  R   RO  RQ  RR  RÜ   t   constituentsR=  R*  R%  t	   inactivest   cmgst   scoredst   mindext   cmodelR  R}  RZ  R%   t   scoret	   best_pairRG  R�  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt"   structure_output_best_single_model   sd    %&						
c         C€  sJ   d d  l  } | j j j ƒ  } | j |  ƒ | j j d d d | j ƒ  ƒ S(   Niÿÿÿÿt   source_infoR[  R8  (   R4   R?   RP  R  RW  RD   t   as_pdb_string(   RQ  R   R  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRu  ã  s    t   PHASERc   	      C€  sí   d d  l  } | j ƒ  } |  j d | ƒ | j t ƒ | j | ƒ | j t ƒ | j | ƒ | j	 d ƒ | j
 d ƒ | j ƒ  } x! t | ƒ D] } | j | ƒ q� W| j | j ƒ  g ƒ | j | ƒ } | j ƒ  sé t | j ƒ  ‚ n  | S(   NiÿÿÿÿRD   t   OFFi   (   R¼   t   InputMR_LLGt   applyt   setXYZOR¦   Rü   Rú   Rû   t   setROOTt   setMACA_PROTt   setJOBSR2  Ry  t   apply_ensemble_definitiont   setSOLUR/  t	   runMR_LLGt   SuccessR   Rÿ   (	   R$   Ra  R  R„  R¼   RD   R2  Rù  R%   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRˆ  î  s"    c      	   C€  sª   t  d |  d | d | d t ƒ d | } t j j | ƒ sA t ‚ d | } | d | d |  d | d | ƒ } | j d	 | d
 |  j ƒ  ƒ t j j | ƒ s  t ‚ | | f S(   NR$   Ra  R  R„  s   %s.1.mtzs   %s.1.pdbR  Rb  R.   R	  (   Rˆ  Rû   R*   R+   R  Rè   t   write_pdb_fileR	  (   R$   Ra  R  Rb  RT  R  R7  t   pdb_data(    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRÚ    s    

		c         C€  s±   |  j  j r t |  ƒ }  n  t d |  ƒ |  j d  k rJ t d d ƒ ‚ n  |  j j d  k rk t d ƒ ‚ n  |  j j	 d  k rŒ t d ƒ ‚ n  |  j
 j d  k r­ t d ƒ ‚ n  t S(   NRX   s;   Please select labels for the data to use.  Both amplitudes s'   or intensities and sigmas are required.s   Space group undefined.s   Unit cell undefined.s#   Please specify an output directory.(   Ro  Rp  Rq  Rr  R  Rc   R   R	  Ré   RÓ   R   t   gui_base_dirRû   (   RX   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   validate_params  s    c         C€  s¡  |  j  d  k r t d ƒ ‚ n  |  j j d  k r? t d ƒ ‚ n  t |  j j ƒ d k rj t d d ƒ ‚ n  xSt |  j j d d ƒD]9\ } } | j	 d  k r» | j
 r» t d | ƒ ‚ n  t d	 „  | j
 Dƒ ƒ rç t d
 | ƒ ‚ n  t d „  | j Dƒ ƒ rt d | ƒ ‚ n  | j d  k r5t d | ƒ ‚ n  | j d k  rSt d ƒ ‚ n  | j	 d  k rŽt d „  | j Dƒ ƒ rŽt d | ƒ ‚ n  | j	 d  k rƒ | j j rƒ t d | ƒ ‚ qƒ qƒ Wt d „  |  j j Dƒ ƒ sót d d d ƒ ‚ n  |  j d k rt d ƒ ‚ n  |  j d k  s/d |  j k  r>t d ƒ ‚ n  t d „  |  j Dƒ ƒ rft d ƒ ‚ n  t j d k r�|  j j d k r�t d d ƒ ‚ q�n  t S(    Ns   No reflections file defined!s'   Please specify a base output file name.i    s3   At least one component (including search model(s), s:   template model(s), or homology result(s)) must be defined.R<  i   s)   Molecular weight needed for component %d.c         s€  s$   |  ] } t  | j ƒ d  k Vq d S(   i    N(   Rç   R~  (   R   Rà  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>C  s    s*   Empty ensemble definition for component %dc         s€  s$   |  ] } t  | j ƒ d  k Vq d S(   i    N(   Rç   R~  (   R   Rà  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>F  s    s2   Empty model_collection definition for component %ds(   Must set stoichiometry for component %d.s.   Stoichiometry out-of-range: 0 <= stoichiometryc         s€  s   |  ] } | j  d  k Vq d  S(   N(   R5  Rc   (   R   Rç  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>O  s    sN   You must define the target sequence for component %d (required for alignment).sS   You must define the target sequence for component %d (required for homology_search)c         s€  s   |  ] } t  d  | ƒ Vq d S(   R{  N(   t   component_has_models(   R   R%  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>U  s    s7   You must either at least one automatic homology search sJ   to perform, or supply one or more ensembles, processed model collections, sF   template models, or homology search results for at least one components(   Specify positive number for packing_pools0   rotation_peaks_cutoff out-of-range: 0 <= RPC <=1c         s€  s$   |  ] } t  | j ƒ d  k Vq d S(   i    N(   Rç   R{  (   R   Rû  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pys	   <genexpr>b  s    s   Empty assembly definitiont   win32RZ   R]   s3   Only multiprocessing and threading are allowed for s,   parallel processing when running on Windows.(   RZ   R]   (   R  Rc   R   R   R  Rç   R-  R{  R   R2   R}  R"   R�  RŠ  R!  R>  R¥  R¢   R•   RN  t   syst   platformRS  R¿  Rû   (   RX   R9  R{  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRr  3  sH    %(c         C€  sj   t  |  j j ƒ d k pi t  |  j ƒ d k pi t  |  j ƒ d k pi t  |  j ƒ d k pi t  |  j ƒ d k S(   Ni    (   Rç   R>  R¥  R}  R�  R!  R3   (   R{  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyR¥  m  s
    c         C€  s�  t  j j d |  j j ƒ } t j d | ƒ j ƒ  } |  j j	 | j ƒ t
 |  j j ƒ d k se t ‚ |  j j |  j j d j _ |  j j |  j j d j _ xm |  j j D]_ } t  j j d | ƒ } t j d | ƒ j ƒ  } |  j j d j j | j j d j d ƒ qª Wxm |  j j D]_ } t  j j d | ƒ } t j d | ƒ j ƒ  } |  j j d j j | j j d j d ƒ qW|  S(   Ns'   
composition.component.sequence = "%s"
R   i   i    s+   
composition.component.template.pdb = "%s"
s1   
composition.component.homology.file_name = "%s"
(   R   t   philR   Ro  t   component_sequenceRh  R0   Rn  R-  t   __phil_join__Rç   R{  Rè   t   blast_servicesR>  R¥  t   max_blast_hitsR£  t   template_modelR!  R‹  R5  R3   (   RX   t
   param_philt
   new_paramsR!  R5  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRq  ~  s(    			t   launcherc           B€  s   e  Z d  „  Z RS(   c         C€  s¾   t  j j |  j ƒ s( t  j |  j ƒ n  t  j |  j ƒ t j d t ƒ } | j	 d |  j
 ƒ } t j d t j d d d t ƒ } t d | j d | ƒ } t t j d ƒ rº t j j ƒ  n  | S(	   NR  RÝ  Rb  t   leveli   t   guiR9   t   _flush(   R*   R+   t   isdirt
   output_dirt   makedirst   chdirR   t
   PCLIParserRh  t
   parse_argsRÝ  R   t   SingleStreamR§  RB   Rû   R  t   philst   hasattrR´  (   t   selfR:   RX   R9   R%   (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyR  š  s    !(   t   __name__t
   __module__R  (    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyR±  ™  s   t   write_filesc           B€  s   e  Z d  „  Z d „  Z RS(   c         C€  s(   | |  _  | |  _ | |  _ | |  _ d  S(   N(   Rÿ  Ré   RL  R¶  (   R¾  Rÿ  Ré   RL  R¶  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   __init__¨  s    			c         O€  s  t  j |  j ƒ xú |  j D]ï \ } } | j j ƒ  } | |  j k r xÂ t | j d d ƒD]¨ \ } } | |  j	 k rZ t
 j d t j ƒ } | j j j d | ƒ t d | j j ƒ  d | d d | |  j	 f d | j ƒ \ }	 }
 t  j j |	 ƒ t  j j |
 ƒ f SqZ Wq q Wd	 S(
   NR<  i   Rb  R9   R$   Ra  R  s   %s_%d(   NN(   R*   R¸  R¶  Rÿ  R_  R  Ré   R   RÓ  RL  R   R»  R§  RB   RR  Ru  RÚ  RÛ  R5   R+   RØ  Rc   (   R¾  RÝ  t   kwdsR   RI  RM  R=  Ra  R9   R7  R  (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   __call__®  s    "-(   R¿  RÀ  RÂ  RÄ  (    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyRÁ  §  s   	(b   t
   __future__R    R7   R   R   R   R   R   R¼   R   R   R   R	   t
   iotbx.philR   t   libtbxR
   R   t   libtbx.utilsR   R   R   RF   t   os.pathR*   R§  Re  Rf  R)   R/   R;   RÊ   RS   R¦  RY   R\   Rk   Rr   Rv   R{   R¾  R‚   R…   Rˆ   R©   R‹   RŒ   R�   R«   R³   R´   RÇ  t   SolutionProgresst   Datasett   Enantiomorpht
   PointgroupRÁ  R¿   RÃ   RÄ   RŒ  R©  R   t   choice_stringRz  t   valuesRc   t   get_known_protocolsRû   Rh  R  R  R  RÔ  Rœ  RÒ  R-  R3  R  R>  R&  RK  RN  RY  Rf  R€  R’  Ru  Rˆ  RÚ  R¤  Rr  R¥  Rq  t   target_with_save_resultR±  R…  RÁ  (    (    (    sE   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/pipeline/brunett.pyt   <module>   s  	3				.	
											
						
						
	"	
					
	ÿ „	
	
	
	
	
	
	
			Ž		ÿ ÿ 	8			6	(	1		
				'	E	C			:		