ó
±™xTc           @   se   d  d l  m Z d  d l m Z d  d l Z d Z e j d „ Z e d k ra e e j	 d ƒ n  d S(   iÿÿÿÿ(   t   division(   t   make_headerNs¹   
ligand_code = LIG
  .type = str
atom_selection = None
  .type = atom_selection
add_to_model = True
  .type = bool
output_file = None
  .type = path
output_map = None
  .type = path
%s
c   	      C   s  d d l  m } d d  l } | d |  d t | j j j d | d t d t d d	 ƒ } | j } | j	 } | j
 } | j d  k rŒ d
 | _ n  | j d  k r§ d | _ n  t d d | ƒ| j j j d | d | d | d | j d d  d | j d | ƒ } | j | j ƒ | j | j ƒ | S(   Niÿÿÿÿ(   t   load_model_and_datat   argst   master_philt   outt   process_pdb_filet   generate_input_philt   usage_strings‚  mmtbx.apply_ncs_to_ligand model.pdb data.mtz ligand_code=LIG ...

Given a multi-chain PDB file and a ligand residue name, find copies of the
ligand in the input file, identify NCS operators relating macromolecule chains,
and search for additional ligand sites by applying these operators.  Used to
complete ligand placement in cases where LigandFit (etc.) is only partially
successful.
s   ncs_ligands.pdbs   ncs_ligands.mtzs    Finding ligands by NCS operatorst   pdb_hierarchyt   fmodelt   paramst   ligand_codet   atom_selectiont   add_new_ligands_to_pdbt   log(   t   mmtbx.command_lineR   t   mmtbx.ncs.ligandst   master_phil_strt   ncst   ligandst   ncs_ligand_philt   TrueR	   R
   R   t   output_filet   Nonet
   output_mapR   t   apply_ligand_ncsR   t   add_to_modelt	   write_pdbt
   write_maps(	   R   R   R   t   mmtbxt   cmdlineR	   R
   R   t   result(    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/apply_ncs_to_ligand.pyt   run   s8    								t   __main__i   (
   t
   __future__R    t   libtbx.str_utilsR   t   sysR   t   stdoutR!   t   __name__t   argv(    (    (    sT   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/apply_ncs_to_ligand.pyt   <module>   s   &