ó
±™xTc           @   s[   d  d l  m Z d  d l Z d  d l Z e j d „ Z e d k rW e e j d ƒ n  d S(   iÿÿÿÿ(   t   divisionNc         C   s‡  d d l  m } t |  ƒ d k r6 d GH| d ƒ ‚ n  d d l m } m } d d  l } | j j d t	 d d	 ƒ } | j j
 d
 |  d | d | ƒ } | d IJ| j d d | ƒ| j } | j d | d | j d | j d d  d | j j ƒ t | j j j j ƒ d k rK| j j j j d }	 t j j t j j |	 ƒ ƒ d d }
 n d }
 t |
 d ƒ j | j j ƒ  ƒ | d IJd |
 GHd  S(   Niÿÿÿÿ(   t   Usagei    s.   Warning: this is not intended for general use.s7   mmtbx.flip_peptides [model.pdb] [data.mtz] [params ...](   t   flip_peptidest   print_statisticst   enable_automatic_twin_detectiont   phil_stringse   
      flip_peptides {
        include scope mmtbx.refinement.flip_peptides.master_params_str
      }t   argst   master_philt   outt    s   Analyzing peptide bondst   fmodelt   geometry_restraints_managert   pdb_hierarchyt   solvent_selectiont   paramsi   s   _new.pdbs   flipped.pdbt   ws   wrote new PDB file to %s(   t   libtbx.utilsR   t   lent   mmtbx.refinementR   R   t   mmtbx.command_linet   command_linet    generate_master_phil_with_inputst   Truet   load_model_and_datat   make_headerR
   t   runt   geometryR   t   NoneR   t   inputt   pdbt	   file_namet   ost   patht   splitextt   basenamet   opent   writet   as_pdb_string(   R   R   R   R   R   t   mmtbxR   t   cmdlineR
   t   pdb_filet   pdb_out(    (    sN   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/flip_peptides.pyR      s:    		
				)
t   __main__i   (   t
   __future__R    t   sysR   t   stdoutR   t   __name__t   argv(    (    (    sN   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/flip_peptides.pyt   <module>   s   #