ó
±™xTc           @   s�   d  d l  m Z d  d l m Z d  d l m Z d  d l Z d  d l Z d Z	 d „  Z
 e j e d „ Z e d k r‰ e e j d	 ƒ n  d S(
   iÿÿÿÿ(   t   division(   t   make_sub_header(   t   null_outNs‰   
include scope mmtbx.building.extend_sidechains.master_params
output_model = None
  .type = path
output_map_coeffs = None
  .type = path
c          C   s#   d d l  m }  |  d t d t ƒ S(   Niÿÿÿÿ(   t    generate_master_phil_with_inputst   phil_stringt   enable_automatic_twin_detection(   t   mmtbx.command_lineR   t   extend_master_philt   True(   R   (    (    sR   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/extend_sidechains.pyt   get_master_phil   s    c         C   sÙ  d d  l  } d d  l } | } | s0 t ƒ  } n  | j j d |  d t ƒ  d t d | d d ƒ } | j } t j	 j
 t j	 j | j j j d ƒ ƒ d } | j } | j }	 | j j j d  k	 rhd d	 l m }
 |
 | j j j ƒ \ } } t d
 d | ƒ| j j j d | d | d | ƒ } | d k r7| d IJqh| j d |	 j ƒ  ƒ }	 | j j |	 d t ƒn  | j j j d | d |	 d | j d | d | d g  | j D] \ } } | ^ q¢d | d | d | j  d | j! ƒ 
S(   Niÿÿÿÿt   argst   master_philt   process_pdb_filet   outt   usage_strings¬   mmtbx.extend_sidechains model.pdb data.mtz [restraints.cif] [options]

Rebuild sidechains with missing non-hydrogen atoms.  Includes real-space
refinement (but needs work).i    (   t   any_sequence_formats   Correcting model sequencet   pdb_hierarchyt	   sequencess     No modifications required.t   crystal_symmetryt   update_f_calct   xray_structuret   fmodelt   paramst   prefixt   cif_objectst   verboset   output_modelt   output_map_coeffs("   t    mmtbx.building.extend_sidechainsR   R   t   command_linet   load_model_and_dataR	   t   FalseR   t   ost   patht   splitextt   basenamet   inputt   pdbt	   file_nameR   R   t   sequencet   Nonet   iotbx.bioinformaticsR   R   t   buildingt   extend_sidechainst   correct_sequencet   extract_xray_structureR   R   t   update_xray_structureR   t   extend_and_refineR   R   R   (   R
   R   R   t   mmtbxt	   input_outt   cmdlineR   R   R   R   R   R   t   nct	   n_changedt   fnt   co(    (    sR   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/extend_sidechains.pyt   run   sP    			/				
	"	t   __main__i   (   t
   __future__R    t   libtbx.str_utilsR   t   libtbx.utilsR   t   os.pathR    t   sysR   R	   t   stdoutR   R7   t   __name__t   argv(    (    (    sR   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/extend_sidechains.pyt   <module>   s   	/