ó
±™xTc           @   s�   d  d l  m Z d  d l m Z d  d l m Z d  d l Z d  d l Z d Z d
 d d d „ Z
 d „  Z e d k r‰ e
 e j d	 ƒ n  d S(   iÿÿÿÿ(   t   division(   t   Sorry(   t   make_sub_headerNsþ  
adp_statistics
  .short_caption = ADP statistics
  .caption = This tool displays tables and plots of statistics for isotropic     and anisotropic ADPs in a PDB file.  You can get the same information on     the command line by running phenix.pdbtools model_statistics=True     model.pdb.
  .style = box auto_align caption_img:icons/custom/phenix.pdbtools.png
{
  pdb_file = None
    .type = path
    .optional = False
    .short_caption = PDB file
    .style = bold file_type:pdb input_file
  cif_file = None
    .type = path
    .multiple = True
    .optional = True
    .short_caption = Restraints (CIF) file
    .style = file_type:cif input_file
  selection = all
    .type = atom_selection
    .short_caption = Atom selection
    # FIXME
    .style = no_view
}
c         C   s!  | d  k r t j } n  | d  k ro d d  l } | j j d |  d t d d d d d d	 ƒ } | j j ƒ  } n  t	 | ƒ d d  l
 } d d  l } d d
 l m } | j d | j j g | j j d t d | ƒ } | j d t ƒ } | j j d | d t ƒ }	 | j j d | j ƒ  d | j j d |	 d | ƒ }
 t d d | ƒ| j j d  k	 rã|
 j ƒ  j ƒ  } | j | j j ƒ } | j t ƒ } | d k r¥t d ƒ ‚ qã|
 j | ƒ }
 | d | IJ| d | j j IJ| d IJn  |
 j ƒ  } | j j | _  | j j | _ | j! d | ƒ | S(   Niÿÿÿÿt   argst   master_phil_stringt   pdb_file_defs   adp_statistics.pdb_filet   cif_file_defs   adp_statistics.cif_filet   usage_stringsµ   phenix.b_factor_statistics model.pdb [restraints.cif] [selection=...]

Show statistics for atomic displacement parameters (ADPs) or B-factors,
including TLS contribution if present.(   t   pdb_interpretationt6   substitute_non_crystallographic_unit_cell_if_necessaryt   logt   show_energiest   geometryt   normalizationt   xray_structuret   pdb_hierarchyt   restraints_managers   Analyzing model B-factorst   outi    s   No atoms in selection!s    Extracted %d atoms in selection:s     %st    ("   t   Nonet   syst   stdoutt
   iotbx.philt   philt   process_command_line_with_filest   master_philt   workt   extractt   validate_paramst   mmtbx.modelt   mmtbx.restraintst   mmtbx.monomer_libraryR   t   runt   adp_statisticst   pdb_filet   cif_filet   Truet   geometry_restraints_managert
   restraintst   managert   modelR   t   all_chain_proxiesR   R   t	   selectiont   atom_selection_cachet   countR   t   selectt	   file_namet   show_1(   R   t   paramsR   t   iotbxt   cmdlinet   mmtbxR   t   processed_pdb_fileR   R   R(   t	   sel_cacheR*   t   n_selt   stats(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/b_factor_statistics.pyR    '   sX    	
				c         C   sL   |  j  j d  k r! t d ƒ ‚ n' t j j |  j  j ƒ sH t d ƒ ‚ n  d  S(   Ns+   A PDB file is required to run this program.s,   The path %s is not a file or does not exist.(   R!   R"   R   R   t   ost   patht   isfile(   R0   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/b_factor_statistics.pyR   Z   s    t   __main__i   (    (   t
   __future__R    t   libtbx.utilsR   t   libtbx.str_utilsR   R8   R   R   R   R    R   t   __name__t   argv(    (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/b_factor_statistics.pyt   <module>   s   3	