ó
±™xTc           @   s›   d  d l  m Z d  d l Z d  d l Z d  d l m Z 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   divisionN(   t   Usaget   Sorryc           C   s   t  j j d d d t ƒ S(   Nt   input_strings  
    include scope mmtbx.validation.molprobity_cmdline_phil_str
    plot = False
      .type = bool
      .help = Create graphics of plots (if Matplotlib is installed)
    wxplot = False
      .type = bool
      .help = Display interactive plots (requires wxPython and Matplotlib)
t   process_includes(   t   iotbxt   philt   parset   True(    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/ramalyze.pyt   get_master_phil   s    sL  
phenix.ramalyze file.pdb [params.eff] [options ...]

Options:

  model=input_file      input PDB file
  outliers_only=False   only print outliers
  verbose=False         verbose text output
  plot=False            Create graphics of plots (if Matplotlib is installed)

Example:

  phenix.ramalyze model=1ubq.pdb outliers_only=True
c         C   s�  t  j j d |  d t ƒ  d d d t ƒ } | j j ƒ  } | j d  k rW t	 t ƒ ‚ n  | j
 | j d d ƒ} | j j } | j ƒ  j ƒ  t j j j d | d	 d  d
 | j d | d | ƒ } | j rà | j d | d t ƒ n  | j r't j j t j j | j ƒ ƒ d } | j d | d | ƒ n  | j r‹y d d  l }	 Wn t k
 ra}
 t d ƒ ‚ q‹X|	 j  j! d ƒ } | j" ƒ  | j# ƒ  n  d  S(   Nt   argst   master_philt   pdb_file_deft   modelt   usage_stringt
   force_typet   pdbt   pdb_hierarchyt   show_errorst   outliers_onlyt   outt   quiett   verbosei    t   plot_file_baseiÿÿÿÿs   wxPython not available.($   R   R   t   process_command_line_with_filesR	   R   t   workt   extractR   t   NoneR   t   get_filet   file_objectt	   hierarchyt   atomst   reset_i_seqt   mmtbxt
   validationt   ramalyzeR   R   t   show_old_outputR   t   plott   ost   patht   splitextt   basenamet   write_plotst   wxplott	   wxtbx.appt   ImportErrorR   t   appt   CCTBXAppt   display_wx_plotst   MainLoop(   R
   R   R   t   cmdlinet   paramst   pdb_inR   t   resultR   t   wxtbxt   eR.   (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/ramalyze.pyt   run%   s<    						%	
t   __main__i   (   t
   __future__R    t   mmtbx.validation.ramalyzeR!   t
   iotbx.philR   t   libtbx.utilsR   R   t   os.pathR&   t   sysR	   R   t   stdoutt   FalseR8   t   __name__t   argv(    (    (    sI   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/command_line/ramalyze.pyt   <module>   s   	!