ó
Ž™xTc           @   sp   d  d l  m Z d  d l m Z d  d l Z d  d l Z d „  Z d „  Z e d k rl e ƒ  e ƒ  d GHn  d S(   iÿÿÿÿ(   t   division(   t   easy_runNc          C   sh   t  j j d d d t j j ƒ }  |  d  k r6 d GHd  St j d |  ƒ j	 ƒ  } | j
 d k sd t ‚ d  S(   Nt   relative_paths3   phenix_regression/reflection_files/ha_patterson.mtzt   tests)   phenix_regression not available, skippings   cctbx.patterson_map "%s"i    (   t   libtbxt   envt   find_in_repositoriest   ost   patht   isfilet   NoneR   t   fully_bufferedt   raise_if_errorst   return_codet   AssertionError(   t   mtz_filet   result(    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/tst_patterson.pyt   exercise_simple   s    c          C   sc  d d  l  }  |  j j j d d ƒ } | j j ƒ  } | j j ƒ  j d ƒ } | j t ƒ d k sf t	 ‚ | j j
 | ƒ j d | ƒ } | j ƒ  } t | j d d ƒ j ƒ  ƒ } t | j d d ƒ j ƒ  ƒ } | j ƒ  j ƒ  } | j d	 d
 ƒ j ƒ  j d ƒ | j d	 d ƒ j ƒ  j d ƒ d d g }	 t j d d j |	 ƒ ƒ j ƒ  }
 |
 j d k s_t	 ‚ d  S(   Niÿÿÿÿt
   pdb_stringsR  ATOM     47  N   TYR A   7       8.292   1.817   6.147  1.00 14.70           N
ATOM     48  CA  TYR A   7       9.159   2.144   7.299  1.00 15.18           C
ATOM     49  C   TYR A   7      10.603   2.331   6.885  1.00 15.91           C
ATOM     50  O   TYR A   7      11.041   1.811   5.855  1.00 15.76           O
ATOM     51  CB  TYR A   7       9.061   1.065   8.369  1.00 15.35           C
ATOM     52  CG  TYR A   7       7.665   0.929   8.902  1.00 14.45           C
ATOM     53  CD1 TYR A   7       6.771   0.021   8.327  1.00 15.68           C
ATOM     54  CD2 TYR A   7       7.210   1.756   9.920  1.00 14.80           C
ATOM     55  CE1 TYR A   7       5.480  -0.094   8.796  1.00 13.46           C
ATOM     56  CE2 TYR A   7       5.904   1.649  10.416  1.00 14.33           C
ATOM     57  CZ  TYR A   7       5.047   0.729   9.831  1.00 15.09           C
ATOM     58  OH  TYR A   7       3.766   0.589  10.291  1.00 14.39           O
ATOM     59  OXT TYR A   7      11.358   2.999   7.612  1.00 17.49           O
ATOM    100 CL   CL  B   1      12.000   5.000  10.000  1.00 10.00          CL
s   not resname CLi   t   crystal_symmetryt   d_ming      ø?t   column_root_labelt   Is   tmp_patterson_1.mtzt   Fs   tmp_patterson_2.mtzs)   cctbx.isomorphous_difference_patterson %st    i    (   t   iotbx.pdb.hierarchyt   pdbt	   hierarchyt   inputt   xray_structure_simplet   atom_selection_cachet	   selectiont   countt   FalseR   t   selectt   as_pdb_inputt   abst   structure_factorst   f_calct	   f_as_f_sqt#   set_observation_type_xray_intensityt   as_mtz_datasett
   mtz_objectt   writeR   R   t   joinR   R   (   t   iotbxt   pdb_int   xrs_1t   selt   pdb_in_2t   xrs_2t   fc1t   fc2t   ic1t   argsR   (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/tst_patterson.pyt   exercise_isomorphous   s(    					t   __main__t   OK(	   t
   __future__R    R   R   t   libtbx.load_envR   R   R7   t   __name__(    (    (    sL   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/tst_patterson.pyt   <module>   s   		%