ó
ąxTc           @   sn   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 rj e d e j
 d  n  d S(	   i˙˙˙˙(   t   division(   t   Usaget   SorryNsě   
  pdb_file = None
    .type = path
    .multiple = True
  ligand_code = None
    .type = str
  max_distance_between_centers_of_mass = 8.0
    .type = float
  exclude_hydrogens = True
    .type = bool
  verbose = False
    .type = bool
c            sI  t  |   d k s d |  k r- t d   n  d d  l   d   j j f   f d     Y} | d |  d t d	 d
  } | j j   } t  | j  d k rŠ t	 d   n  | j
 d  k rÇ t	 d   n  d d l m } | j d | j
 d | j d d | j d d | j d | j d |  \ } } t  |  d k rEt	 d   n  d  S(   Ni    s   --helpsř   mmtbx.compare_ligands model1.pdb model2.pdb ligand_code=LIG

Given a pair of PDB files and a ligand ID, identifies equivalent copies of the
ligand in each model and calculates RMSDs between them.  Used for validating
ligand fitting tools in Phenix.i˙˙˙˙t   _cmdlinec              s   e  Z   f d    Z RS(   c            s6   t  |  d k r2 | j   r2   j j d |  Sd  S(   Ni   s   ligand_code=%s(   t   lent   isalnumt   philt   parse(   t   selft   arg(   t   iotbx(    sP   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/compare_ligands.pyt   process_other   s    (   t   __name__t
   __module__R   (    (   R
   (    sP   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/compare_ligands.pyR      s   t   argst   master_phil_stringt   pdb_file_deft   pdb_filei   s(   Exactly two PDB files required as input.s(   Must specify ligand ID (ligand_code=LIG)(   t   ligandst   ligand_codet
   pdb_file_1t
   pdb_file_2i   t   exclude_hydrogenst   verboset   outs   No matching ligands found!(   R   R   t
   iotbx.philR   t   process_command_line_with_filest   master_philt   workt   extractR   R   R   t   Nonet   mmtbx.validationR   t   compare_ligandsR   R   (   R   R   R   t   cmdlinet   paramsR   t   rmsdst   pbss(    (   R
   sP   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/compare_ligands.pyt   run   s0    "					t   __main__R   i   (   t
   __future__R    t   libtbx.utilsR   R   t   sysR   t   stdoutR%   R   t   argv(    (    (    sP   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/compare_ligands.pyt   <module>   s   "