Hi Pavel,<div><br></div><div>Small molecule crystallographers often refer to the R-factor as the R1-factor. The &#39;1&#39; just means that is calculated using the amplitudes without squaring. An R2-factor would be obtained by replacing the amplitudes by the squares of the amplitudes and taking the square root. See for example equations 7 and 8 in this paper by David Watkin (<a href="http://dx.doi.org/10.1107/S0021889808007279">http://dx.doi.org/10.1107/S0021889808007279</a>). The terminology R1 factor is also used in the SHELX manual.</div>

<div><br></div><div>Cheers,</div><div><br></div><div>Richard</div><div><br><div class="gmail_quote">On 6 July 2012 12:23, Pavel Afonine <span dir="ltr">&lt;<a href="mailto:pafonine@lbl.gov" target="_blank">pafonine@lbl.gov</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>Hi,<br>
      <br>
      can anyone tell me what&#39;s r1_factor and how it is different from
      classical text-book definition of R-factor, for example:<br>
      <br>
      <a href="http://en.wikipedia.org/wiki/R-factor_(crystallography)" target="_blank">http://en.wikipedia.org/wiki/R-factor_(crystallography)</a><br>
      <br>
      (or for those who doesn&#39;t trust wiki: page 147 in
      Blundell&amp;Johnson (1976))<br>
      <br>
      ?<br>
      <br>
      Are there r2_factor, r3_factor, ..., etc ?<br>
      <br>
      Thanks,<br>
      Pavel<div><div class="h5"><br>
      <br>
      On 7/6/12 12:09 PM, Richard Gildea wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">Just to avoid any confusion between mine and Nat&#39;s
      responses, there are two similarly named functions in
      miller.array, common_set and common_sets.�
      <div><br>
      </div>
      <div>Thus the following two lines (note singular common_set):</div>
      <div><br>
      </div>
      <div>f_obs = f_obs.common_set(f_calc)</div>
      <div>f_calc = f_calc.common_set(f_obs)</div>
      <div><br>
      </div>
      <div>is equivalent to the one-liner (note plural common_sets):</div>
      <div><br>
      </div>
      <div>f_obs, f_calc = f_obs.common_sets(f_calc)</div>
      <div><br>
      </div>
      <div>Cheers,</div>
      <div><br>
      </div>
      <div>Richard</div>
      <div><br>
        <br>
        <div class="gmail_quote">On 6 July 2012 12:04, Richard Gildea <span dir="ltr">&lt;<a href="mailto:rgildea@gmail.com" target="_blank">rgildea@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Jan,
            <div><br>
            </div>
            <div>You will need to get a matching set of indices for both
              arrays before calculating the R1 factor. The simplest way
              to do this would be by calling the
              miller.array.common_sets() function:</div>
            <div>
              <br>
            </div>
            <div>e.g. where f_obs and f_calc are two arrays that are not
              necessarily matching sets of indices:</div>
            <div><br>
            </div>
            <div>f_obs, f_calc = f_obs.common_sets(f_calc)</div>
            <div><br>
            </div>
            <div>Hope that helps,</div>
            <div><br>
            </div>
            <div>Richard</div>
            <div>
              <div>
                <div>
                  <div><br>
                    <div class="gmail_quote">On 6 July 2012 11:59, Jan
                      Marten Simons <span dir="ltr">&lt;<a href="mailto:marten@xtal.rwth-aachen.de" target="_blank">marten@xtal.rwth-aachen.de</a>&gt;</span>
                      wrote:<br>
                      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
                        <br>
                        I&#39;m facing a new challenge while working with
                        cctbx:<br>
                        <br>
                        Imagine a set of (possibly incomplete) measured
                        intesities, or integrated<br>
                        intensities from xrd powder patterns (I_obs) and
                        a fitting crystal symmetry<br>
                        (xtal_symm). Now if I want to check if a given
                        structure would generate the<br>
                        same intensities. (--&gt; low R1) the following
                        code exibits the problem:<br>
                        <br>
                        # -*- coding: utf-8 -*-<br>
                        from __future__ import division<br>
                        from cctbx import xray<br>
                        from cctbx import crystal<br>
                        from cctbx.array_family import flex<br>
                        from libtbx import Auto<br>
                        <br>
                        obs_file = &quot;Test.hkl&quot; � � � � � � �# in shelx
                        hklf4 format<br>
                        xtal_symm = crystal.symmetry(<br>
                        � � unit_cell=(4.000, 5.4321, 7.531, 90.0, 90.0,
                        90.0),<br>
                        � � space_group_symbol=&quot;P mm2&quot;)<br>
                        <br>
                        trial_structure = xray.structure(<br>
                        �
                        special_position_settings=crystal.special_position_settings(<br>
                        � � crystal_symmetry=xtal_symm),<br>
                        � scatterers=flex.xray_scatterer([<br>
                        � � xray.scatterer(<br>
                        � � � label=&quot;Si&quot;,<br>
                        � � � site=(0.0,0.0,0.0),<br>
                        � � � u=0.2)]))<br>
                        <br>
                        # load (integral) intensities from diffraction
                        data<br>
                        from iotbx import reflection_file_reader<br>
                        rfl =
                        reflection_file_reader.any_reflection_file(&quot;amplitudes=&quot;+obs_file,<br>
                        � � � � � � � � � � � � � � � � � � � � � � � �
                        � ensure_read_access=True)<br>
                        I_obs =
                        rfl.as_miller_arrays(crystal_symmetry=xtal_symm,<br>
                        � � � � � � � � � � � � � � �
                        force_symmetry=False,<br>
                        � � � � � � � � � � � � � � �
                        merge_equivalents=True,<br>
                        � � � � � � � � � � � � � � �
                        base_array_info=None)[0]<br>
                        I_obs = I_obs.discard_sigmas()<br>
                        f_obs = I_obs.as_amplitude_array()<br>
                        <br>
                        f_calc =
                        trial_structure.structure_factors(d_min=1.0).f_calc()<br>
                        f_calc.merge_equivalents()<br>
                        <br>
                        R1 = f_calc.r1_factor(f_obs, scale_factor=Auto,
                        assume_index_matching=False)<br>
                        <br>
                        gives:<br>
                        &quot; � �assert other.indices().size() ==
                        self.indices().size()<br>
                        AssertionError � � � � � � � � � � � � � � � &quot;<br>
                        <br>
                        <br>
                        Is there some way to get the R1_factor for this
                        kind of scenario?<br>
                        <br>
                        Cheers and thanks in advance,<br>
                        Jan<br>
                        _______________________________________________<br>
                        cctbxbb mailing list<br>
                        <a href="mailto:cctbxbb@phenix-online.org" target="_blank">cctbxbb@phenix-online.org</a><br>
                        <a href="http://phenix-online.org/mailman/listinfo/cctbxbb" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
                      </blockquote>
                    </div>
                    <br>
                  </div>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
cctbxbb mailing list
<a href="mailto:cctbxbb@phenix-online.org" target="_blank">cctbxbb@phenix-online.org</a>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a>
</pre>
    </blockquote>
    <br>
    <br>
  </div></div></div>

<br>_______________________________________________<br>
cctbxbb mailing list<br>
<a href="mailto:cctbxbb@phenix-online.org">cctbxbb@phenix-online.org</a><br>
<a href="http://phenix-online.org/mailman/listinfo/cctbxbb" target="_blank">http://phenix-online.org/mailman/listinfo/cctbxbb</a><br>
<br></blockquote></div><br></div>