ó
©™xTc           @   s:  d  d l  m Z d  d l Z d  d l m Z d  d l m Z m Z d  d l	 m
 Z
 d  d l Z d  d l Z d  d l Z d d „ Z d d „ Z d	 d
 d d d „ Z d d d d d d d d d e d d „ Z d d d d d d d „ Z d d d d d d d „ Z d d „ Z d d d d d d d „ Z d „  Z d „  Z d d d d d d e d „ Z d d e j d „ Z d d e j d „ Z d „  Z d d d d d e j d „ Z d d e j d „ Z  d d „ Z! d  d! „ Z" d d" d d d d d d d# e j d$ „
 Z# g  g  g  g  d" d% „ Z$ d& e j% j& f d' „  ƒ  YZ' d S((   iÿÿÿÿ(   t   divisionN(   t   any_sequence_format(   t   Sorryt   null_out(   t   table_utilst   PROTEINc         C   s   |  d k r d } n d } | S(   NR   gš™™™™é`@g     ð~@(    (   t
   chain_typet   vol_per_residue(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_vol_per_residue
   s    	c         C   s   |  d k r d } n d } | S(   NR   i   i   (    (   R   t   atoms_per_residue(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_atoms_per_residue   s    	iÈ   g      @g      à?c         C   s/   d |  t  d | ƒ d | d | d } | S(	   Ng       @gn†ðù!	@gioð…ÉTÕ?R   g      ð?i   gn†ðù!@gÇQD|ãÀ @(   R   (   t   residuest   dmint   solvent_fractionR   t   nrefl(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt	   get_nrefl   s    +g      .@iè  gffffffî?c         C   sÁ  d  } d  } d } | r! d } n  xØ t | | ƒ D]Ç } | d t | ƒ } t |  | | | | | d | d |	 d |
 d | d | d	 | d
 t ƒ\ } } } } } } } | d  k	 rÃ | | k  rÃ q1 n  | | d } | d  k sé | | k  r1 | } | } q1 q1 W| d k r½t |  | | | | | d | d |	 d |
 d | d | d	 | d
 t ƒ\ } } } } } } } t |  | | | | d | | d | d | d | d |	 d |
 d | d | d	 | d t ƒ
} n  | S(   Ni   i    g      ð?t   fa2t   fb2t   disorder_parametert   fo_listt   fo_number_listt	   occupancyt   get_fpp_weaki   t   target_s_anot   ntriest
   min_cc_anot   include_zero(   t   Nonet   xranget   floatt   get_values_from_sigft   Falset   get_sigf(   R   t   nsitest   natomst   zt   fppR   R   R   R   R   R   R   R   R   R   t   ratio_for_failuret   closest_sigft   closest_dist2t   start_valuet   it   sigft   s_anot   cc_anot   cc_halft   fpp_weakt   cc_ano_weakt   cc_half_weakt   i_over_sigmat   dist2(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyR       s<     	c         C   s^   t  |  | | | | | d | d | d | d |	 d |
 d | ƒ} | t j d	 |  | ƒ } | S(
   NR   R   R   R   R   R   g      @g      @gš™™™™™é?(   t
   get_cc_anot   matht   sqrt(   R   R!   R"   R#   R$   R*   R   R   R   R   R   R   R,   t   sano_new(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_sanoC   s
    c         C   sh   | g } | g } t  d | d | d |	 d |
 d | ƒ } d d | | | | d | } t j | ƒ S(   s0   cc_ano**2=1/[1 + <sigF**2>/(n/N)(Za/Z)**2<F**2>]t   fpp_listt   fpp_number_listR   R   R   g      ð?i   (   t   get_normalized_scatteringR4   R5   (   R   R!   R"   R#   R$   R*   R   R   R   R   R   R   t   target_fpp_listt   target_fpp_number_listt	   local_fa2t
   ccano2_new(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyR3   _   s    			"c         C   s-   t  d |  |  d | ƒ } | d | } | S(   s)   cc_half=cc_ano_perf**2/(2-cc_ano_perf**2)g      ð?i   g       @(   t   min(   R,   R   t   ccano2t   cc_half_new(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_cc_halfu   s    c         C   sæ   t  |  | | | | | d | d | d | d |	 d |
 d | ƒ} | d } d } xŒ t d	 d
 ƒ D]{ } t | ƒ d } t  |  | | | | | | d | d | d | d |	 d |
 d | ƒ} | | k r_ | | k  r_ | } Pq_ q_ W| | S(   NR   R   R   R   R   R   g       @g      ð?i   ie   g{®Gáz„?(   R7   R   R   (   R   R!   R"   R#   R$   R*   R   R   R   R   R   R   t   sanot   targett
   best_scaleR)   t   scalet   ss(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   estimate_fpp_weak€   s    
c         C   s   |  d k r d |  Sd Sd  S(   Ni    g)\�Âõ(ì?g     8�@(    (   R*   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_i_over_sigma–   s    c         C   s#   |  d k r d |  } n d } | S(   Ni    g)\�Âõ(ì?gü©ñÒMbP?(    (   R1   R*   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_sigf_from_i_over_sigma�   s    c         C   sh  t  |  | | | | | d | d | d | d |	 d |
 d | ƒ} t |  | | | | | d | d | d | d |	 d |
 d | ƒ} t | d | ƒ} | rKt |  | | | | | d | d | d | d |	 d |
 d | ƒ} t |  | | | | | d | d | d | d |	 d |
 d | ƒ} t | d | ƒ} t | ƒ } | | | | | | | f S| | | | | | d f Sd  S(   NR   R   R   R   R   R   g        (   R7   R3   RB   RH   RI   (   R   R!   R"   R#   R$   R*   R   R   R   R   R   R   R   R+   R,   R-   R.   R/   R0   R1   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyR   ¦   s&    		c         C   s{   |  s | r! t  d d ƒ ‚ n  d d l m } y" | j |  ƒ } | j | ƒ } Wn! t k
 rv t  d |  ƒ ‚ n X| S(   Ns(   Please specify either f_double_prime or s   atom_type and wavelengthiÿÿÿÿ(   t   sasakis'   Unable to get scattering factors for %s(   R   t   cctbx.eltbxRK   t   tablet   at_angstromt
   ValueError(   t	   atom_typet
   wavelengtht   outRK   RM   t   fp_fdp(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt
   get_fp_fdpÁ   s    c         C   sx   |  s | r! t  d d ƒ ‚ n  d d l m } y | j |  ƒ } | j ƒ  } Wn! t k
 rs t  d |  ƒ ‚ n X| S(   Ns(   Please specify either f_double_prime or s   atom_type and wavelengthiÿÿÿÿ(   RK   s'   Unable to get scattering factors for %s(   R   RL   RK   RM   t   atomic_numberRO   (   RP   RQ   RR   RK   RM   t   fo(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_foÍ   s    c         C   sO   |  j  ƒ  j d d ƒ }  t |  ƒ } |  j d ƒ } |  j d ƒ } | | | f S(   Nt    t    t   Mt   C(   t   uppert   replacet   lent   count(   t   sequencet   n_aat   n_mett   n_cys(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_aa_and_metÙ   s
    i    i   c      	   C   sN  d  } |  d  k r% | d IJd  } nç |  j ƒ  d k rM t d | | ƒ } n¿ |  j ƒ  d k r— t d | | | ƒ } | | t t | ƒ d ƒ } nu |  j ƒ  d k rÜ | t d t d d t t | ƒ d	 ƒ ƒ ƒ } n0 | t d t d
 d t t | ƒ d ƒ ƒ ƒ } | r/| d |  j ƒ  | f IJn  | d  k rD| } n  | | f S(   Ns-   No heavy atom type set, so no sites estimatedt   sei   t   sg       @t   brR)   i
   g      4@i   g      Y@s%   
