JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for CCP4BB Archives


CCP4BB Archives

CCP4BB Archives


CCP4BB@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

CCP4BB Home

CCP4BB Home

CCP4BB  December 2013

CCP4BB December 2013

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: TRUNCATE & CTRUNCATE issues.

From:

Jon Agirre <[log in to unmask]>

Reply-To:

Jon Agirre <[log in to unmask]>

Date:

Wed, 4 Dec 2013 10:37:40 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (229 lines)

Hi Robbie,

I contacted Charles Ballard a few weeks ago on the very same issue and
he has efficiently rolled out a fix for it in the latest CCP4 update
:-)

Update ID: 6.4.0-001
Date: 25.10.13

Cheers,
Jon

On 4 December 2013 09:23, Robbie Joosten <[log in to unmask]> wrote:
> Hi Ian,
>
>
>> This probably doesn't affect the MTZ file that comes out of it
>> but it will affect the statistics of the twinning tests.
>
> I'd be interested to see if this solves the cases where ctruncate goes into
> an infinite loop during the twinning tests.
>
> Cheers,
> Robbie
>
> ________________________________
> Date: Sat, 30 Nov 2013 15:37:44 +0000
> From: [log in to unmask]
> Subject: [ccp4bb] TRUNCATE & CTRUNCATE issues.
> To: [log in to unmask]
>
>
>
> Hello All, I'd like to get your views on some changes I'm proposing to make
> to the TRUNCATE source code.  IMO there are some issues with the way
> TRUNCATE does its statistical analyses which need to be fixed.  This
> probably doesn't affect the MTZ file that comes out of it but it will affect
> the statistics of the twinning tests.  I've been meaning to do this for some
> time but it involves some fairly radical changes; now I've finally decided
> to bite the bullet.
>
> One problem is that there seems to be some confusion in the source code
> comments concerning the meaning of what I call the "symmetry enhancement
> factor" (aka "epsilon" or "e" below). This is the point-group dependent
> factor by which the mean intensities of special rows and zones are enhanced
> by symmetry; for example in PG121 the mean I of the 0k0 reflections is
> enhanced by a factor of 2; in PG6 & PG622, it's a factor of 6 for the 00l
> reflections, and so on.
>
> For space groups with screw axes (or glide planes in enantiomorphic SGs,
> i.e. the crystal contains both the asymmetric unit and its mirror image),
> the mean is multiplied by e only if the systematic absences are omitted from
> the sums; if you include them then there is no overall enhancement.  So
> rotation and screw axes (or mirrors and glide planes) need to be treated
> differently, yet the CCP4 library code for this (s/rs EPSLN & EPSLON) treat
> them identically (more on this below).  TRUNCATE calls epsilon alternatively
> a "multiplicity" or "weight" which further adds to the confusion since
> multiplicity (m) usually means something completely different (it's the
> number of times a symmetry-equivalent reflection occurs in a full hemisphere
> of data, so for PG222 axial reflections (h00 etc.) m=1, for zero layers (hk0
> etc.) m=2, and for general hkl m=4: in contrast e = 2, 1 and 1 resp.).
>
> This snippet of code from TRUNCATE which accumulates sums in bins according
> to d*^2 illustrates the problem:
>
>       CALL EPSLON(INHKL,WEIGHT,ISYSAB)
> C
>       FF(NT) = FF(NT) + F/WEIGHT
>       SD(NT) = SD(NT) + SS/WEIGHT
>       N(NT) = N(NT) + 1
>       AMULT = NSYM/WEIGHT
> C
> ...
> C     Accumulate sums for Wilson plot.
> C
>       SN(NT) = SN(NT) + AMULT
>       SW(NT) = SW(NT) + AMULT*FFSCAT
>       SR(NT) = SR(NT) + AMULT*Q
>       SI(NT) = SI(NT) + AMULT*F
>
> Here WEIGHT = epsilon (the ISYSAB flag is ignored throughout), so all sums
> are being accumulated with the terms multiplied by 1/e (NSYM is the no. of
> asymmetric units so is constant and doesn't affect the results).  However
> IMO this factor should be applied only to individual intensities or their
> SDs (note that in the above code and that below, F is actually the
> uncorrected intensity just to further confuse you!).  The problem here is
> that for pure rotation axes the law of conservation of energy requires that
> the overall mean I is unchanged.  In any interference phenomenon energy can
> neither be created nor destroyed, merely transferred from one place to
> another.  So what happens is that the enhanced intensity of the axial
> reflections has been transferred from neighbouring reflections which have
> their intensities diminished in total by the same amount.  In fact an
> oscillating Bessel function centred on the axis is superimposed on the
> intensities so you get cylindical zones of alternating enhanced and
> diminishing intensities with the magnitude of the oscillations dying away as
> you go further from the axis.  However the energy conservation law requires
> that the net overall average I must be unchanged by the presence of the
> axis.
>
> This implies that the 1/e correction factor SHOULD NOT be included for pure
> rotation axes (and mirror planes) when summing for the mean I.  However the
> sums should be performed over a complete hemisphere given only one symmetry
> equivalent per reflection, which means that the multiplicity (m) factor
> SHOULD be included.  This is the direct opposite of what the code above is
> doing (i.e. it includes e but not m!).  The Fortran code would look like:
>
>        SI(NT) = SI(NT) + M*FI     # Total energy is conserved!
>        SN(NT) = SN(NT) + M       # Count reflections in hemisphere.
>
> Note that the statistically valid procedure will be different if one is say
> summing Is for a likelihood function, since this requires that the terms are
> statistically independent so one would then add only one term per
> equivalent, not a complete hemisphere, i.e. in that case the multiplicity
> factors should be omitted.
>
> For screw axes (and glide planes) the situation is different: there is no
> Bessel function and only the axial reflections are affected, so therefore it
> requires different handling in the code (as I said above, this is not
> happening!).  Now, since systematic absences are normally not present in the
> data, the mean intensity of the remaining reflections is enhanced by the e
> factor, purely by the action of omitting the systematic absences of zero I.
> This implies that we need to simulate the presence of the systematic
> absences when taking the mean.  So for example in the PG6 case we would have
> to sum the intensities of the 00l, l=6n reflections WITHOUT correction, but
> then count each 00l reflection as though it were 6 reflections (i.e. also
> counting the omitted sys. abs. in the average), so the code would now look
> like:
>
>        SI(NT) = SI(NT) + M*FI     # Total energy is still conserved!
>        SN(NT) = SN(NT) +M*E    # but also count the sys. abs. that were
> omitted.
>
> This implies that at least for the reflection counts, the e correction
> factor SHOULD be included for screw axes (and glide planes), and for the
> same reason as above the m factor SHOULD also be included.
>
> The differences between rotation and screw axes (or between mirrors and
> glides) arise because Wilson's assumption of uniform random distribution of
> atoms breaks down in the former case: an atom cannot approach a rotation
> axis or mirror plane closer than its VDW radius, so this excluded zone along
> the axis or plane causes an interference effect.  In both cases the main
> effect is actually that in projection along the axis the atomic positions
> are not random: they are correlated by an apparent inversion centre (it's
> actually another interference effect this time from pairs of atoms lying in
> the same plane of reflection and related by symmetry).
>
> All the above is relevant ONLY to taking the average intensity.  For other
> purposes the correct procedure is likely to differ.  For example if one is
> interested in the individual normalised structure amplitudes for direct
> methods (i.e. not just the mean), then the sqrt(1/e) factor clearly SHOULD
> be applied to the individual amplitudes.  Also if one is calculating higher
> moments of Z (= normalised I) then the deviations will not cancel (there's
> nothing in the energy conservation law that says that energy^n is conserved
> if n is not 0 or 1).  In the rotation axis case each large on-axis positive
> deviation tends to be offset by several small off-axis deviations, so in
> that case the optimal procedure would appear to be to multiply the on-axis
> Is by m/e before summing for the higher moments (say n >= 2), e.g.:
>
>       SM(N) = SM(N) + M*(FI/E)**N
>       NM(N) = NM(N) + M
>
> For the screw-axis case with the sys. abs. omitted the situation is again
> different and requires different code; IMO we should distribute an amount
> I/e from each axial reflection equally among the omitted sys. abs. and then
> include them as though they were all present:
>
>       SM(N) = SM(N) + M*E*(FI/E)**N
>       NM(N) = NM(N) + M*E
>
> One further issue needs to be addressed (TRUNCATE is not short of issues -
> the ones I mention here are only a fraction!).  The code for calculating the
> moments in TRUNCATE is:
>
> C---- Sums for moments of I
>          F = FFA(1)/WEIGHT
>          IF(F.GT.0.0) SMMEMM(1,NT,ICEN) = SMMEMM(1,NT,ICEN) + sqrt(F)
>          IF(F.GT.0.0) SMMEMM(3,NT,ICEN) = SMMEMM(3,NT,ICEN) + F*sqrt(F)
>          SMMIMM(1,NT,ICEN) = SMMIMM(1,NT,ICEN) + F
>          SMMIMM(2,NT,ICEN) = SMMIMM(2,NT,ICEN) + F**2
>          SMMIMM(3,NT,ICEN) = SMMIMM(3,NT,ICEN) + F**3
>          SMMIMM(4,NT,ICEN) = SMMIMM(4,NT,ICEN) + F**4
>          NMMNUM(NT,ICEN) = NMMNUM(NT,ICEN) + 1
>
> Notwithstanding that the WEIGHT factor (aka epsilon) probably should not be
> applied to the lower moments, and the multiplicity factor probably should be
> applied everywhere, there is still a problem here.  F is the uncorrected
> intensity but IMO we should be using the corrected intensity (i.e. by F &
> W's Bayesian procedure): why else are we calculating the correction if not
> to apply it?  The uncorrected intensities may be negative which adds
> spurious noise to the moments (a negative intensity makes the same
> contribution to an even moment as an equal positive intensity: this cannot
> possibly be correct).  However using the corrected Is brings another
> problem: when calculating the moments we should be using the expected values
> based on the posterior probability distribution of the Is.  This means
> integrating the moments over all expected Is > 0, multiplied by the
> probability density.  This is non-trivial, however there is a way using the
> parabolic cylinder functions U(a,x)
> (http://en.wikipedia.org/wiki/Parabolic_cylinder_functions).  The nice thing
> about this method is one can generalise it to calculate the
> Bayesian-corrected F and I as well as arbitrary moments and get rid of F &
> W's cubic spline interpolation code with the slightly worrying warning (see
> NEGIAS & NEGICS s/rs in TRUNCATE):
>
> C---- Accuracy - better than 5 percent  (i think).
>
> With the PCFs the code becomes both much simpler and much more accurate (to
> REAL*4 precision, so ~ 0.0001% accuracy!).
>
> I should also say that I believe that CTRUNCATE is not immune from these
> issues: it seems to be a straight translation at least in part from Fortran
> to C++ (though I'm far from being a C++ expert so I'll leave fixing
> CTRUNCATE to those who know what they're doing!).
>
> Sorry about the length of this: at least you can't say I didn't consult you!
>
> Cheers
>
> -- Ian
>



-- 
Dr Jon Agirre
York Structural Biology Laboratory / Department of Chemistry
University of York, Heslington, YO10 5DD, York, UK
http://www.york.ac.uk/chemistry/research/ysbl/people/research/jagirre/
+44 (0) 1904 32 8253

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager