# Re: [ccp4bb]: Phasing Phoiled by Phistats in Philadelphia. Pfui.

```***  For details on how to be removed from this list visit the  ***

Dear Patrick,

I wonder whether your 'little program' might no contain an elementary
little mistake, namely that an absolute phase difference cannot exceed 180
degrees. This will not be automatically follow from making sure that the
phases are between 0 and 359 degrees: for instance if Phi1=1 and Phi2=359
you would get an absolute phase difference of 358 degrees, whereas the correct
value is clearly 2 degrees.

You just need to use the following code, after making sure that all
phases in degrees lie between 0.0 and 359.99 :

ABS DPHI  =  ABS ( PHI DEG 1 - PHI DEG 2 )
IF ( ABS DPHI .GT. 180.0 )   ABS DPHI  =  360.0  -  ABS DPHI

(sorry for the old-fashioned language this is written in).

I hope you notice some improvement.

With best wishes,

Gerard.

--------------------------------------------------------------------------------
>
>I'm confused about output I obtain from phistats.  I'm attempting to
>calculate the phase errors associated with various phasing procedures.
>I've written a little program to calculate the quantity:
>
><|deltaPhi|> = the mean value over all reflxns of the absolute value of the
>               difference between Phi1 and Phi2.  I calculate this for all
>               reflxns and for acentrics only
>
>In all cases, the DELF number obtained from phistats (described in the
>output as "average difference in degrees" for acentric reflxns) is
>substantially lower than the number I calculate independently (by, say, 20
>degrees).
>
>I've tried all the controls I can think of.  The most stringent control was
>to write h, k, l, F, sigF, Phi1, & Phi2 into a single ASCII file, one line
>per reflxn.  I made certain Phi1 and Phi1 both lay between 0 and 359 deg
>(ie, not -180 to 180).   I can then use F2mtz to create an mtz file from
>this & feed it into phistats.  This should cover most of the obvious
>problems (eg, reflxns from different sources reduced to different asym
>units).  The problem still persists.
>
>I'm assuming DELF is equivalent to quantity I describe above.  Am I wrong?
>I think it should mean the average absolute difference, rather than  the
>"average difference," since the phase errors are uncorrelated, and over a
>large dataset will average to zero.
>
>Of course one might suspect the little program I've written; but I've
>checked it every way I can imagine; and I think that even my meager coding
>skills are up to the task of calculating a difference between two columns
>of numbers and then averaging it...
>
>
>
>Pat, Puzzled in Pennsylvania
>
>^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>Patrick J. Loll, Ph. D.                             (215) 898-1294
>Department of Pharmacology                     FAX: (215) 573-2236
>University of Pennsylvania School of Medicine
>3620 Hamilton Walk