ó
šxTc           @   sz   d  d l  m Z d  d l m Z m Z d  d l Z d  d l Z d  d l Z d d „ Z
 e d k rv e
 e j d ƒ n  d S(   iÿÿÿÿ(   t   division(   t   Sorryt   UsageNc         C   sñ  | d  k r t j } n  t |  ƒ d k s6 d |  k ra d |  k rR |  j d ƒ n  t d ƒ ‚ n  d d  l } d d  l } t j	 j
 d d t ƒ} | j j d |  d | d	 | d
 t d t d t ƒ } | j } | j | j g j d  ƒ d k rt d d ƒ ‚ n  | j j ƒ  j ƒ  s%t d ƒ ‚ n  | j d  k	 rG| j d | _ n  t j ƒ  } | j j d | j d | j d | j d t d | ƒ } t j ƒ  }	 | d |	 | IJt | j j d ƒ }
 |
 j | j ƒ  ƒ |
 j ƒ  | d | j j IJd  S(   Ni    s   --helpsT   phaser.find_anomalous_substructure model.pdb data.mtz wavelength=0.9792|energy=12141iÿÿÿÿs­   
  include scope mmtbx.utils.cmdline_input_phil_str
  output_file = phaser_AX.pdb
    .type = path
  wavelength = None
    .type = float
  energy = None
    .type = float
  t   process_includest   argst   master_philt   outt   process_pdb_filet   create_fmodelt   prefer_anomalousi   s;   Please specify either the wavelength (in Angstroms) or the s   energy (in eV).s0   Anomalous data are required to run this program.g5Ý÷T67È@t   fmodelt   pdb_hierarchyt
   wavelengtht   verboset   logs   elapsed time: %.1fst   ws   Wrote %s(   i    i   (    t   Nonet   syst   stdoutt   lent   removeR   t   phaser.substructuret   mmtbx.utilst   libtbxt   philt   parset   Truet   utilst   cmdline_load_pdb_and_datat   Falset   paramst   energyR   t   countR   R
   t   f_obst   anomalous_flagt   timet   substructuret   find_anomalous_scatterersR   t   opent   output_filet   writet   as_pdb_stringt   close(   R   R   t   phasert   mmtbxR   t   cmdlineR   t   t1t   resultt   t2t   f(    (    s]   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/command_line/find_anomalous_substructure.pyt   run   sL     			!				
t   __main__i   (   t
   __future__R    t   libtbx.utilsR   R   t   libtbx.philR   R#   R   R   R2   t   __name__t   argv(    (    (    s]   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/phaser/command_line/find_anomalous_substructure.pyt   <module>   s   .