ó
‰™xTc           @   s�   d  d l  m Z d  d l Z d  d l m Z d  d l Z d  d l m Z m	 Z	 d  d l
 Z d „  Z d „  Z d „  Z e d k r‹ e ƒ  n  d S(	   iÿÿÿÿ(   t   divisionN(   t   StringIO(   t   approx_equalt	   show_diffc          C   s!  t  j j d d d t j j ƒ }  t  j j d d d t j j ƒ } |  d  k sZ | d  k rc d GHd  St j j	 d |  ƒ } | j
 ƒ  } t j j	 d | ƒ } | j
 ƒ  } | j | ƒ j } | j } | j | ƒ j } t | ƒ t | ƒ k oõ d k n s t ‚ t | | ƒ g  | D] }	 |	 j ^ q}
 t j j j | |
 ƒ } | j | j ƒ  ƒ t j j j ƒ  } | | d <t ƒ  } | | IJ| j d	 ƒ t j j	 d
 | j ƒ  d d  ƒ j
 ƒ  } | j | ƒ j } t | ƒ t | ƒ k oìd k n s÷t ‚ t | | ƒ t  j j d d d t j j ƒ }  t  j j d d d t j j ƒ } t j j	 d |  ƒ } | j
 ƒ  } | j | ƒ j } t j j	 d | ƒ } | j
 ƒ  } | j } | j | ƒ j } t | ƒ t | ƒ k oØd k n sãt ‚ t | | ƒ g  | D] }	 |	 j ^ q÷}
 t j j j | |
 ƒ } | j | j ƒ  ƒ t j j j ƒ  } | | d <t ƒ  } | | IJ| j d	 ƒ t j j	 d
 | j ƒ  d d  ƒ j
 ƒ  } | j | ƒ j } t | ƒ t | ƒ k oÏd k n sÚt ‚ t | | ƒ t  j j d d d t j j ƒ } t j j	 d | ƒ } | j
 ƒ  } | j } | j | ƒ j } t | ƒ d k s\t ‚ | d	 } t | j d d d d d d g ƒ s�t ‚ t | j d d d d d d g ƒ sºt ‚ t | j d d d  d! d" d# d$ d d% g	 ƒ sít ‚ t | j d& d' d( g ƒ st ‚ t | j d) ƒ s&t ‚ g  | D] }	 |	 j ^ q-}
 t j j j | |
 ƒ } | j | j ƒ  ƒ t j j j ƒ  } | | d* <t ƒ  } | | IJ| j d	 ƒ t j j	 d
 | j ƒ  d d  ƒ j
 ƒ  } | j | ƒ j } t | ƒ t | ƒ k od k n st ‚ t | | ƒ d  S(+   Nt   relative_paths   phenix_regression/pdb/3orl.pdbt   tests   phenix_regression/pdb/3orl.cifsC   Skipping exercise_mmcif_tls(): missing phenix_regression directory.t	   file_namei   t   3orli    t   linest   source_infos   phenix_regression/pdb/4g9h.pdbs   phenix_regression/pdb/4g9h.cifi   t   4g9hs   phenix_regression/pdb/2xw9.cifi   g)\�Âõ(œ?gM„O¯”?glxz¥,CŒ?g-Cëâ6:¿g/n£¼‚?g-Cëâ6*¿g¯”eˆc]¬?g�€&Â†§—?g-!ôlV­?g¦
F%uŠ¿gÇº¸�ð†?gœÄ °rh‘¿g-Cëâ6¿ga2U0*©S¿g¬­Ø_vOn¿ga2U0*©C¿gü©ñÒMbP?gÇº¸�ðF?gHPüs×b¿g’ËH¿}M¿g/Ý$�ó¿g¶óýÔxéø?g-²�ï§F*@s   (chain A and resseq 1:228)t   2xw9(    t   libtbxt   envt   find_in_repositoriest   ost   patht   isfilet   Nonet   iotbxt   pdbt   inputt   construct_hierarchyt   extract_tls_paramst
   tls_paramst	   cif_blockt   lent   AssertionErrort   check_tls_paramst   selection_stringt   mmcift   tls_as_cif_blockt   updatet   as_cif_blockt   cift   modelR   t   seekt	   readlinesR   t   tt   lt   st   origin(   t   pdb_filet
   mmcif_filet	   pdb_inputt   pdb_hierarchyt	   cif_inputt   cif_hierarchyt   pdb_tls_paramsR   t   cif_tls_paramst   tlst   selection_stringst	   cif_modelR(   t   cif_hierarchy_recycledt   tls_params_recycledt   cif_tls(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/pdb/tst_tls.pyt   exercise_mmcif_tls
   s²    	.
	
.	.
	
.	
''0!
	
.c         C   s¬   x¥ t  |  | ƒ D]” \ } } t | j | j ƒ s7 t ‚ t | j | j ƒ sR t ‚ t | j | j ƒ sm t ‚ t | j | j ƒ sˆ t ‚ t | j | j ƒ s t ‚ q Wd  S(   N(	   t   zipR   R&   R   R'   R(   R)   R   R   (   t   params1t   params2t   tls1t   tls2(    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/pdb/tst_tls.pyR   v   s    c           C   s   t  ƒ  d GHd  S(   Nt   OK(   R8   (    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/pdb/tst_tls.pyt   run   s    t   __main__(   t
   __future__R    R   t	   cStringIOR   t   libtbx.load_envR   t   libtbx.test_utilsR   R   t	   iotbx.pdbR   R8   R   R?   t   __name__(    (    (    s?   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/pdb/tst_tls.pyt   <module>   s   	l			