Difference maps can be calculated using only higher resolution data. Imagine a time-dependent signal that consists of the displacement of only one atom. There is some negative difference electron density and some positive difference electron density both of which look approximately like an envelope of this atom that moves. Their diameters are in the range of 3 A , the diameter of the atom. To obtain such a difference electron density feature, only difference amplitudes at a resolution of 3 A and higher are required, and the low resolution amplitudes do not play a role. At low resolution chances are high that the difference amplitudes are (falsely) large since they are calculated from a difference of relatively large numbers (the amplitudes at low resolution).
A solution to this problem is to weight the difference amplitudes included in the Fourier-sum to calculate the difference maps. The weight is determined by two terms. i) If the difference amplitude is large relative to all the differences found in the data-set, the weight is small. ii) If the error (standard deviation) of the difference amplitude is large relative to those found in the entire data set, the weight is also small. This weighting scheme was invented by Zong Ren (Ren et al., 2001, Biochemistry). Before the weighting, all amplitude must be brought to a common scale, preferentially the absolute scale. This is achieved with the XtalView programs ‘stfact’, ‘xmerge’ and ‘xfft’ and a number of ‘awk’-commands to manipulate the data. ‘stfact’ calculates structure-factors from a precise atomic model. They are automatically on the absolute scale. The measured dark (reference) Laue structure factor amplitudes are scaled to these calculated amplitudes and are then also on the absolute scale. The measured time-dependent Laue-amplitudes are scaled to the corresponding measured dark Laue-amplitudes. Consequently, both dark and time-dependent Laue-amplitudes are on the absolute scale. A word to the convention used here: unlike conventional structure factor amplitudes, difference amplitudes can be negative and positive. If they are negative they are made positive here by flipping the phase by 180 degrees. As a result, difference amplitudes are all positive and can be treated like conventional amplitudes in all subsequent calculations.
Here is a little example for PYP:
first, bring the dark data to absolute scale
note: use 20 scaling bins in ‘xmerge’
stfact needs a 6-column file
awk '{print $1,$2,$3,$4,$5," 0.0"}' pyp10a_off.hkl > pyp10a_off6.hkl
stfact 2PHY.pdb pyp10a_off6.hkl pyp10a_off6.phs
R-factor = 0.265
bring to absolute scale:
awk '{print $1,$2,$3,$5," 0.0 "," 0.0","9999.9"}' pyp10a_off6.phs > tmp1.hkl
awk '{print $1,$2,$3,$4,$5," 0.0 ","9999.9"}' pyp10a_off6.hkl > tmp2.hkl
xmerge tmp1.hkl tmp2.hkl tmp3.hkl
awk '{print $1,$2,$3,$8,$9,"0.0"}' tmp3.hkl > pyp10a_off6_as.hkl
=> dark data are on absolute scale
then, bring the time-dependent data to absolute scale
check the data:
awk '{print $1,$2,$3,$4,$5," 0.0"}' pyp10a_170ns.hkl > pyp10a_170ns6.hkl
stfact 2PHY.pdb pyp10a_170ns6.hkl pyp10a_170ns6.phs
R-factor = 0.258,
scale 170ns and dark :
awk '{print $1,$2,$3,$4,$5,"0.0","9999.9"}' pyp10a_off6_as.hkl > tmp1.hkl
awk '{print $1,$2,$3,$4,$5,"0.0","9999.9"}' pyp10a_170ns6.hkl > tmp2.hkl
xmerge tmp1.hkl tmp2.hkl tmp3.hkl
awk '{print $1,$2,$3,$8,$9,"0.0"}' tmp3.hkl > pyp10a_170nsassm.hkl
=> time-dependent data scaled to their corresponding dark data
The 3 input data-files with contain amplitudes on the absolute scale and the phases that needed for the weighting process are listed here together with the file-name of the weighted difference structure factors.
pyp10a_170nsassm.hkl
pyp10a_off6_as.hkl
pyp10a_off6.phs
pyp10a_170ns-dark.phs
These four files are needed by the program ‘weight_zv2’ and can be conveniently placed in an input-file ‘wmar.inp’. The program reads 4 files. 3 files contain data, and the 4th contains the weighted difference structure factors. File 1: time-dependent structure factor amplitudes and their standard deviation on the absolute scale, Ascii, 5 columns: h k l, F(t), sigmaF(t). File 2: reference (dark) state structure factor amplitudes on the absolute scale, Ascii, 5 columns: h k l, Fobs(dark), sigmaFobs(dark). File 3: structure factors of the dark state, Ascii, 6 columns: h k l dummy Fcalc(dark) Phi(dark). Only Phi(dark) is needed here. File 4: weighted difference structure factors, Ascii, 6 columns: h k l deltaF(t) weighting Phi(dark). The deltaF(t) are all divided by the average weighting factor to maintain the absolute scale.
So the command looks like:
weight_zv2 < wmar.inp
The program outputs some statistics on the difference amplitudes, an example is shown below:
FIRST DATA SET (REFERENCE) : pyp10a_170nsassm.hkl
SECOND DATA SET : pyp10a_off6_as.hkl
PHASES DATA SET : pyp10a_off6.phs
DIFFERENCE F AND WEIGHT OUTPUT : pyp10a_170ns-dark.phs
NUMBER OF HKL IN FILE1 : 9822
NUMBER OF HKL IN FILE2 : 10468
NUMBER OF PHASES IN FILE3 : 10468
NUMBER OF MATCHING HKL : 9822
NUMBER OF DIFFERENCE-F WRITTEN OUT : 9822
MEAN AMPLITUDE DIFFERENCE : -0.4269E-03
MEAN AMPLITUDE DIFFERENCE/
MEAN AMPLITUDE DIFFERENCE SQUARED : 0.1823E-06
MEAN ABSOLUTE AMPLITUDE DIFFERENCE : 13.2765
MEAN ABSOLUTE AMPLITUDE DIFFERENCE SQUARED (Z): 176.2649
MEAN SQUARE AMPLITUDE DIFFERENCE (M): 689.7543
MEAN SIGMA OF DIFFERENCE AMPLITUDES : 5.0216
MEAN SIGMA OF DIFFERENCE AMPLITUDES SQUARED (Z): 25.2165
MEAN SQUARE SIGMA OF DIFFERENCE AMPLITUDES (M): 58.9645
AVERAGE WEIGHT (M): 0.6515
AVERAGE ZHONG WEIGHT (Z): 0.4644
The average weight marked by (M) is used to normalize the output.
The last step is the calculation of the difference map in ‘fsfour’-format with ‘xfft’.
It simply goes like this:
xfft pyp10a_170ns-dark.phs
pick the option:
Very important: write down the scaling factor (xfft-factor) that normalizes the (difference) electron density to a sigma-value of 50. This is due to an unfortunate fsfour-format feature. Fsfour-maps consist of voxles that contain integer*4 (four byte integer) numbers. Since most electron density values are smaller than 1 e/A**3 they have to be multiplied with some large number to be represented accurately enough by integer numbers. For coventional electron densities the 'xfft-factor' is on the order of 200. For good difference maps, typical values are around 2000.
you can download the source code of weight_zv2 here. Press right mouse button and save target to: weight_zv2.f. Compile with Fortran 77 or Fortran 90 with appropriate compliler options to accommodate lines longer than 72 characters.