ó
|™xTc           @   s[  d  d l  m Z d  d l m Z d  d l m Z d  d l m Z d  d l m	 Z	 d  d l
 Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z e Z e j j d d ƒ rÈ e Z n  d	 e j f d
 „  ƒ  YZ d Z d Z d Z d Z d Z d Z d Z d Z  d Z! d Z" d Z# d Z$ d Z% d Z& d „  Z' e( d k rWe j) ƒ  n  d S(   iÿÿÿÿ(   t   division(   t	   format_80(   t   null_out(   t   matrix(   t   pdbNt   namet   phenixt   TestNcsGroupPreprocessingc           B   sŒ   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z RS(   s7    Test spec and phil, NCS and ASU information processingc         C   sz   t  j ƒ  |  _ t j d ƒ |  _ t  j |  j ƒ t j j	 d t
 ƒ |  _ t j	 d d d t
 ƒ |  _ |  j j ƒ  |  _ d S(   s=    Create temporary folder for temp files produced during test t   tempdirt
   pdb_stringt   source_infot   linesN(   t   ost   getcwdt   currnet_dirt   tempfilet   mkdtempR   t   chdirR   t	   hierarchyt   inputt   test_pdb_ncs_spect   pdb_objt   Nonet   pdb_inpt   construct_hierarchyt   ph(   t   self(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   setUp   s    c         C   s  t  j ƒ  j j GHd d g } i d d g d 6i d d g d 6d d g d 6g } d g d d g g } xz t t t g ƒ D]f \ } } t j j	 d	 | ƒ } |  j
 | j | | ƒ |  j
 | j | | ƒ |  j
 | j | | ƒ qx Wx3 t t t g D]" } |  j t t j j	 d	 | ƒqò Wd
 S(   s1    Verify that phil parameters are properly read   s	   (chain A)s   (chain A) or (chain B)s   chain Bs   chain Cs   chain As   chain Es   chain Ds   chain Ft   ncs_selection_paramsN(   t   syst	   _getframet   f_codet   co_namet	   enumeratet
   user_phil1t
   user_phil2t   iotbxt   ncsR   t   assertEqualt   ncs_selection_strt   ncs_to_asu_selectiont   ncs_chain_selectiont
   user_phil3t
   user_phil4t
   user_phil5t   assertRaisest   IOError(   R   t   expected_ncs_selectiont   expected_ncs_to_asut   expected_ncs_chainst   it	   phil_caset	   trans_objt   pc(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   test_phil_param_read   s    #	c         C   sz  t  j ƒ  j j GHt j j d t ƒ } t j	 j d t
 d | ƒ } d } |  j | j | ƒ i d d g d 6d d	 g d
 6} |  j | j | ƒ g  | j j ƒ  D] } | j ^ q� } d „  | j j ƒ  Dƒ } d „  | j j ƒ  Dƒ } |  j t | ƒ d ƒ |  j t | ƒ d d h ƒ |  j | d d d d d d h ƒ |  j | d d d d d d h ƒ |  j | j j t ƒ d ƒ d S(   s6    Verify that phil parameters are properly processed   R	   R   t   pdb_hierarchy_inps!   (chain A) or (chain B or chain C)s   chain Ds   chain Gs   chain As   chain E or chain Fs   chain H or chain Is   chain B or chain Cc         S   s   h  |  ] } | j  ’ q S(    (   t
   serial_num(   t   .0t   x(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pys	   <setcomp>E   s   	 c         S   s   h  |  ] } | ’ q S(    (    (   R9   R:   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pys	   <setcomp>F   s   	 i   i   i   i   i   i   t   005t   004t   006t   001t   003t   002N(   R   R   R   R    R   R   R   t   pdb_test_data2R$   R%   t   pdb_test_data2_philR&   R'   R(   t   ncs_transformt
   itervaluest   ncs_group_idt   iterkeyst   lent   sett   ncs_atom_selectiont   countt   True(   R   R   R4   t   expectedR:   t	   group_idst   tran_snt
   group_keys(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   test_phil_processing3   s&    	%""c      
   C   s†  t  j ƒ  j j GHt j j d t ƒ } t j	 j d t
 d | ƒ } |  j | j d ƒ i d d g d 6d d	 g d
 6} |  j | j | ƒ g  | j j ƒ  D] } | j ^ q— } d „  | j j ƒ  Dƒ } d „  | j j ƒ  Dƒ } | j d j } | j d j }	 |  j t | ƒ d ƒ |  j t | ƒ d d h ƒ |  j | d d d d d d h ƒ |  j | d d d d d d h ƒ |  j | j ƒ  ƒ t j d d d d d d d d d g	 ƒ }
 |	 |
 } t t | ƒ } |  j t | ƒ d k  ƒ d d  d! d" h } |  j | t | j j ƒ  ƒ ƒ |  j t | j d ƒ d# d g ƒ |  j t | j d
 ƒ d g ƒ d d  d! d" h } |  j | t | j  ƒ ƒ d$ S(%   s;     verify creation of transformations using superpose_pdb   R	   R   R7   s   (chain A) or (chain B)s   chain Cs   chain Es   chain As   chain Ds   chain Fs   chain Bc         S   s   h  |  ] } | j  ’ q S(    (   R8   (   R9   R:   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pys	   <setcomp>]   s   	 c         S   s   h  |  ] } | ’ q S(    (    (   R9   R:   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pys	   <setcomp>^   s   	 R<   R@   i   i   i   i   i   i   R;   R=   R>   R?   g2:=ïÆÓ?g™�žwãé¿g      à?g™�žwãé?g      à¿g{®Gáz„?s   chain A_002s   chain A_003s   chain B_005s   chain B_006i    N(!   R   R   R   R    R   R   R   t   pdb_test_data1R$   R%   t   pdb_test_data1_philR&   R'   R(   RC   RD   RE   RF   t   rRG   RH   t
   assertTruet   is_r3_identity_matrixR   t   sqrt   mapt   abst   maxt   ncs_to_asu_mapt   keyst   listt   asu_to_ncs_mapt   transform_chain_assignment(   R   R   R4   RL   R:   RM   RN   RO   t   r1t   r2t
   expected_rt   d(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   test_superpos_pdbN   s<    	%""$
# c      
   C   s  t  s d GHd Sd d l m } d d l m } t j ƒ  j j GH| j ƒ  } d | j _	 |  j
 j ƒ  } | j d d ƒ } |  j j | ƒ t d	 d
 ƒ } | |  j j d | j ƒ  ƒ IJ| j ƒ  | d d	 d t d t ƒ  d | ƒ } t j j d d d |  j ƒ } |  j t | j ƒ d ƒ d }	 |  j | j |	 ƒ |  j t | j ƒ d0 d1 d d ƒ |  j | j j t ƒ d4 ƒ i d d g d 6d g d 6}	 |  j | j |	 ƒ g  | j  j! ƒ  D] }
 |
 j" ^ q¶} d „  | j  j! ƒ  Dƒ } d „  | j  j# ƒ  Dƒ } | j  d j$ } | j  d  j$ } |  j t | ƒ d! ƒ |  j t% | ƒ d d h ƒ |  j | d d d d" d! h ƒ |  j | d# d  d$ d d% h ƒ |  j& | j' ƒ  ƒ t( j) d& d' d( d) d* d+ d, d- d. g	 ƒ } | | j* ƒ  } t+ t, | ƒ } |  j& t- | ƒ d/ k  ƒ d S(5   s%    verify creating and processing spec s2   Skipping test_spec_reading(): phenix not availableNiÿÿÿÿ(   t   simple_ncs_from_pdb(   t   ncs_master_paramsi   t   buffer_sizei   s   test_ncs_spec.pdbt   wt   crystal_symmetryt   pdb_filet   quiett   logt   paramst	   file_names   simple_ncs_from_pdb.ncs_specR7   i   s<   (chain A and (resseq 151:159)) or (chain D and (resseq 1:7))i	   i   i   s   chain B and (resseq 151:159)s   chain C and (resseq 151:159)s   chain A and (resseq 151:159)s   chain E and (resseq 1:7)s   chain D and (resseq 1:7)c         S   s   h  |  ] } | j  ’ q S(    (   R8   (   R9   R:   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pys	   <setcomp>©   s   	 c         S   s   h  |  ] } | ’ q S(    (    (   R9   R:   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pys	   <setcomp>ª   s   	 R<   R@   i   i   R>   R?   R;   gñcÌ]KÈß?gKY†8ÖÅë?gˆ…ZÓ¼ã„¿gF”ö_˜ä¿gn£¼Ø?gioð…ÉTå?gÂ&S£â?gøSã¥›ÄÔ¿g}®¶bÙç?g{®Gáz„?i   i   i   i   i   (.   t   have_phenixt'   phenix.command_line.simple_ncs_from_pdbRd   Re   R   R   R   R    t   extractt
   min_lengthR   t   xray_structure_simplet1   orthorhombic_unit_cell_around_centered_scatterersR   t   adopt_xray_structuret   opent   as_pdb_stringRh   t   closeRK   R   R$   R%   R   R   R&   RG   R^   R'   RI   RJ   R(   RC   RD   RE   RF   RS   RH   RT   RU   R   RV   t	   transposeRW   RX   RY   (   R   Rd   Re   Rl   t   xrst   xrs_unit_cellt   oft   ncs_from_pdbR4   RL   R:   RM   RN   RO   R_   R`   Ra   Rb   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   test_spec_readingz   s^    		
		%%$c         C   s   t  j ƒ  j j GHd  S(   N(   R   R   R   R    (   R   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   test_mmcif_readingº   s    c      
   C   s  t  s d GHd St j ƒ  j j GHt j j d |  j d t	 d t
 ƒ } |  j t | j ƒ d ƒ d } |  j | j | ƒ |  j t | j ƒ d* d+ d d ƒ |  j | j j t
 ƒ d. ƒ i d d g d 6d g d 6} |  j | j | ƒ g  | j j ƒ  D] } | j ^ q÷ } d „  | j j ƒ  Dƒ } d „  | j j ƒ  Dƒ } | j d j } | j d j } |  j t | ƒ d ƒ |  j t | ƒ d d	 h ƒ |  j | d d	 d d d h ƒ |  j | d d d d d h ƒ |  j | j ƒ  ƒ t j d d d d d d d  d! d" g	 ƒ }	 | |	 j ƒ  }
 t t |
 ƒ }
 |  j t |
 ƒ d# k  ƒ | j  d$ |  j j! d% t	 d& t	 d' t	 ƒ } t j j d( | ƒ } | j d j } | j d j } |  j | | ƒ | j } | j } |  j | | ƒ | j" d) } | j" d) } |  j | | ƒ d S(/   sL    processing complete ASU
    If MTRIX records are present, they are ignored s7   Skipping test_processing_of_asu(): phenix not availableNR7   t   use_cctbx_find_ncs_toolst   use_simple_ncs_from_pdbi   s<   (chain A and (resseq 151:159)) or (chain D and (resseq 1:7))i	   i   i   s   chain B and (resseq 151:159)s   chain C and (resseq 151:159)s   chain A and (resseq 151:159)s   chain E and (resseq 1:7)s   chain D and (resseq 1:7)c         S   s   h  |  ] } | j  ’ q S(    (   R8   (   R9   R:   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pys	   <setcomp>Þ   s   	 c         S   s   h  |  ] } | ’ q S(    (    (   R9   R:   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pys	   <setcomp>ß   s   	 R<   R@   i   i   i   R>   R?   R;   gñcÌ]KÈß?gKY†8ÖÅë?gˆ…ZÓ¼ã„¿gF”ö_˜ä¿gn£¼Ø?gioð…ÉTå?gÂ&S£â?gøSã¥›ÄÔ¿g}®¶bÙç?g{®Gáz„?t   pdb_hierarchy_asut   writet   format_for_resolvet   format_for_phenix_refinet   spec_ncs_groupss   chain A_003i   i   i   i   i   (#   Rn   R   R   R   R    R$   R%   R   R   t   FalseRK   R&   RG   R^   R'   RI   RJ   R(   RC   RD   RE   RF   RS   RH   RT   RU   R   RV   Rx   RW   RX   RY   t   get_ncs_info_as_specR   t   tr_id_to_selection(   R   R4   RL   R:   RM   RN   RO   R_   R`   Ra   Rb   t   spec_outputt
   trans_obj2t   t1t   t2(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   test_processing_of_asu¿   s^    		%%$				c      
   C   sb  t  s d GHd St j ƒ  j j GHt j j d |  j d t	 d t
 ƒ } |  j t | j ƒ d ƒ d } |  j | j | ƒ |  j t | j ƒ d/ d0 d d ƒ |  j | j j t	 ƒ d3 ƒ i d d g d 6d g d 6} |  j | j | ƒ g  | j j ƒ  D] } | j ^ q÷ } d „  | j j ƒ  Dƒ } d „  | j j ƒ  Dƒ } | j d j } | j d j } |  j t | ƒ d ƒ |  j t | ƒ d d	 h ƒ |  j | d d	 d d d h ƒ |  j | d d d d d h ƒ |  j | j ƒ  ƒ t j d d d d d d d  d! d" g	 ƒ }	 | |	 j ƒ  }
 t t |
 ƒ }
 |  j t |
 ƒ d# k  ƒ | j  d$ |  j j! d% t
 d& t
 d' t
 ƒ } t j j d( | ƒ } | j d j } | j d j } |  j | | ƒ | j } | j } i d d g d 6d g d 6} |  j | | ƒ i d) d* g d+ 6d, g d- 6} |  j | | ƒ | j" d. } | j" d. } |  j | d4 ƒ d5 } |  j | | ƒ d S(6   sL    processing complete ASU
    If MTRIX records are present, they are ignored s7   Skipping test_processing_of_asu(): phenix not availableNR7   R   R€   i   s   (chain A) or (chain D)i	   i   i   s   chain Bs   chain Cs   chain As   chain Es   chain Dc         S   s   h  |  ] } | j  ’ q S(    (   R8   (   R9   R:   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pys	   <setcomp>!  s   	 c         S   s   h  |  ] } | ’ q S(    (    (   R9   R:   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pys	   <setcomp>"  s   	 R<   R@   i   i   i   R>   R?   R;   gñcÌ]KÈß?gKY†8ÖÅë?gˆ…ZÓ¼ã„¿gF”ö_˜ä¿gn£¼Ø?gioð…ÉTå?gÂ&S£â?gøSã¥›ÄÔ¿g}®¶bÙç?g{®Gáz„?R�   R‚   Rƒ   R„   R…   s   chain B and (resseq 151:159)s   chain C and (resseq 151:159)s   chain A and (resseq 151:159)s   chain E and (resseq 1:7)s   chain D and (resseq 1:7)s   chain A_003i   i   i   i   i   (   s   chain As   chain C(   s   chain A and (resseq 151:159)s   chain C and (resseq 151:159)(#   Rn   R   R   R   R    R$   R%   R   R   RK   R†   R&   RG   R^   R'   RI   RJ   R(   RC   RD   RE   RF   RS   RH   RT   RU   R   RV   Rx   RW   RX   RY   R‡   R   Rˆ   (   R   R4   RL   R:   RM   RN   RO   R_   R`   Ra   Rb   R‰   RŠ   R‹   RŒ   t   t1_expt   t2_exp(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   test_processing_of_asu_2  sl    		%%$				c         C   s   t  j ƒ  j j GHd S(   sD     Verify correct processing of PDBs that have insertions residues   N(   R   R   R   R    (   R   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   test_insertion_processingO  s    c         C   s   t  j ƒ  j j GHd S(   s    Verify correct processing    N(   R   R   R   R    (   R   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   test_rotaion_translation_inputU  s    c         C   sÂ   t  j ƒ  j j GHt j j d t ƒ } t j	 j d t
 d | ƒ } | j d t ƒ } t
 | k } | pn t | k } |  j | ƒ t j	 j d t d |  j ƒ } | j d t ƒ } |  j | t ƒ d S(   s0    Verify correct printout of NCS phil parameters R	   R   R7   R‚   t   spec_file_strN(   R   R   R   R    R   R   R   RA   R$   R%   RB   t   print_ncs_phil_paramR†   t   pdb_test_data2_phil_reverseRT   t   test_ncs_specR   R&   t   test_phil_3(   R   R   R4   t   resultt   test(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   test_print_ncs_phil_param[  s    	c         C   sb   t  j ƒ  j j GHt j j d t d t d t	 ƒ } | j
 } i d d g d 6} |  j | | ƒ d  S(   NR	   R€   R   s   chain BsD   (chain C and (resid 1 and (name N or name CA or name C or name O )))sD   (chain A and (resid 1 and (name N or name CA or name C or name O )))(   R   R   R   R    R$   R%   R   t   pdb_strR†   RK   R(   R&   (   R   t   ncs_inpt   tt   exp_t(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   test_finding_partial_ncsm  s    		c         C   sk   t  j ƒ  j j GHg  t d ƒ D] } t | ƒ ^ q } d j | ƒ } t | ƒ } d } |  j | | ƒ d S(   sB    Check that strings longer that 80 characters are split correctly i2   t    s^   01234567891011121314151617181920212223242526272829303132333435363738394041424344 \ 
4546474849N(	   R   R   R   R    t   ranget   strt   joinR   R&   (   R   R:   t   sR˜   RL   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt!   test_format_string_longer_than_80‹  s    %c         C   s$   t  j |  j ƒ t j |  j ƒ d S(   s    remove temp files and folder N(   R   R   R   t   shutilt   rmtreeR   (   R   (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   tearDown•  s    (   t   __name__t
   __module__t   __doc__R   R6   RP   Rc   R}   R~   R�   R�   R‘   R’   Rš   RŸ   R¥   R¨   (    (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyR      s   					,	@		E	K					
s   CRYST1   26.628   30.419   28.493  90.00  90.00  90.00 P 1
ATOM      1  N   THR A   1      15.886  19.796  13.070  1.00 10.00           N
ATOM      2  CA  THR A   1      15.489  18.833  12.050  1.00 10.00           C
ATOM      3  C   THR A   1      15.086  17.502  12.676  1.00 10.00           C
ATOM      4  O   THR A   1      15.739  17.017  13.600  1.00 10.00           O
ATOM      5  CB  THR A   1      16.619  18.590  11.033  1.00 10.00           C
ATOM      6  OG1 THR A   1      16.963  19.824  10.392  1.00 10.00           O
ATOM      7  CG2 THR A   1      16.182  17.583   9.980  1.00 10.00           C
TER       8      THR A   1
ATOM      1  N   THR B   1      10.028  17.193  16.617  1.00 10.00           N
ATOM      2  CA  THR B   1      11.046  16.727  15.681  1.00 10.00           C
ATOM      3  C   THR B   1      12.336  16.360  16.407  1.00 10.00           C
ATOM      4  O   THR B   1      12.772  17.068  17.313  1.00 10.00           O
remark ATOM      5  CB  THR B   1      11.356  17.789  14.609  1.00 10.00           C
remark ATOM      6  OG1 THR B   1      10.163  18.098  13.879  1.00 10.00           O
remark ATOM      7  CG2 THR B   1      12.418  17.281  13.646  1.00 10.00           C
TER      16      THR B   1
ATOM      1  N   THR C   1      12.121   9.329  18.086  1.00 10.00           N
ATOM      2  CA  THR C   1      12.245  10.284  16.991  1.00 10.00           C
ATOM      3  C   THR C   1      13.707  10.622  16.718  1.00 10.00           C
ATOM      4  O   THR C   1      14.493  10.814  17.645  1.00 10.00           O
ATOM      5  CB  THR C   1      11.474  11.584  17.284  1.00 10.00           C
ATOM      6  OG1 THR C   1      10.087  11.287  17.482  1.00 10.00           O
ATOM      7  CG2 THR C   1      11.619  12.563  16.129  1.00 10.00           C
TER      24      THR C   1
END
sß  ATOM    749  O   UNK A  90      28.392  67.262  97.682  1.00  0.00           O
ATOM    750  N   UNK A  91      30.420  66.924  98.358  1.00  0.00           N
TER
ATOM   1495  N   UNK B  67      33.124   2.704 114.920  1.00  0.00           N
TER
ATOM    749  O   UNK C  90       3.199  86.786  85.616  1.00  0.00           O
ATOM    750  N   UNK C  91       4.437  88.467  85.044  1.00  0.00           N
TER
ATOM   1495  N   UNK D  67      65.508  63.662  77.246  1.00  0.00           N
TER
ATOM    749  O   UNK E  90     -26.415  72.437  94.483  1.00  0.00           O
ATOM    750  N   UNK E  91     -27.678  74.103  93.921  1.00  0.00           N
TER
ATOM   1495  N   UNK F  67       7.362 108.699  49.412  1.00  0.00           N
TER
sÎ   ncs_group {
  master_selection = 'chain A'
  copy_selection = 'chain C'
  copy_selection = 'chain E'
}
ncs_group {
  master_selection = 'chain B'
  copy_selection = 'chain D'
  copy_selection = 'chain F'
}
s"  ATOM    749  O   UNK A  90      28.392  67.262  97.682  1.00  0.00           O
ATOM    750  N   UNK B  91      30.420  66.924  98.358  1.00  0.00           N
ATOM    750  N   UNK X  93      38.420  76.924  58.358  1.00  0.00           N
ATOM   1495  N   UNK C  67      33.124   2.704 114.920  1.00  0.00           N
TER
ATOM    749  O   UNK D  90       3.199  86.786  85.616  1.00  0.00           O
ATOM    750  N   UNK E  91       4.437  88.467  85.044  1.00  0.00           N
ATOM   1495  N   UNK F  67      65.508  63.662  77.246  1.00  0.00           N
TER
ATOM    749  O   UNK G  90     -26.415  72.437  94.483  1.00  0.00           O
ATOM    750  N   UNK H  91     -27.678  74.103  93.921  1.00  0.00           N
ATOM   1495  N   UNK I  67       7.362 108.699  49.412  1.00  0.00           N
TER
sã   ncs_group {
  master_selection = chain A
  copy_selection = chain D
  copy_selection = chain G
}
ncs_group {
  master_selection = chain B or chain C
  copy_selection = chain E or chain F
  copy_selection = chain H or chain I
}
sã   ncs_group {
  master_selection = chain B or chain C
  copy_selection = chain E or chain F
  copy_selection = chain H or chain I
}
ncs_group {
  master_selection = chain A
  copy_selection = chain D
  copy_selection = chain G
}
s  ncs_group {
  master_selection = chain D and (resseq 1:7)
  copy_selection = chain E and (resseq 1:7)
}
ncs_group {
  master_selection = chain A and (resseq 151:159)
  copy_selection = chain B and (resseq 151:159)
  copy_selection = chain C and (resseq 151:159)
}
sg   ncs_group {
  master_selection = 'chain A'
  copy_selection = 'chain B'
  copy_selection = 'chain C'
}
s±   ncs_group {
  master_selection = 'chain A'
  copy_selection = 'chain B'
  copy_selection = 'chain C'
}
ncs_group {
  master_selection = 'chain B'
  copy_selection = 'chain D'
}
s±   ncs_group {
  master_selection = 'chain A'
  copy_selection = 'chain C'
  copy_selection = 'chain D'
}
ncs_group {
  master_selection = 'chain B'
  copy_selection = 'chain D'
}
s±   ncs_group {
  master_selection = 'chain A'
  copy_selection = 'chain C'
  copy_selection = 'chain D'
}
ncs_group {
  master_selection = 'chain C'
  copy_selection = 'chain E'
}
s€  CRYST1  577.812  448.715  468.790  90.00  90.00  90.00 P 1
SCALE1      0.001731  0.000000  0.000000        0.00000
SCALE2      0.000000  0.002229  0.000000        0.00000
SCALE3      0.000000  0.000000  0.002133        0.00000
ATOM      1  CA  LYS A 151      10.766   9.333  12.905  1.00 44.22           C
ATOM      2  CA  LYS A 152      10.117   9.159  11.610  1.00 49.42           C
ATOM      3  CA  LYS A 153       9.099   8.000  11.562  1.00 46.15           C
ATOM      4  CA  LYS A 154       8.000   8.202  11.065  1.00 52.97           C
ATOM      5  CA  LYS A 155      11.146   9.065  10.474  1.00 41.68           C
ATOM      6  CA  LYS A 156      10.547   9.007   9.084  1.00 55.55           C
ATOM      7  CA  LYS A 157      11.545   9.413   8.000  1.00 72.27           C
ATOM      8  CA  LYS A 158      12.277  10.718   8.343  1.00 75.78           C
ATOM      9  CA  LYS A 159      11.349  11.791   8.809  1.00 75.88           C
TER
ATOM    222  CA  LEU X  40      94.618  -5.253  91.582  1.00 87.10           C
ATOM    223  CA  ARG X  41      62.395  51.344  80.786  1.00107.25           C
ATOM    224  CA  ARG X  42      62.395  41.344  80.786  1.00107.25           C
TER
ATOM      1  CA  THR D   1       8.111  11.080  10.645  1.00 20.00           C
ATOM      2  CA  THR D   2       8.000   9.722  10.125  1.00 20.00           C
ATOM      3  CA  THR D   3       8.075   8.694  11.249  1.00 20.00           C
ATOM      4  CA  THR D   4       8.890   8.818  12.163  1.00 20.00           C
ATOM      5  CA  THR D   5       9.101   9.421   9.092  1.00 20.00           C
ATOM      6  CA  THR D   6       9.001  10.343   8.000  1.00 20.00           C
ATOM      7  CA  THR D   7       8.964   8.000   8.565  1.00 20.00           C
TER
ATOM      1  CA  LYS B 151       6.855   8.667  15.730  1.00 44.22           C
ATOM      2  CA  LYS B 152       5.891   8.459  14.655  1.00 49.42           C
ATOM      3  CA  LYS B 153       6.103   7.155  13.858  1.00 46.15           C
ATOM      4  CA  LYS B 154       5.138   6.438  13.633  1.00 52.97           C
ATOM      5  CA  LYS B 155       5.801   9.685  13.736  1.00 41.68           C
ATOM      6  CA  LYS B 156       4.731   9.594  12.667  1.00 55.55           C
ATOM      7  CA  LYS B 157       4.334  10.965  12.119  1.00 72.27           C
ATOM      8  CA  LYS B 158       4.057  11.980  13.238  1.00 75.78           C
ATOM      9  CA  LYS B 159       3.177  11.427  14.310  1.00 75.88           C
TER
ATOM      1  CA  LYS C 151       6.987   4.106  17.432  1.00 44.22           C
ATOM      2  CA  LYS C 152       6.017   3.539  16.502  1.00 49.42           C
ATOM      3  CA  LYS C 153       6.497   3.492  15.036  1.00 46.15           C
ATOM      4  CA  LYS C 154       6.348   2.458  14.400  1.00 52.97           C
ATOM      5  CA  LYS C 155       4.647   4.221  16.634  1.00 41.68           C
ATOM      6  CA  LYS C 156       3.552   3.605  15.788  1.00 55.55           C
ATOM      7  CA  LYS C 157       2.154   3.953  16.298  1.00 72.27           C
ATOM      8  CA  LYS C 158       2.014   3.732  17.811  1.00 75.78           C
ATOM      9  CA  LYS C 159       2.558   2.413  18.250  1.00 75.88           C
TER
ATOM    222  CA  LEU Y  40     194.618   5.253  81.582  1.00 87.10           C
ATOM    223  CA  ARG Y  41     162.395  41.344  70.786  1.00107.25           C
ATOM    224  CA  ARG Y  42     162.395  31.344  70.786  1.00107.25           C
TER
ATOM      1  CA  THR E   1       8.111 -10.645  11.080  1.00 20.00           C
ATOM      2  CA  THR E   2       8.000 -10.125   9.722  1.00 20.00           C
ATOM      3  CA  THR E   3       8.075 -11.249   8.694  1.00 20.00           C
ATOM      4  CA  THR E   4       8.890 -12.163   8.818  1.00 20.00           C
ATOM      5  CA  THR E   5       9.101  -9.092   9.421  1.00 20.00           C
ATOM      6  CA  THR E   6       9.001  -8.000  10.343  1.00 20.00           C
ATOM      7  CA  THR E   7       8.964  -8.565   8.000  1.00 20.00           C
TER
s¶  
Summary of NCS information
Fri Jun 13 13:18:12 2014
C:\Phenix\Dev\Work\work\junk

new_ncs_group
new_operator

rota_matrix    1.0000    0.0000    0.0000
rota_matrix    0.0000    1.0000    0.0000
rota_matrix    0.0000    0.0000    1.0000
tran_orth     0.0000    0.0000    0.0000

center_orth   10.5384    9.4098   10.2058
CHAIN A
RMSD 0.0
MATCHING 9
  RESSEQ 151:159

new_operator

rota_matrix    0.4966    0.8679   -0.0102
rota_matrix   -0.6436    0.3761    0.6666
rota_matrix    0.5824   -0.3245    0.7453
tran_orth    -0.0003   -0.0002    0.0003

center_orth    5.1208    9.3744   13.7718
CHAIN B
RMSD 0.0005
MATCHING 9
  RESSEQ 151:159

new_operator

rota_matrix   -0.3180    0.7607    0.5659
rota_matrix   -0.1734   -0.6334    0.7541
rota_matrix    0.9321    0.1416    0.3334
tran_orth     0.0002    0.0004   -0.0006

center_orth    4.5304    3.5021   16.4612
CHAIN C
RMSD 0.0005
MATCHING 9
  RESSEQ 151:159

new_ncs_group
new_operator

rota_matrix    1.0000    0.0000    0.0000
rota_matrix    0.0000    1.0000    0.0000
rota_matrix    0.0000    0.0000    1.0000
tran_orth     0.0000    0.0000    0.0000

center_orth    8.5917    9.4397    9.9770
CHAIN D
RMSD 0.0
MATCHING 7
  RESSEQ 1:7

new_operator

rota_matrix    1.0000    0.0000    0.0000
rota_matrix    0.0000   -0.0000    1.0000
rota_matrix    0.0000   -1.0000   -0.0000
tran_orth     0.0000   -0.0000    0.0000

center_orth    8.5917   -9.9770    9.4397
CHAIN E
RMSD 0.0
MATCHING 7
  RESSEQ 1:7




c          C   s%   d g }  t  j t t |  ƒ ƒ } | S(   sÃ     Run selected tests

  1) List in "tests" the names of the particular test you want to run
  2) Comment out unittest.main()
  3) Un-comment unittest.TextTestRunner().run(run_selected_tests())
  R6   (   t   unittestt	   TestSuiteRW   R   (   t   testst   suite(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   run_selected_testsÒ  s    	t   __main__(*   t
   __future__R    t   iotbx.ncs.ncs_preprocessR   t   libtbx.utilsR   t   scitbxR   R$   R   t	   iotbx.ncsR¬   R   R¦   R   R   t   libtbx.load_envt   libtbxR†   Rn   t   envt
   has_moduleRK   t   TestCaseR   R›   RQ   RR   RA   RB   R•   R—   R"   R#   R*   R+   R,   R   R–   R°   R©   t   main(    (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/ncs/tst_ncs_groups_preprocessing.pyt   <module>   sB   	ÿ £=O	