ó
�™xTc           @   sp   d  d l  m Z d  d l m Z d  d l Z d  d l Z d „  Z d „  Z e	 d k rl e ƒ  e ƒ  d GHn  d S(   iÿÿÿÿ(   t   division(   t
   data_plotsNc          C   sÎ  d }  t  j d  ƒ } | j |  ƒ t | j ƒ d k s= t ‚ | j d d d d d d g k se t ‚ | j d	 d d  k s‚ t ‚ | j ƒ  |  k s¦ t | j ƒ  ƒ ‚ | j ƒ  d
 d d d d g k sÎ t ‚ | j	 ƒ  d k sæ t ‚ t
 d d ƒ } | j d ƒ | j |  ƒ | j d ƒ | j |  ƒ | j ƒ  t  j d ƒ } t | ƒ d k sZt ‚ | d j ƒ  |  k svt ‚ | d j ƒ  | d j ƒ  k sœt ‚ t  j d d d d d d d g d d d g d  d d g d d	 g g d! d d d d d g d" d# d$ d% d& g d' d( d) d* d+ g d, d- d. d/ d  g g ƒ } | j ƒ  |  k sJt ‚ | j d ƒ } | j d ƒ } t | j ƒ d k r’t | j ƒ d k s˜t ‚ | j d0 d  ƒ } | j d0 d  ƒ } t | ƒ d k ràt | ƒ d k sæt ‚ | j ƒ  \ }	 }
 t |	 ƒ d1 k st ‚ | j ƒ  \ }	 }
 t |	 ƒ d k s:t ‚ d2 } | j d3 d ƒ | k s^t ‚ d4 } d5 } | j d3 d ƒ } | | k s”t | ƒ ‚ t | ƒ | k s¬t ‚ | j ƒ  } | d6 k sÊt ‚ d  S(7   NsY  $TABLE: Resolution shell statistics
$GRAPHS
:R-free vs. resolution
:A:1,3:
:FOM vs. resolution
:A:1,4:
$$
1/resol^2  Nrefl      R-free     FOM       $$
$$
0.02       2004       0.25       0.89
0.04       2084       0.23       0.88
0.06       2037       0.27       0.83
0.08       1949       0.28       0.75
0.1        1783       0.38       *
$$
i   i    g{®Gáz”?g{®Gáz¤?g¸…ëQ¸®?g{®Gáz´?gš™™™™™¹?i   iÿÿÿÿs   0.1t   1783s   0.38t   *s  {"rows": [["1/resol^2", "Nrefl", "R-free", "FOM"], ["0.02", "2004", "0.25", "0.89"], ["0.04", "2084", "0.23", "0.88"], ["0.06", "2037", "0.27", "0.83"], ["0.08", "1949", "0.28", "0.75"], ["0.1", "1783", "0.38", "*"]], "title": "Resolution shell statistics"}s   _tst_data_plots.logt   ws   
Random non-loggraph text

s   

i   i   t   titles   Resolution shell statisticst   column_labelss	   1/resol^2t   Nrefls   R-freet   FOMt   graph_namess   R-free vs. resolutions   FOM vs. resolutiont   graph_columnst   dataiÔ  i$  iõ  i�  i÷  g      Ð?gq=
×£pÍ?gHáz®GÑ?gìQ¸…ëÑ?gR¸…ëQØ?g{®Gázì?g)\�Âõ(ì?g�Âõ(\�ê?g      è?t   fill_in_missing_yi   s<    -------------------------------------------------
  | Resolution shell statistics                   |
  |-----------------------------------------------|
  | 1/resol^2 | Nrefl     | R-free    | FOM       |
  |-----------------------------------------------|
  | 0.02      | 2004      | 0.25      | 0.89      |
  | 0.04      | 2084      | 0.23      | 0.88      |
  | 0.06      | 2037      | 0.27      | 0.83      |
  | 0.08      | 1949      | 0.28      | 0.75      |
  | 0.1       | 1783      | 0.38      | *         |
  -------------------------------------------------
t   indentsø     Resolution shell statistics
  1/resol^2 Nrefl     R-free    FOM
  0.02      2004      0.25      0.89
  0.04      2084      0.23      0.88
  0.06      2037      0.27      0.83
  0.08      1949      0.28      0.75
  0.1       1783      0.38      *
sê   Resolution shell statistics
1/resol^2 Nrefl     R-free    FOM
0.02      2004      0.25      0.89
0.04      2084      0.23      0.88
0.06      2037      0.27      0.83
0.08      1949      0.28      0.75
0.1       1783      0.38      *
s†  {"graph_types": ["A", "A"], "graph_columns": [[0, 2], [0, 3]], "title": "Resolution shell statistics", "column_labels": ["1/resol^2", "Nrefl", "R-free", "FOM"], "data": [[0.02, 0.04, 0.06, 0.08, 0.1], [2004, 2084, 2037, 1949, 1783], [0.25, 0.23, 0.27, 0.28, 0.38], [0.89, 0.88, 0.83, 0.75, null]], "graph_names": ["R-free vs. resolution", "FOM vs. resolution"], "x_is_inverse_d_min": false}(   R   t
   table_datat   Nonet   import_loggrapht   lenR   t   AssertionErrort   format_loggrapht   export_rowst   export_json_tablet   opent   writet   closet   import_ccp4i_logfilet	   get_grapht	   get_plotst   popt   formatt   format_simplet   strt   export_json(   t	   loggraph1t   tt   ft   tablest   t2t   g1t   g2t   p1t   p2t   plot_xt   plot_yt   formatted_tablet   simple_tablet   simpler_tablet	   formattedt   json_str(    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/tst_data_plots.pyt   exercise_inline   s`    ($(
&	0*	
c          C   sÆ   t  j j d d d t j j ƒ }  |  d  k	 r… t j |  ƒ } g  | D] } | j	 ^ qC d d d d d d	 d
 d d d g
 k s… t
 ‚ n  d } t j d  ƒ } | j | ƒ | j d ƒ } | j ƒ  } d  S(   Nt   relative_paths$   phenix_regression/tracking/scala.logt   tests)   >>> Scales v rotation range, Unspecified s$   Analysis against Batch, Unspecified s*   Analysis against resolution , Unspecified s(   Analysis against intensity, Unspecified s=   Completeness, multiplicity, Rmeas v. resolution, Unspecified s)   Correlations within dataset, Unspecified s'   Axial reflections, axis h, Unspecified s'   Axial reflections, axis k, Unspecified s'   Axial reflections, axis l, Unspecified s8   Run     1, standard deviation v. Intensity, Unspecified sþ   $TABLE: Matthews coefficients:
$GRAPHS: Protein crystal computed at resolution of 2.450 :A:1,2,3,4
$$ Nmol/asym Matthews_Coeff sovlent_frac P(2.450) $$
$$
    1         3.13            0.61         0.99
    2         1.56            0.21         0.01
$$
s/   Protein crystal computed at resolution of 2.450(   t   libtbxt   envt   find_in_repositoriest   ost   patht   isfileR   R   R   R   R   R   R   R   R   (   t   log_fileR$   R"   t	   loggraph3t   t3t   g3t   p3(    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/tst_data_plots.pyt   exercise_logfilen   s*    	t   __main__t   OK(
   t
   __future__R    t   iotbxR   t   libtbx.load_envR4   R7   R1   R?   t   __name__(    (    (    sM   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/iotbx/regression/tst_data_plots.pyt   <module>   s   	g	