ó
‚™xTc           @   sL   d  d l  m Z d „  Z e d k rH d  d l Z e d e j d ƒ n  d S(   iÿÿÿÿ(   t   divisionc         C   sä  t  |  ƒ d k s t ‚ d d  l } g  } xF |  D]> } | j j d | ƒ } | j ƒ  j ƒ  | j | j ƒ  ƒ q1 Wi  } x | d D] } | | | j	 <q„ Wg  } xF | d D]: } | j
 | j	 ƒ } | d  k	 r¬ | j | | f ƒ q¬ q¬ Wt  | ƒ d k st ‚ d d l m }	 |	 j ƒ  }
 |	 j ƒ  } x6 | D]. } |
 j | d j ƒ | j | d j ƒ q1Wd d  l } | j j j d |
 d | ƒ } | j ƒ  j |
 ƒ } d	 G| d j ƒ  GHd
 G| d j ƒ  GHd G|
 j ƒ  GHd | GHd  S(   Ni   iÿÿÿÿt	   file_namei    i   (   t   flext   reference_sitest   other_sitess   Number of atoms first pdb: s   Number of atoms second pdb:s   Number of superposed atoms:s
   RMSD: %.3f(   t   lent   AssertionErrort	   iotbx.pdbt   pdbt   inputt   construct_hierarchyt   only_residuet   appendt   atomst   namet   gett   Nonet   scitbx.array_familyR   t   vec3_doublet   xyzt   scitbx.math.superposet   matht	   superposet   least_squares_fitt   other_sites_best_fitt   rms_differencet   size(   t   argst   iotbxt   lists_of_atomsR   t   pdb_inpt   lookup_dictt   atom_it
   atom_pairst   atom_jR   R   R   t   pairt   scitbxt   fitt   rmsd(    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/command_line/pdb.superpose_atoms_by_name.pyt   run   s>    	t   __main__NR   i   (   t
   __future__R    R'   t   __name__t   syst   argv(    (    (    s\   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/command_line/pdb.superpose_atoms_by_name.pyt   <module>   s   	!