ó
¼™xTc           @   sÖ  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	 d  d l
 m Z d  d l 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 m Z d  d l m Z d  d l m Z d  d l Z d  d l Z d  d l m Z d  d l Z d Z d „  Z d „  Z d „  Z  d „  Z! d „  Z" d „  Z# d „  Z$ d „  Z% d „  Z& d „  Z' d „  Z( d „  Z) d „  Z* d „  Z+ d d d „ Z- d „  Z. d  „  Z/ d! „  Z0 d S("   iÿÿÿÿ(   t   division(   t   flexN(   t   utils(   t   reflection_file_reader(   t   reflection_file_utils(   t   StringIO(   t   crystal_symmetry_from_any(   t   adptbx(   t   Sorry(   t
   group_args(   t   pdb(   t   xray(   t   mapss�  pdb_file_name = None
  .type = str
  .multiple = False
  .help = PDB file name (model only).
external_da_pdb_file_name = None
  .type = str
  .multiple = False
  .help = PDB file name (dummy atoms only).
reflection_file_name = None
  .type = str
  .help = File with experimental data (most of formats: CNS, SHELX, MTZ, etc).
data_labels = None
  .type = str
  .help = Labels for experimental data.
refine = *occupancies *adp *sites
  .type = choice(multi=True)
  .help = Parameters of DA to refine.
stop_reset_occupancies_at_macro_cycle = 5
  .type = int
  .help = Reset occupancies during first stop_reset_occupancies_at_macro_cycle           macro-cycles.
stop_reset_adp_at_macro_cycle = 5
  .type = int
  .help = Reset ADPs during first stop_reset_adp_at_macro_cycle macro-cycles.
start_filtering_at_macro_cycle=10
  .type = int
  .help = Macro-cycle number at which filtering takes off.
sphere
  .multiple=True
  {
    center = None
      .type = floats(size=3)
      .help = Approximate coordinates of the center of problem density.
    radius = None
      .type = float
      .help = Sphere radius of where the dummy atoms will be placed.
  }
mode = build *build_and_refine
  .type = choice(multi=False)
high_resolution = None
  .type = float
low_resolution = None
  .type = float
output_file_name_prefix = None
  .type = str
initial_occupancy = 0.1
  .type = float
  .help = Starting occupancy value for a newly placed DA
initial_b_factor = None
  .type = float
  .help = Starting B-factor value for a newly palced DA. Of None, then           determined automatically as mean B.
atom_gap = 0.7
  .type = float
  .help = Thje gap between the atoms in the grid.
  .expert_level = 2
overlap_interval = 0.25
  .type = float
  .help = Grid interval size - the gap between two grids.
  .expert_level = 2
atom_type = H
  .type = str
  .help = Atom to use to make grid. Nitrogen is a good choice
atom_name = " DA "
  .type = str
residue_name = DUM
  .type = str
  .help = Residue name for a DA
scattering_table = *n_gaussian wk1995 it1992 neutron
  .type = choice
  .help = Scattering table for structure factors calculations
number_of_refinement_cycles = 20
  .type = int
  .help = Number of refinement cycles
number_of_minimization_iterations = 25
  .type = int
  .help = Number of refinement iterations
filter
  {
    b_iso_min = 1.0
      .type = float
      .help = Min B-factor value to remove DA.
    b_iso_max = 100.0
      .type = float
      .help = Max B-factor value to remove DA.
    occupancy_min = 0.1
      .type = float
      .help = Min occupancy value to remove DA.
    occupancy_max = 10.0
      .type = float
      .help = Max occupancy value to remove DA.
    inside_sphere_scale = 1.2
      .type = float
      .help = DA with distance larger than sphere.radius*inside_sphere_scale               from sphere.center will be removed.
    da_model_min_dist = 1.
      .type = float
      .help = Max allowable distance between DA and any model atom.
  }
c           C   s   t  j j t d t ƒS(   Nt   process_includes(   t   iotbxt   philt   parset   master_params_strt   False(    (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt   master_params|   s    c         C   s°  d „  } g  } x9 | j  D]. } | j | d | d | j d | j ƒ ƒ q W| j } | d  k r… t j |  j ƒ  t	 j
 d ƒ ƒ } n  g  } d } xrt | | j  ƒ D]^\ } } d } xI| j D]>}	 x5| j D]*}
 x!| j D]} | d 7} | d k rqà n  | d 7} t j |	 |
 | g ƒ } t d | d	 | j d | j d
 | j d | d | j d | j d | j ƒ } t d | d |  j ƒ  ƒ } |  j d | j ƒ  d d ƒ } | j d k } | | j d k  M} | j | ƒ } | d k rà | j | ƒ qà qà WqÐ WqÀ Wq¤ Wg  } x� t | ƒ D]� \ } } x€ t | ƒ D]r \ } } | | k	 r2| j d | j ƒ  d d ƒ } | j d k } | | j | j k  M} | j | ƒ | | <q2q2WqW| S(   Nc         S   s½   t  j |  j ƒ } | t |  j ƒ \ } } } | t |  j ƒ \ } } }	 t | d | d | | ƒ }
 t | d | d | | ƒ } t | d | d | | ƒ } t d |
 d | d | ƒ S(   Ni    i   i   t   x_ranget   y_ranget   z_range(   R   t   doublet   centert   floatt   radiust   frangeR	   (   t   spheret   gapt   overlapt   ct   x_startt   y_startt   z_startt   x_endt   y_endt   z_endR   R   R   (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt   grid€   s    R   R   R   g      ð?i    i   R   R   t	   occupancyt   b_factort	   atom_namet   scattering_typet   resnamet	   pdb_atomst   crystal_symmetryt
   sites_fract   distance_cutoffi   (   R   t   appendt   atom_gapt   overlap_intervalt   initial_b_factort   NoneR   t   meant   extract_u_iso_or_u_equivR   t   u_as_bt   zipR   R   R   R   t	   make_gridR   t   initial_occupancyR)   t	   atom_typet   residue_namet   pdb_atoms_as_xray_structureR-   t   closest_distancesR.   t   smallest_distancest   selectt	   enumerate(   t   xray_structuret   paramsR&   t   gridsR   R3   t   da_xray_structurest   countert   cntr_gR    R!   R"   t
   new_centert	   atom_gridt   da_xray_structuret   closest_distances_resultt	   selectiont   resultt   it   x1t   jt   x2(    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt   create_da_xray_structures   sf    		
 
							 		c         C   sô  | d  k	 r d GH| g } n d GHt d | d | ƒ } d } x$ | D] } | | j ƒ  j ƒ  7} qD Wd G| GH| j ƒ  } | j d k rþ t j j j	 ƒ  }	 t
 |	 _ t j j d | d | d	 d
 d |	 d |  ƒ }
 |
 j d t ƒ d |
 j ƒ  |
 j ƒ  f GHn  | j ƒ  } t j | j ƒ  j ƒ  t ƒ } xt | ƒ D]ö \ } } d | | j ƒ  j ƒ  f GHt j | j ƒ  j ƒ  t ƒ } | j | ƒ } | j t j | j ƒ  j ƒ  t
 ƒ ƒ | j t j | j ƒ  j ƒ  t
 ƒ ƒ | j d k r5|
 j d t
 d t d | ƒ t d |
 d | d | d | ƒ } |
 j } q5q5Wt j | j ƒ  j ƒ  t ƒ } | j t j | j ƒ  j ƒ  | j ƒ  j ƒ  t
 ƒ ƒ | j | ƒ } | j } | d  k r¯d } n
 | d } t | d ƒ } | j ƒ  } | | IJ| j d k rët j d d ƒ } t j  ƒ  j! t j" | ƒ ƒ j	 ƒ  } t j# d |
 d | j$ d ƒ } t j% d | j$ d ƒ } | j& d | j' ƒ  d | ƒ } | j( d | ƒ j) ƒ  } | j* d | d d ƒ | j+ ƒ  } d } | j d  k	 rØ| j d  } n  | j, d! | ƒ n  d" GHd  S(#   Ns   Using external DA...s   Start creating DAs...RB   RC   i    s   Total number of dummy atoms:t   build_and_refinet   r_free_flagst   target_namet   mlt   mask_paramst   f_obst   optimize_masks$   START R-work and R-free: %6.4f %6.4fs   Model %d, adding %d dummy atomst   update_f_calct   update_f_maskt   fmodelRL   t   da_sel_refinables   DA.pdbs   _DA.pdbt   wt   map_name_strings   2mFo-DFct
   map_paramst   column_root_labelt   label_decoratort   miller_arrayt   Fcalc_das   map_coeffs.mtzs   _map_coeffs.mtzt	   file_namet   Finished(-   R4   RR   t
   scattererst   sizet   deep_copy_scattererst   modet   mmtbxt   maskst   mask_master_paramst   extractt   Truet   ignore_hydrogenst   f_modelt   managert   update_solvent_and_scaleR   t   r_workt   r_freeR   t   boolRA   t   concatenatet   extendt   update_xray_structuret	   refine_daRB   R@   t   output_file_name_prefixt   opent   as_pdb_filet	   map_namesR   t   map_and_map_coeff_master_paramst   fetcht   cast_map_coeff_paramst   map_coefficients_from_fmodelt   map_coefficientst   map_coeffs_mtz_label_managert   as_mtz_datasett
   amplitudest!   structure_factors_from_scattererst   f_calct   add_miller_arrayt
   mtz_objectt   write(   RX   RT   RB   t   xray_structure_daRC   RE   t   n_dat   daxrst   xray_structure_startRW   R\   t   xray_structure_currentt
   da_sel_allt   i_modelRJ   R]   t   all_da_xray_structuret   ofnt   pdb_file_strt   map_type_objR`   t   coeffst   lbl_mgrt   mtz_datasett	   f_calc_daRŠ   t   output_map_file_name(    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt   grow_density¼   s”    			%%			

					c         C   s”  | j  ƒ  d k r d  S|  j ƒ  j j ƒ  j d t ƒ t j j d | ƒ } | d k rx |  j ƒ  j j ƒ  j	 d | ƒ n  | d k r¦ |  j ƒ  j j ƒ  j
 d | ƒ n  | d k rÔ |  j ƒ  j j ƒ  j d | ƒ n  y( t j j j d |  d	 | d
 t ƒ } Wn) t k
 r'} d GHt | ƒ GHd GHd  SX|  j ƒ  j } |  j d | d t d t ƒ | j |  j ƒ  j k sqt ‚ |  j ƒ  j j ƒ  j d t ƒ d  S(   Ni    t   statet   max_iterationst   occupanciest
   iselectiont   adpt   sitest   fmodelst   lbfgs_termination_paramst   collect_monitors   ERROR: Refinement failed... s   ... carry onRB   RZ   R[   (   Rh   t   fmodel_xrayRB   Rg   t   flags_set_gradsR   t   scitbxt   lbfgst   termination_parameterst   flags_set_grad_occupancyt   flags_set_grad_u_isot   flags_set_grad_siteRk   t
   refinementt   minimizationt	   Exceptiont   strRy   Ro   t   AssertionError(   R£   t   number_of_iterationsR    t	   parameterR¤   t	   minimizedt   et   xrs(    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt   refinery  s:     	


c         C   s¶   |  j  ƒ  j } | j ƒ  j ƒ  } | | j j k  } | | M} | j | | j j ƒ } | | j j k } | | M} | j | | j j ƒ } | j | ƒ |  j	 d | d t
 d t ƒ d  S(   NRB   RZ   R[   (   R¦   RB   Rg   t   extract_occupanciest   filtert   occupancy_mint   set_selectedt   occupancy_maxt   set_occupanciesRy   Ro   R   (   R£   RL   RC   R·   t   occt   sel(    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt   reset_occupancies3  s    

c         C   sÂ   |  j  ƒ  j } | j ƒ  t j d ƒ } | | j j k } | | M} | j | | j j ƒ } | | j j k  } | | M} | j | | j j ƒ } | j	 d | ƒ } |  j
 d | d t d t ƒ d  S(   Ng      ð?t   valuesRB   RZ   R[   (   R¦   RB   R6   R   R7   Rº   t	   b_iso_maxR¼   t	   b_iso_mint	   set_b_isoRy   Ro   R   (   R£   RL   RC   R·   t   bRÀ   (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt
   reset_adps@  s    

c         C   sÄ  d } | | |  j  ƒ  j ƒ  |  j  ƒ  j ƒ  | j t ƒ | j t ƒ |  j  ƒ  j j ƒ  j ƒ  f GH|  j  ƒ  j j ƒ  j	 ƒ  } | j
 | ƒ } | j ƒ  d k rÀ| j
 | ƒ } d t j | ƒ t j | ƒ t j | ƒ f GHd t j | ƒ t j | ƒ t j | ƒ f GH|  j  ƒ  j j ƒ  t j d ƒ } | j
 | ƒ }	 | j
 | ƒ }
 d t j |
 ƒ t j |
 ƒ t j |
 ƒ f GHd t j |	 ƒ t j |	 ƒ t j |	 ƒ f GHd G| j ƒ  G| j t ƒ GHn  d  S(	   NsA   %s Rwork= %8.6f Rfree= %8.6f Number of: non-DA= %d DA= %d all= %di    s5            non-da: occ(min,max,mean)= %6.3f %6.3f %6.3fs5                da: occ(min,max,mean)= %6.3f %6.3f %6.3fg      ð?s5            non-da: ADP(min,max,mean)= %7.2f %7.2f %7.2fs5                da: ADP(min,max,mean)= %7.2f %7.2f %7.2fs   da_sel_refinable:(   R¦   Rt   Ru   t   countR   Ro   RB   Rg   Rh   R¹   R@   R   t   mint   maxR5   R6   R   R7   (   R£   RL   R]   t   prefixt   fmt1R¿   t   occ_dat   occ_maRÆ   t   b_dat   b_ma(    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt   show_refinement_updateM  s,    ****c      	   C   s§   t  d |  d | j d | j ƒ  d d ƒ | j | k rS t d |  d | d | ƒ n  | j | k rƒ t |  | | | ƒ \ }  } } n  t |  | | d | ƒ |  | | f S(	   NR£   R³   R    R´   RŸ   RL   RC   s	   occ(%2d):(   R¸   t!   number_of_minimization_iterationsR    t%   stop_reset_occupancies_at_macro_cycleRÁ   t   start_filtering_at_macro_cyclet	   filter_daRÑ   (   R£   RL   R]   RC   t   macro_cycle(    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt   refine_occupanciese  s    	!c      	   C   s§   t  d |  d | j d | j ƒ  d d ƒ | j | k rS t d |  d | d | ƒ n  | j | k rƒ t |  | | | ƒ \ }  } } n  t |  | | d | ƒ |  | | f S(	   NR£   R³   R    R´   R¡   RL   RC   s	   adp(%2d):(   R¸   RÒ   R    t   stop_reset_adp_at_macro_cycleRÇ   RÔ   RÕ   RÑ   (   R£   RL   R]   RC   RÖ   (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt
   refine_adpr  s    	!c      	   C   s|   t  d |  d | j d | j ƒ  d d ƒ | j | k rX t |  | | | ƒ \ }  } } n  t |  | | d | ƒ |  | | f S(   NR£   R³   R    R´   R¢   s	   xyz(%2d):(   R¸   RÒ   R    RÔ   RÕ   RÑ   (   R£   RL   R]   RC   RÖ   (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt   refine_sites  s    	!c         C   s
  |  j  ƒ  j } | j | ƒ } | j | ƒ } | j ƒ  j ƒ  } | j ƒ  t j d ƒ } | | j j	 k  }	 |	 | | j j
 k M}	 |	 | | j j k  M}	 |	 | | j j k M}	 | j ƒ  }
 t } t | j ƒ d k rÝ t } n  x; | j D]0 } | j | j g j d  ƒ d k rç t } qç qç Wxt | j ƒ  ƒ D]ð \ } } | rÕt } xv | j D]k } | j | j g j d  ƒ d k rP|
 j | |
 j | j ƒ ƒ } | | j | j j k r»t } Pq»qPqPW| sÕt |	 | <qÕn  xF | j ƒ  D]8 } |
 j | | ƒ } | | j j k  rât |	 | <PqâqâWq.Wt j | j ƒ  j ƒ  t ƒ } | j |	 ƒ | j | ƒ } | j |	 ƒ } | j  | ƒ } t j | j ƒ  j ƒ  t ƒ } | j t j | j ƒ  j ƒ  t ƒ ƒ |  j! d | d t d t ƒ | j ƒ  | j ƒ  k s÷t" ‚ | } |  | | f S(   Ng      ð?i    RB   RZ   R[   (#   R¦   RB   R@   Rg   R¹   R6   R   R7   Rº   R½   R»   RÃ   RÄ   t	   unit_cellRo   t   lenR   R   R   R   RÈ   R4   RA   R.   t   distancet   fractionalizet   inside_sphere_scalet   da_model_min_distR   Rv   Rh   Rx   Rw   Ry   R²   (   R£   RL   R]   RC   R·   t   xrs_dt   xrs_mR¿   R¡   RÀ   t   uct   sphere_definedR   t   i_seqt   site_frac_dt   insidet   distt   site_frac_mt   sel_all(    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyRÕ   Š  sX     	! ! 
%c         C   sl  t  j d |  ƒ } t | | | d ƒ | j } | | j k sC t ‚ | | j k sX t ‚ | | j k sm t ‚ xø t | ƒ D]ê } d | j	 k rÂ t
 d | d | d | d | d | ƒ \ } } } n  d	 | j	 k rt d | d | d | d | d | ƒ \ } } } n  d
 | j	 k rFt d | d | d | d | d | ƒ \ } } } n  |  j | j ƒ  j k sz t ‚ qz W| S(   NR¦   s     START:RŸ   R£   RL   R]   RC   RÖ   R¡   R¢   (   Rk   R£   RÑ   t   number_of_refinement_cyclesRÓ   R²   RØ   RÔ   t   xranget   refineR×   RÙ   RÚ   RB   R¦   (   R\   RL   RC   R]   R£   t   nrmRÖ   (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyRz   º  s<    	"c         C   s‚   t  j d | ƒ } | j ƒ  } x] |  D]U } t  j d | j d | j | j ƒ d | j d | j d | j	 ƒ } | j
 | ƒ q% W| S(   NR-   t   labelt   siteRÆ   R'   R*   (   R   t	   structureRÛ   t	   scatterert   nameRÞ   t   xyzRÆ   R¿   t   elementt   add_scatterer(   R,   R-   RB   RÛ   t   atomRò   (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyR=   Ú  s    				c         C   so  |  t  | ƒ \ } }	 }
 |  t  | ƒ \ } } } t | | | ƒ } t |	 | | ƒ } t |
 | | ƒ } g  } d } xô | D]ì } xã | D]Û } xÒ | D]Ê } t j | |  d d | |  d d | |  d d ƒ } | | k  r• t j j j ƒ  } | | _ | | _	 | | _
 | | _ | | | f | _ | | _ | | _ | | _ | j | ƒ | d 7} q• q• Wqˆ Wq{ W| S(   Ni   i    i   (   R   R   t   matht   sqrtR   R
   t	   hierarchyt   atom_with_labelst   serialRó   R+   t   resseqRô   R¿   RÆ   Rõ   R0   (   R   R   R   R'   R(   R)   R*   R+   R    R!   R"   R#   R$   R%   R   R   R   RM   RF   t   xt   yt   zt   dR÷   (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyR9   ç  s0    ;							c         C   s�   | d  k r |  d } d }  n  | d  k r4 d } n  g  } x\ |  t | ƒ | } | d k rm | | k rm Pn | d k  r‰ | | k r‰ Pn  | j | ƒ q= | S(   Ng        g      ð?i    (   R4   RÜ   R0   (   t   startt   endt   inct   Lt   next(    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyR     s    
		c      	   C   s%   t  j d |  d t d | d t ƒ  ƒ S(   NR-   t   force_symmetryt   reflection_filest   err(   R   t   reflection_file_serverRo   R   (   R-   R  (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyR
    s
    	c         C   sÿ   d } t  |  ƒ d k r@ | GHd d GHt ƒ  j ƒ  d d GHd  St j j |  d ƒ si t  |  ƒ d k r{ d G|  GHd GHd  St j d |  d	 t ƒ  d
 d  ƒ } | j	 j
 ƒ  } | j d  k rè t  | j ƒ d k sÕ t ‚ | j d | _ n  t d | d | ƒ d  S(   Ns1  
Tool for local improvement of electron density map.

How to use:
1: Run this command: phenix.grow_density
2: Copy, save into a file and edit the parameters shown between the
   lines *** below. Do not include *** lines.
3: Run the command with this parameters file:
   phenix.grow_density parameters.txt
i    t   *iO   i   sC   Parameter file is expected at input. This is not a parameter file:
sB   Run phenix.grow_density without argumets for running instructions.t   argsR   t   logt   processed_argsRC   (   RÜ   R   t   showt   ost   patht   isfileR   t   process_command_line_argsR4   RC   Rn   t   pdb_file_namet   pdb_file_namesR²   t   run(   R  t   command_namet   msgR  RC   (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt   cmd_run  s&    		)c         C   sš  | j  d k r t d ƒ ‚ n  d  } g  } xQ t | j ƒ t | j ƒ g D]1 } t j | ƒ } | d  k	 rI | j | ƒ qI qI Wt	 | ƒ d k r� | d } nQ t	 | ƒ d k r¾ t d ƒ ‚ n0 | d j
 | d ƒ sä t d	 ƒ ‚ n  | d } t j d
 | j d t ƒ } t d | d | g ƒ } t j ƒ  j ƒ  } | j d  k	 rT|  j g | _ n  t j d | d | d t d t ƒ  ƒ }	 |	 j }
 |	 j } | d  k rÌ|
 j d t j |
 j ƒ  j ƒ  t ƒ ƒ } d  } n  t j j  d
 | j ƒ j! ƒ  } d  } | j" d  k	 r t j j  d
 | j" ƒ j! ƒ  } n  |
 j# d | j$ d | j% ƒ }
 | j# d | j$ d | j% ƒ } | j& d k sqt' ‚ t( d |
 d | d | d | d | ƒ d  S(   Nt
   n_gaussiant   wk1995t   it1992t   neutrons   Incorrect scattering_table.i   i    s   No crystal symmetry found.s2   Crystal symmetry mismatch between different files.Re   t   ensure_read_accessR-   R  R
  t
   parameterst
   keep_goingR  t   datat   d_mint   d_maxt   buildRS   RX   RT   RB   RŒ   RC   (   R  R  R  R  (   s   builds   build_and_refine()   t   scattering_tableR   R4   R±   R  t   reflection_file_nameR   t   extract_fromR0   RÜ   t   is_similar_symmetryR   t   any_reflection_fileRo   R
  R   t   data_and_flags_master_paramsRn   t   data_labelst   labelst   determine_data_and_flagsR   RX   RT   t   arrayR   Rv   R!  Rh   R   R   R
   t   inputt   xray_structure_simplet   external_da_pdb_file_namet   resolution_filtert   high_resolutiont   low_resolutionRj   R²   Rœ   (   R  RC   R-   t   crystal_symmetriest   ft   cst   reflection_filet   rfsR  t   determine_data_and_flags_resultRX   RT   t   test_flag_valueRB   RŒ   (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyR  9  sd    	%  
				*	(1   t
   __future__R    t   cctbx.array_familyR   t   mmtbx.f_modelRk   R   R   R   R   t	   cStringIOR   t
   iotbx.philR   t   cctbxR   t   libtbx.utilsR   R  Rø   t   libtbxR	   R
   R   t   mmtbx.refinement.minimizationt   scitbx.lbfgsR¨   R   t   mmtbx.masksR   R   RR   Rœ   R¸   RÁ   RÇ   RÑ   R×   RÙ   RÚ   RÕ   Rz   R=   R9   R4   R   R
  R  R  (    (    (    s@   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/grow_density.pyt   <module>   sJ   g		=	Y								0	 				 