Best guess of number of %s sites: %d(   Re   (   Rf   (   Rg   R)   (   R   t   lowert   maxt   intR   R?   R\   (   RP   Rb   Rc   Ra   t
   ncs_copiesRR   t   number_of_sites_lowrest   number_of_sites(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_number_of_sitesà   s$    
	!30 	c         C   sú   |  s t  j j |  ƒ r) t d ƒ ‚ n  t |  ƒ \ } } | rT t d |  ƒ ‚ n  d \ } } } xG | D]? }	 t d |	 j ƒ \ }
 } } | |
 7} | | 7} | | 7} qj W| | } t d | d | d | d | d	 d
 d t ƒ  ƒ \ } } | | | f S(   Ns3   Please supply number of residues or a sequence files*   Sorry, unable to read the sequence file %si    R`   RP   Rb   Rc   Ra   Rk   i   RR   (   i    i    i    (	   t   ost   patht   isfileR   R   Rd   R`   Rn   R   (   t   seq_fileRP   R   RR   t   objectst   non_compliantRa   Rb   Rc   t   seq_objt   n_aa_t   n_met_t   n_cys_t   number_of_sRm   Rl   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_residues_and_haö   s     


c         C   s$   |  s
 d S|  d } d | | Sd  S(   Ng        i   g      ð?(    (   t   ideal_cc_anomt   cc2(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_disorder_parameter	  s    
g      Ð?c         C   s]   t  } xB |  D]: } t d | d | ƒ j ƒ  } | | | k r t } q q W| rU t  St Sd  S(   NRP   RQ   (   t   TrueRT   t   fdpR   (   t   intrinsic_scatterers_listt
   target_fppRQ   t   minimum_ratiot   all_weakt   xR$   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   include_intrinsic_scatterers  s    g      ð?g        c
         C   s÷  |  d k r\ d g }
 | d  k r. d | } n  | | g } d d d g } d d d	 g } nO d
 g }
 d g } d d d g } d d d g } |  d k r« | d c d 7<n  | sÏ | d  k ræ t |
 | | ƒ ræ | |
 7} | | 7} n  g  } g  } g  } g  } g  } d } xÔ t | | ƒ D]Ã \ } } t d | d | ƒ j ƒ  } t d | d | ƒ } | j | ƒ | j | | ƒ | | | 7} | r| j | ƒ | j | | ƒ | t j | | ƒ } | j | | | | | f ƒ qqW| | | | | | f S(   NR   t   SgºI+‡¦?R[   t   Nt   Ogš™™™™™@gìQ¸…ëõ?gHáz®Gù?t   Pi   g     €!@g      @g      @t   RNAi   i    RP   RQ   (	   R   R…   t   zipRT   R   RW   t   appendR4   R5   (   R   RQ   R   R�   t   target_atom_typet   target_nt   intrinsic_scatterers_as_noiset!   include_weak_anomalous_scatteringRy   RR   R€   t    intrinsic_scatterers_number_listt
   atoms_listt   atoms_number_listR   R   R8   R9   t   noise_table_rowst   n_atomsR„   t   nR$   RV   t   contribution(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   get_fo_list  sL    			
c         C   s‘   d } x/ t  | | ƒ D] \ } } | | d | 7} q Wd } x3 t  |  | ƒ D]" \ }	 }
 | | |	 d |
 7} qN W| d k r‰ d } n  | | S(   Ng        i   i    g      ð?(   R‹   (   R8   R9   R   R   R   t   sum_realRV   t   fo_nt   sum_anomR$   t   fpp_n(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyR:   R  s    	t   estimate_necessary_i_sigic           B   sÅ   e  Z d  d d d d d d d d d d d d	 e d d
 d e d „ Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   R   iú   i    g      à?i   g      ð?gffffff@i   g333333Ã?gR¸…ëQè?gffffffî?c   $      C   sà  | |  _  | |  _ | |  _ | |  _ | |  _ |	 |  _ |
 |  _ | |  _ | d  k r` d |  _	 n	 | |  _	 | |  _
 | |  _ t d | ƒ } t d | ƒ |  _ t d | d | d |  j d |  j d | d | d	 | d
 | d | ƒ 	\ } } } } |  _ |  _ |  j g } |  j g } t d | d | d | d | d | ƒ |  _ t d | d | d | d | ƒ |  _ d } | rz| g |  _ n d d d d d d g |  _ g  |  _ d  |  _ g  |  _ g  |  _ x |  j D]} t d | d | d | ƒ } | d  k rPt | | |  j | | d |	 d |
 d |  j d |  j d |  j d | d | d | d |  j ƒ	} n t | ƒ } | d  k rnqÃn  t | | |  j | | | d |  j d |  j d |  j d | d | d | d  t ƒ\ } } } }  }! }" }# |# d! k rö|  j j | ƒ qÃn  | d" |	 k  r|  j j | ƒ n  |  j j d# | d$ | d% |# d& d' | d( |" | f d( |! | f d) | d | f g ƒ |  j d  k s«t  |  j ƒ d k  s«| |  j d* k rÃ| | | | |# | |" | |! | | g |  _ qÃqÃWd  S(+   Nt   -R   R{   R   RQ   R�   R�   RŽ   R�   R�   Ry   R8   R9   R   R   R   i   i   i   i   g      @i   g      ø?R   R   R   R   R   R   R   R%   R   iç  gffffffî?s   %5.2fs   %7ds   %6.0fs   %7.1fg      Y@s   %5.2f - %5.2fs   %3.0f - %3.0fiþÿÿÿ(!   R   R   R   R!   R$   R   R   RQ   R   RP   R   R%   R   R}   R   R˜   R"   R”   R:   R   R   t   dmin_rangest
   table_rowst   representative_valuest   skipped_resolutionst   missed_target_resolutionsR   R    RJ   R   R~   RŒ   R^   ($   t   selfR   R   Ry   R   R!   RQ   RP   R$   R   R   R   R   R{   R�   R�   R%   R1   t   quietR   R   R   R8   R9   R;   R<   R#   R   R*   R+   R,   R-   R.   R/   R0   t   local_i_over_sigma(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   __init__g  sž    													!				 	(c         C   s   |  j  d S(   Ni    (   R¡   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   representative_dminì  s    c         C   s   |  j  d S(   Ni   (   R¡   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   representative_nsitesï  s    c         C   s   |  j  d S(   Ni   (   R¡   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   representative_nreflò  s    c         C   s   |  j  d S(   Ni   (   R¡   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   representative_fppõ  s    c         C   s   |  j  d S(   Ni   (   R¡   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   representative_i_over_sigmaø  s    c         C   s   |  j  d S(   Ni   (   R¡   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   representative_sigfû  s    c         C   s   |  j  d S(   Ni   (   R¡   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   representative_cc_half_weakþ  s    c         C   s   |  j  d S(   Ni   (   R¡   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   representative_cc_half  s    c         C   s   |  j  d S(   Ni   (   R¡   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   representative_cc_ano_weak  s    c         C   s   |  j  d S(   Ni	   (   R¡   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   representative_cc_ano  s    c         C   s   |  j  d S(   Ni
   (   R¡   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   representative_s_ano
  s    c      	   C   sh   |  j  ƒ  rd d |  j ƒ  |  j ƒ  |  j ƒ  |  j ƒ  |  j ƒ  |  j ƒ  |  j ƒ  d |  j ƒ  f GHn  d  S(   Nsh   
I/sigI:  %7.1f
Dmin:     %5.2f
cc_half:  %5.2f - %5.2f
cc*_anom: %5.2f - %5.2f
Signal:   %5.1f - %5.1f
i   (   t   is_solvableR¬   R¨   R®   R¯   R°   R±   R²   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   show_summary  s    						c         C   s   |  j  d  k	 S(   N(   R¡   R   (   R¤   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyR³     s    c         C   s  | j  d ƒ | j d ƒ | j d ƒ | j d |  j ƒ |  j rP |  j } n d } |  j t j |  j	 ƒ } | j d | |  j |  j	 | f ƒ |  j
 rÖ | j d ƒ x+ |  j
 D] } | j d t | ƒ ƒ q² Wn  d	 t j |  j ƒ } d	 t j |  j ƒ } t j |  j |  j |  j ƒ } | j d
 | | | f ƒ | j d ƒ | j d ƒ t |  j ƒ d k r|| j d ƒ d  S| j sÀ| j d ƒ xh |  j D] } | j d t | ƒ ƒ qœWn= t j d |  j d d d d d d d d g ƒ } | j | ƒ t |  j ƒ \ }	 }
 } } } } } } } } } |  j rk|  j j ƒ  | j d |  j d |  j d	 f ƒ n  |  j rœ|  j j ƒ  | j d |  j d ƒ n  | j d |	 | | | | | | d | |  j f	 ƒ | j d ƒ | j d ƒ | j d  ƒ | j d! ƒ | j d" ƒ d  S(#   Ns   SAD experiment plannings5   Dataset overall I/sigma required to solve a structures   
Dataset characteristics:s%    Target anomalous signal: %(target_s_ano)7.1f
  Residues: %(residues)d
  Chain-type: %(chain_type)s
  Solvent_fraction: %(solvent_fraction)7.2f
  Atoms: %(natoms)d
  Anomalously-scattering atom: %(atom_type)s
  Wavelength: %(wavelength)7.4f A
  Sites: %(nsites)d
  f-double-prime: %(fpp)7.2f
Rž   sH   Target anomalous scatterer:
  Atom: %2s  f": %4.2f  n:%5.0f   rmsF:%7.1fs-   
Other anomalous scatterers in the structure:s,     Atom: %2s  f": %4.2f  n:%5.0f   rmsF:%7.1fg      Y@sÓ   
Normalized anomalous scattering:
  From target anomalous atoms rms(x**2)/rms(F**2):  %7.2f
  From other anomalous atoms rms(e**2)/rms(F**2):   %7.2f
  Correlation of useful to total anomalous scattering: %4.2f
s=   Dataset <I>/<sigI> needed to obtain anomalous signal of 15-30s   (Targets for entire dataset)i    s0   SAD solution unlikely with the given parameters.s  
                                         Anomalous      Useful        Useful
                                        Half-dataset    Anom CC      Anomalous
 Dmin   Nrefl   I/sigI rms(sigF)/           CC         (cc*_anom)     Signal
                         rms(F) (%) s    %s %s %s   %s        %s  %s   %sR    t   column_headerst   d_mint   Nrefls   I/sigIs   rms(sigF)/rms(F) (%)s   Half-dataset CC_anos   CC*_anos   Anom. signals³   
Note: Target anomalous signal not achievable even with very high I/sigma
for  resolutions of %5.2f A and lower. I/sigma shown achieves about %3.0f%% of
maximum anomalous signal.
sS   
Note: No plausible values of I/sigma found for  resolutions of %5.2f A
and lower.
s  
This table says that if you collect your data to a resolution of %5.1f A with
an overall <I>/<sigma> of about %3.0f then the half-dataset anomalous
correlation should be in the range of %5.2f - %5.2f.  This should lead to a
correlation of your anomalous data to the useful anomalous differences
(CC*_ano) in the range of %5.2f - %5.2f and a useful anomalous signal around
%3.0f - %3.0f, where an anomalous correlation of about %5.2f and an
anomalous signal of 10-15 should be sufficient to find the substructure and
calculate phases.
g       @sX  
The value of rms(sigF)/rms(F) is approximately the inverse of I/sigma. The
calculations are based on rms(sigF)/rms(F).

Note that these values assume data measured with little radiation damage or at
least with anomalous pairs measured close in time. The values also assume that
the anomalously-scattering atoms are nearly as well-ordered as other atoms.
If your crystal does not fit these assumptions it may be necessary to collect
data with even higher I/sigma than indicated here.

Note also that anomalous signal is roughly proportional to the anomalous
structure factors at a given resolution. That means that if you have 50%
occupancy of your anomalous atoms, the signal will be 50% of what it otherwise
would be.  Also it means that if your anomalously scattering atoms only
contribute to 5 A, you should only consider data to 5 A in this analysis.
s   What to do next:st   
1. Collect your data, trying to obtain a value of I/sigma for the whole dataset
   at least as high as your target.sÊ   2. Scale and analyze your unmerged data with phenix.scale_and_merge to get an
   accurate estimate of your half-dataset anomalous correlation and your
   estimated useful anomalous correlation cc*_anom.s  3. Compare the half-dataset anomalous correlation and cc*_anom with the
   estimated values in the table above. If they are lower than expected
   you may need to collect more data to obtain the target half-dataset
   correlation and target anomalous signal.
(   t   show_headert   show_sub_headert   show_paragraph_headert   show_preformatted_textt   __dict__RP   R$   R4   R5   R!   R”   t   tupleR   R   R^   R    t	   show_textt
   gui_outputR   t   simple_tablet
   show_tableR¡   R£   t   sortR%   R¢   R   (   R¤   RR   t   tR—   t   rowt   fat   fbt   fabRM   R   R!   R   R$   R1   R*   R0   R-   R/   R,   R+   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt
   _show_impl"  s~    
		 				0	"		N(   t   __name__t
   __module__R   R~   R   R§   R¨   R©   Rª   R«   R¬   R­   R®   R¯   R°   R±   R²   R´   R³   RÈ   (    (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyR�   f  s@   r													((   t
   __future__R    t   mmtbx.scalingt   mmtbxt   iotbx.bioinformaticsR   t   libtbx.utilsR   R   t   libtbxR   R4   t   sysRo   R   R
   R   R   R~   R    R7   R3   RB   RH   RI   RJ   R   t   stdoutRT   RW   Rd   Rn   Rz   R}   R…   R˜   R:   t   scalingt   xtriage_analysisR�   (    (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/mmtbx/scaling/plan_sad_experiment.pyt   <module>   s^   	#					
				
	/