ó
±™xTc           @   s˜   d  d l  m Z d  d l Z d  d l m Z d  d l Z d  d l Z d „  Z d d d d d	 d
 g Z e j	 d „ Z
 e d k r” e
 e j d ƒ n  d S(   iÿÿÿÿ(   t   divisionN(   t   Autoc          C   s#   d d l  m }  |  d t d d ƒ S(   Niÿÿÿÿ(   t    generate_master_phil_with_inputst   enable_automatic_twin_detectiont   phil_stringsÑ  
hetatms_only = True
  .type = bool
skip_xtal_solution_mols = False
  .type = bool
  .help = If True, common crystallization components such as sulfate or     glycerol will be ignored.
skip_single_atoms = True
  .type = bool
skip_alt_confs = True
  .type = bool
min_acceptable_cc = 0.8
  .type = float
min_acceptable_2fofc = 1.0
  .type = float
max_frac_atoms_below_min = 0.5
  .type = float
write_coot_script = True
  .type = bool
write_maps = Auto
  .type = bool
(   t   mmtbx.command_lineR   t   True(   R   (    (    sY   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/show_suspicious_residues.pyt   master_phil   s    t   SO4t   GOLt   EDOt   PEGt   ACTt   BMEc         C   sÈ  d } d d l  m } d d l m } | d |  d t ƒ  d | d t d	 | ƒ } | j } g  } | j rq t } n  | j	 d
 | j
 d | j d | j d | j d | j d | d | j d | j d | j d | ƒ 
} d  }	 | j t k st | ƒ d k rß| j t t g k rßd d  l }
 d d  l } |
 j j j | j
 ƒ \ } } d  } | j
 j ƒ  j ƒ  ry|
 j j j | j
 ƒ } n  t j  j! t j  j" | j# j$ j% ƒ d ƒ } | d }	 | j& j' d | d | d |	 d | ƒ d |	 GHn  t | ƒ d k rÄ| j( rÄt) j* j+ d d d t j  j, ƒ } t- d d ƒ } | j. t- | ƒ j/ ƒ  ƒ | j. d  ƒ x( | j# j0 j% D] } | j. d! | ƒ q`W|	 d  k	 r›| j. d" |	 ƒ n  | j. d# t1 | ƒ ƒ | j2 ƒ  d$ GHn  d  S(%   Ns¤   mmtbx.show_suspicious_residues [model] [data] [options...]

Flag bad residues based on fit to electron density.  By default, only HETATM
records will be inspected.
iÿÿÿÿ(   t   real_space_correlation(   t   load_model_and_datat   argsR   t   outt   process_pdb_filet   usage_stringt   fmodelt   pdb_hierarchyt   hetatms_onlyt   skip_single_atomst   skip_alt_confst   ignore_resnamest   min_acceptable_cct   min_acceptable_2fofct   max_frac_atoms_below_mint   logi    s	   _maps.mtzt
   fwt_coeffst   delfwt_coeffst	   file_namet   anom_coeffss   Wrote maps to %st   relative_paths(   cctbx_project/cootbx/simple_zoom_list.pyt   tests   coot_bad_residues.pyt   ws   
s   read_pdb("%s")
s#   auto_read_make_and_draw_maps("%s")
sN   
draw_simple_zoom_list(
  title="Residues in suspicious density",
  items=%s)
s#   Coot script is coot_bad_residues.py(3   t   mmtbxR   R   R   R   t   Falset   paramst   skip_xtal_solution_molst   common_xtal_molst   find_suspicious_residuesR   R   R   R   R   R   R   R   t   Nonet
   write_mapsR   t   lenR   t   mmtbx.maps.utilst   iotbx.map_toolst   mapst   utilst   get_maps_from_fmodelt   f_obst   anomalous_flagt   get_anomalous_mapt   ost   patht   basenamet   splitextt   inputt	   xray_dataR    t	   map_toolst   write_map_coeffst   write_coot_scriptt   libtbxt   envt   find_in_repositoriest   isfilet   opent   writet   readt   pdbt   strt   close(   R   R   R   R   R   t   cmdlineR'   t   ignore_listt   outlierst   map_fileR%   t   iotbxt   f_mapt   diff_mapt   anom_mapt	   base_namet   zoom_list_baset   scriptR    (    (    sY   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/show_suspicious_residues.pyt   run'   sr    															'	"

t   __main__i   (   t
   __future__R    t   libtbx.load_envR?   R   t   sysR6   R   R)   t   stdoutRT   t   __name__t   argv(    (    (    sY   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/show_suspicious_residues.pyt   <module>   s   	C