ó
„™xTc           @   sa   d  d l  m Z d  d l Z d  d l Z d  d l Z d „  Z e d k r] e e j d ƒ n  d S(   iÿÿÿÿ(   t   divisionNc      	   C   sR  t  |  ƒ d k r! t d ƒ ‚ n  t j j j } t d d d d d g ƒ } x |  D]ø } t j j j d | ƒ } | j j	 ƒ  j
 ƒ  x§ | j j ƒ  D]– } x� | j ƒ  D] } xv | j ƒ  D]h } x_ | j ƒ  D]Q } | j | k rÌ x9 | j ƒ  D]( }	 |	 j | k rî | j d	 |	 ƒ qî qî WqÌ qÌ Wq¹ Wq¦ Wq“ Wd
 | }
 | j j d |
 ƒ qR Wd  S(   Ni    s*   Please specify one or more pdb file names.s    N  s    CA s    C  s    O  s    CB t	   file_namet   atomt   v2_truncated_to_ala_(   t   lent   RuntimeErrort   iotbxt   pdbt   amino_acid_codest   one_letter_given_three_lettert   sett	   hierarchyt   inputt   overall_countst   showt   modelst   chainst   residue_groupst   atom_groupst   resnamet   atomst   namet   remove_atomt   write_pdb_file(   t   argst   aa_resnamest   ala_atom_namesR   t   pdb_objt   modelt   chaint   rgt   agR   t
   output_pdb(    (    sZ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/examples/pdb_truncate_to_ala/v2_simple.pyt   run   s"    *
t   __main__i   (	   t
   __future__R    t	   iotbx.pdbR   t   iotbx.pdb.amino_acid_codest   sysR!   t   __name__t   argv(    (    (    sZ   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/examples/pdb_truncate_to_ala/v2_simple.pyt   <module>   s   	