ó
‚™xTc           @   sk   d  d l  m Z d  d l m Z m Z d  d l Z d Z e j d „ Z e	 d k rg e e j
 d ƒ n  d S(   iÿÿÿÿ(   t   division(   t   Sorryt   UsageNsJ   
pdb_file = None
  .type = path
selection = None
  .type = atom_selection
c         C   sC  d „  } t  |  ƒ d k r% | ƒ  n  d d  l } d d  l } d d l m } d  } | j j d |  d t d d ƒ } | j	 j
 ƒ  } | j d  k rœ | ƒ  n  | j j j d	 | j ƒ } t  | j j ƒ  ƒ d k rè t d
 | j ƒ ‚ n+ t | j ƒ j d k rt d d ƒ ‚ n  | j j ƒ  } | d  k r=t d ƒ ‚ n  | j j ƒ  }	 | j t  |	 ƒ t ƒ }
 | j d  k	 r‘| j j ƒ  j | j ƒ }
 n  d } xŠ t | ƒ D]| \ } } |
 | sÀq¤n  t  | ƒ d k r¤| d 7} | d |	 | j ƒ  IJx) | D] } | d |	 | j ƒ  IJqûWq¤q¤W| d k r?t d ƒ ‚ n  d  S(   Nc           S   s   t  d ƒ ‚ d  S(   Nsq   iotbx.pdb.show_connectivity model.pdb

Extracts the bondes specified by CONECT records and displays the atom IDs.(   R   (    (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/command_line/pdb_show_connectivity.pyt
   show_usage   s    i    iÿÿÿÿ(   t   flext   argst   master_phil_stringt   pdb_file_deft   pdb_filet	   file_names5   '%s' is not a PDB file or does not contain any atoms.t	   cif_inputs8   Only PDB-format files are supported - mmCIF format does s"   not contain the necessary records.s$   No CONECT records found in PDB file.i   s   %s:s     %ss0   No atoms with CONECT records found in selection.(   t   lent   iotbx.pdb.hierarchyt
   iotbx.philt   scitbx.array_familyR   t   Nonet   philt   process_command_line_with_filest   master_philt   workt   extractR   t   pdbt	   hierarchyt   inputt   atomsR   t   typet   __name__t   extract_connectivityt   boolt   Truet	   selectiont   atom_selection_cachet	   enumeratet   id_str(   R   t   outR   t   iotbxR   t   pdb_inpt   cmdlinet   paramst   bondsR   R   t   n_bondedt   i_seqt   bondedt   j_seq(    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/command_line/pdb_show_connectivity.pyt   run   sP    	 
	

 
#t   __main__i   (   t
   __future__R    t   libtbx.utilsR   R   t   sysR   t   stdoutR,   R   t   argv(    (    (    sV   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/command_line/pdb_show_connectivity.pyt   <module>   s   ,