ó
±™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	 m
 Z
 d  d l m Z d  d l Z d  d l Z e j j d	 „ Z e d
 k rº e e j d ƒ n  d S(   iÿÿÿÿ(   t   division(   t   pdb_interpretation(   t   server(   t   option_parser(   t   flex(   t   plural_s(   t   show_stringNc         C   sU  t  |  ƒ d k r d g }  n  t d d | ƒ j d  d d d d d	 d
 d  d d d d ƒj d  d d d d d d
 d  d d d d ƒj d |  d d ƒ } | j } t j ƒ  } t j ƒ  } t j d | d | d | j	 d d t
 j ƒ } H| j } | j j ƒ  } | j }	 t j |	 j ƒ  t ƒ }
 xŒ | j	 d D]} } | GH| j d	 | d | ƒ } |
 j | t ƒ | j s.d t | j ƒ  ƒ GHx) |	 j | ƒ D] } d | j ƒ  GHq�Wq.q.WH| j rQd Gt | j ƒ GH| j j |
 ƒ } | j d  k rø| j } n6 d d  l } | j j  d  | j! ƒ  j" ƒ  d! | j ƒ } | j d | j d" | d# t ƒ Hn  d  S($   Ni    s   --helpt   usages"   %s pdb_file "atom_selection" [...]s   --write_pdb_filet   actiont   storet   typet   stringt   defaultt   helps$   write selected atoms to new PDB filet   metavart   FILEs!   --cryst1_replacement_buffer_layert   floats`   replace CRYST1 with pseudo unit cell covering the selected atoms plus a surrounding buffer layert   WIDTHt   argst	   min_nargsi   t   mon_lib_srvt   ener_libt	   file_namet   logi   t   caches     %d atom%s selecteds       %ss   Writing file:iÿÿÿÿt
   sites_cartt   buffer_layert   crystal_symmetryt
   append_end(#   t   lenR   t   optiont   Nonet   processt   optionsR   R   R   R   t   syst   stdoutt   all_chain_proxiest   pdb_hierarchyt   atom_selection_cachet	   pdb_atomsR   t   boolt   sizet   Falset
   iselectiont   set_selectedt   Truet   write_pdb_fileR   t   selectt   format_atom_recordR   t   cryst1_replacement_buffer_layert   special_position_settingst   cctbx.crystalt   crystalt   non_crystallographic_symmetryt   atomst   extract_xyz(   R   t   command_namet   command_linet   coR   R   t   processed_pdb_filet   acpt   selection_cacheR6   t   all_bselt   selection_stringt   iselt   atomt   sel_hierarchyR   t   cctbx(    (    sS   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/pdb_atom_selection.pyt   run   sj     											t   __main__i   (   t
   __future__R    t   mmtbx.monomer_libraryR   R   t   iotbx.option_parserR   t   cctbx.array_familyR   t   libtbx.utilsR   t   libtbx.str_utilsR   t   libtbx.load_envt   libtbxR"   t   envt   dispatcher_nameRD   t   __name__t   argv(    (    (    sS   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/pdb_atom_selection.pyt   <module>   s   8