def calc_wilson(observations_full, n_residues):
  """
  Caculate isotropic Wilson G and B-factors
  """
  if n_residues == 0:
    return 0, 0
  from prime.postrefine.mod_util import mx_handler
  mxh = mx_handler()
  asu_contents = mxh.get_asu_contents(n_residues)
  try:
    observations_as_f = observations_full.as_amplitude_array()
    binner_template_asu = observations_as_f.setup_binner(auto_binning=True)
    wp = statistics.wilson_plot(observations_as_f, asu_contents, e_statistics=True)
    G = wp.wilson_intensity_scale_factor
    B = wp.wilson_b
  except Exception:
    G,B  = (0,0)
  return G, B
Exemplo n.º 2
0
def calc_wilson(observations_full, n_residues):
    """
  Caculate isotropic Wilson G and B-factors
  """
    if n_residues == 0:
        return 0, 0
    from prime.postrefine.mod_util import mx_handler
    mxh = mx_handler()
    asu_contents = mxh.get_asu_contents(n_residues)
    try:
        observations_as_f = observations_full.as_amplitude_array()
        binner_template_asu = observations_as_f.setup_binner(auto_binning=True)
        wp = statistics.wilson_plot(observations_as_f,
                                    asu_contents,
                                    e_statistics=True)
        G = wp.wilson_intensity_scale_factor
        B = wp.wilson_b
    except Exception:
        G, B = (0, 0)
    return G, B