Debian Codegraph @

docs/source/saxs/saxs_ift.rst

raw
1 Indirect Fourier Transform (IFT) and the P(r) function
2 ----------------------------------------------------------
3 .. _saxs_ift:
4
5 This tutorial covers basic principles and best practices for doing an
6 Indirect Fourier Transform (IFT) to get a P(r) function. This is not a tutorial
7 on how to use RAW for this type of analysis. For that, please see
8 the RAW tutorial for :ref:`GNOM <s2p1>` and :ref:`BIFT <bift_tutorial>`.
9
10
11 Overview
12 ^^^^^^^^^^^^^^^^^
13
14 The SAXS scattering profile is measured in reciprocal distance space, as
15 I(q) where *q* has units of one over distance (usually 1/Angstrom or
16 1/nm). We can apply a Fourier transform to the data to get information
17 in real space about the macromolecule, as:
18
19 .. math::
20
21 P(r) = \frac{r^2}{2\pi^2} \int_0^{\infty} q^2I(q) \frac{\sin(qr)}{qr}dq
22
23 This produces the P(r) function, also called the pair distance distribution function.
24 Essentially, the P(r) function is the r\ :sup:`2` weighted histogram of all
25 possible pairs of electrons in the sample.
26
27 Why do we do an IFT?
28 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29
30 The P(r) function contains valuable information about the shape and size of
31 a macromolecule. First, in doing the P(r) function we get an estimate of the
32 maximum dimension of the macromolecule (|Dmax|). It also provides another, potentially
33 more accurate, way to calculate the |Rg| and I(0). The shape of the P(r) function
34 can also be directly interpreted in terms of the shape of the macromolecule,
35 providing information about the overall shape, such as globular vs. rod-like,
36 or whether the macromolecule contains multiple domains. Also, the P(r) function
37 and derived parameters such as |Dmax| are required for many advanced analysis
38 techniques including ab-initio reconstructions of the shape.
39
40 Additionally, the P(r) function is sensitive to data quality issues, particularly
41 aggregation and interparticle interference. Thus, doing an IFT is another
42 quality check on your data. If you cannot obtain a good P(r) function, then
43 your data probably has one of those issues and usually should not be used for
44 further analysis.
45
46
47 How do we do an IFT?
48 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49
50 The equation above cannot be used to directly calculate the P(r) function.
51 The finite extent of our measurement (and measurement noise) means that a
52 direct Fourier transform of I(q) will distort the true P(r) function by
53 introducing truncation artifacts. Instead, the typical approach is to
54 fit the P(r) function against the data. First, you generate the scattering
55 intensity for a given P(r) function as:
56
57 .. math::
58
59 I(q) = 4\pi \int_0^{D_{max}} P(r) \frac{\sin(qr)}{qr}dr
60
61 Using this equation you generate the P(r) function that yields the best fit
62 to the data. The fitting criteria include both the actual fit, usually as measured
63 by :math:`\chi^2`, and regularization parameters. These regularization parameters
64 allow you to add back in information to improve the P(r) function. Typical
65 examples of the regularization parameters include perceptual criteria such as:
66
67 * Smoothness of the P(r) function.
68 * Positivity of the P(r) function.
69 * Whether the solution changes significantly when changing the weighting of
70 the regularization parameters.
71
72 Determining a P(r) function in this way thus requires determining three things:
73
74 #. The maximum dimension, |Dmax|, of the sample, as that determines the upper
75 bound of the integral above.
76 #. The weighting parameter, usually called :math:`\alpha`, that determines
77 the relative contribution of :math:`\chi^2` and the perceptual criteria
78 to the overall fit quality.
79 #. The P(r) function that yields the best fit to the data, given the
80 particular |Dmax| and :math:`\alpha` values.
81
82 This is a complicated problem, and there are a number of different programs
83 out there for finding a P(r) function. These programs all typically involve
84 searching a set of possible |Dmax| values and :math:`\alpha` values to find
85 which yields the best overall fit. RAW natively supports one method for
86 finding the P(r) function, the Bayesian Indirect Fourier Transform (BIFT)
87 [1], which provides a completely automated determination of |Dmax|
88 and :math:`\alpha`.
89
90 The most popular method for determining the P(r) function is the GNOM [2] software
91 in the ATSAS package, which RAW provides an interface to if ATSAS is installed.
92 Below we discuss how to determine a good P(r) function using GNOM, after discussing
93 the criteria for a good P(r) function.
94
95 Criteria for a good P(r) function
96 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
97
98 We employ the following criteria to determine if a P(r) function is good:
99
100 #. **The P(r) function falls gradually to zero at** :math:`\mathbf{D_{max}}`\ **.**
101 #. **The P(r) function fits the measured scattering profile.**
102 #. **The P(r) function goes to zero at** :math:`\mathbf{r=0}`
103 **and** :math:`\mathbf{r=D_{max}}`\ **.**
104
105 Additionally, the following criteria usually apply:
106
107 #. **The** :math:`\mathbf{R_{g}}` **and I(0) from the Guinier fit and the P(r) function agree well.**
108 #. **The P(r) function is always positive.**
109
110 .. figure:: images/pr_good_gi.png
111 :target: ../_images/pr_good_gi.png
112
113 A P(r) function done in RAW using GNOM for glucose isomerase (available
114 in the RAW Tutorial data). This shows what a good P(r) function looks like.
115 The function goes smoothly to zero at |Dmax|, it is always positive,
116 there is good agreement between the Guinier and P(r) |Rg| and I(0) values,
117 and the residuals are mostly flat and randomly distributed. You can see
118 a small systematic deviation in the residuals below q~0.125. This
119 could be smoothed out by reducing the :math:`\alpha` value, which may be slightly
120 over weighting the regularization parameters vs. the actual fit to the
121 data.
122
123 A more thorough discussion of each criterion is given below.
124
125 The P(r) function falls gradually to zero at |Dmax|
126 ******************************************************
127
128 This is perhaps the most important and most subjective criterion for determining
129 whether you have a good P(r) function. The idea is straightforward: macromolecules
130 do not have perfectly sharp boundaries. Because they have side chains that stick
131 out, and have some amount of flexibility in solution (even if limited to
132 solvent exposed side chains), there is no distance at which you go from
133 many electrons pairs to no electron pairs within the macromolecule. As such,
134 the P(r) function should gradually approach zero at the maximum dimension,
135 rather than being cut off.
136
137 Essentially, if this criterion is met you have picked an appropriate |Dmax|
138 for the system. If you underestimate the |Dmax|, then the P(r) function
139 has an abrupt descent to zero, while an overestimated |Dmax| usually
140 shows an oscillation about zero. This is shown in the figure below.
141
142 .. figure:: images/pr_dmax_variation.png
143 :target: ../_images/pr_dmax_variation.png
144 :height: 400 px
145
146 The left and right plots show three different P(r) functions for the same
147 protein (glucose isomerase, available in the RAW Tutorial Data). The
148 difference between the three is the |Dmax|, which is either 83 (blue),
149 103 (orange) or 123 (green) Angstrom. The left plot shows the full
150 P(r) function. The different |Dmax| values yield similar P(r) functions,
151 so much so that they end up plotted on top of each other for most of their
152 r values. The right plot is the same functions showing just the end,
153 as P(r) approaches zero at |Dmax|.
154
155 In the plot above, we can clearly see that for a |Dmax| of 83, the P(r)
156 function is forced abruptly down. For a |Dmax| of 103, the function has a
157 smooth approach to zero. For a |Dmax| of 123 the function reaches zero and
158 then oscillates about it. From this we can conclude that 103 is a good
159 value for |Dmax|, whereas 83 is underestimated and 123 is overestimated.
160
161 The P(r) function fits the measured scattering profile
162 ***********************************************************
163
164 This criterion is straightforward. The transformation of the P(r) function
165 to I(q) should fit the measured scattering profile. This can be evaluated
166 both through the :math:`\chi^2` value of the fit, which should be close to 1,
167 and the normalized residuals between the fit and the data, which should be flat
168 and randomly distributed about zero.
169
170 The P(r) function goes to zero at :math:`\mathbf{r=0}` and :math:`\mathbf{r=D_{max}}`.
171 ****************************************************************************************
172
173 The reason for this criterion is straightforward. The P(r) function
174 should go to zero at r=0 because it is the number of electron pairs in the
175 macromolecule. As r decreases, the number of electron pairs
176 decreases until you reach an r smaller than the size of an electron,
177 at which point there are no pairs left and thus P(r) must go to zero at
178 :math:`r=0`. The P(r) function should go to zero at :math:`r=D_{max}`
179 because |Dmax| is the maximum dimension of the particle. Beyond that distance
180 there should be no electron pairs in the particle. This criterion is usually
181 enforced by conditions in the IFT calculation.
182
183 The |Rg| and I(0) from the Guinier fit and the P(r) function agree well
184 ***************************************************************************
185
186 The |Rg| and I(0) values can be determined directly from the P(r) function.
187 This provides a complementary approach to the Guinier fit. For well behaved
188 rigid systems, |Rg| and I(0) should agree well between both methods. If
189 they do not, it may suggest a problem in either the Guinier fit or the
190 P(r) function. However, for flexible and disordered systems, it has been
191 observed that the P(r) |Rg| and I(0) values are characteristically larger,
192 and more reliable, than the Guinier |Rg| and I(0) values [3].
193
194
195 The P(r) function is always positive
196 *************************************
197
198 This criterion usually applies, as for most macromolecules the presence of a negative
199 number of electron pairs has no meaning. However, when dealing with membrane
200 proteins that are encapsulated in lipids or detergents, this criterion is no
201 longer valid. In those cases, the lipid/detergent may have a lower electron
202 density than the buffer. As scattering is measured relative to the solvent,
203 this lower density will appear as negative electron pairs in the P(r) function.
204 For example, proteins embedded in lipid nanodiscs have a characteristic dip
205 in the P(r) function that can go negative.
206
207
208 Determining a good P(r) function using GNOM
209 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
210
211 While it takes some practice to learn how to properly evaluate the P(r) function,
212 there is a set of steps that I regularly follow when creating a P(r) function
213 using GNOM via the RAW interface:
214
215 #. Open the GNOM interface. It defaults to what GNOM thinks is a reasonable
216 |Dmax| (using datgnom).
217 #. If necessary, set the starting q value for the P(r) function to match
218 that of the Guinier fit (newer versions of RAW do this automatically).
219 #. Set the |Dmax| value to 2-3 times larger than the initial value.
220 #. Look for where the P(r) function drops to 0 naturally. Set the |Dmax|
221 value to this point.
222 #. Turn off the force to zero at |Dmax| condition.
223 #. Tweak |Dmax| up and down until it naturally goes to zero (with the force
224 to zero turned off).
225 #. Turn the force to zero at |Dmax| condition back on.
226 #. If needed, truncate the P(r) function to a maximum q of 8/R\ :sub:`g`,
227 or 0.25-0.3 1/Angstrom, whichever is smaller, if using for bead model
228 reconstructions with DAMMIF/N. You may have to tweak the |Dmax| a bit after
229 truncation.
230
231 If you have good quality data, this ought to produce a good P(r) function.
232
233 Note that even for good quality data with a mostly rigid globular macromolecule
234 like glucose isomerase (shown in the plots above), there usually isn't a single
235 right value of |Dmax|. For this data, a best case scenario, you could reasonably
236 pick a |Dmax| value from ~99-104, which is a 5% variation. For macromolecules
237 with more flexibility, |Dmax| is even more poorly defined. As a rule of thumb,
238 |Dmax| is usually never determined to better than 5%, sometimes the uncertainty
239 is closer to 10%.
240
241 Other tips:
242
243 * If the residual has too much systematic deviation, you can manually set
244 the :math:`\alpha` to something smaller than the automatic value. Start
245 with half the automatically determined value, and tweak from there.
246
247 * Don't forget to check that the |Rg| and I(0) values agree (if you have a
248 rigid system). Generally speaking, increasing |Dmax| will increase
249 the P(r) |Rg| and I(0) values, so that can help guide your choice of |Dmax|.
250
251 * Don't truncate your P(r) function for electron density reconstructions
252 with DENSS.
253
254
255 What is a bad P(r) function, and what does it mean?
256 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
257
258 Even if you follow all of the guidelines above, sometimes you can end up with
259 a bad P(r) function. Typically what bad means is one of two things:
260
261 #. You can't find a good |Dmax| value. You keep increasing |Dmax| and the P(r)
262 function never smoothly goes to zero.
263
264 #. If you increase |Dmax| the P(r) function goes negative.
265
266 In these cases, it is most likely that your data has a problem. The figure
267 below gives a quick summary of the most common pathologies, more detail is
268 available in the sections below.
269
270 .. figure:: images/pr_overview_jacques.png
271 :target: ../_images/pr_overview_jacques.png
272
273 Figure 3 from [4]. A, G, and J show a good (monodisperse) scattering profile
274 and P(r) function. B, H, and K show a scattering profile and P(r) function with
275 varying degrees of interparticle interference. C, I, and L show a scattering
276 profile and P(r) function with varying degrees of aggregation. the middle row
277 shows the effect on the P(r) function, while the last row shows that to
278 really judge the effect of the change on the P(r) function you should extend
279 the |Dmax| value out significantly.
280
281 Note that both pathologies are easiest to see when you plot the P(r) function well
282 past the point where you think the correct |Dmax| value is (panels J-L in the
283 above figure). This means that it is important to always extend the |Dmax| value
284 when generating your P(r) function to verify that the P(r) function stays flat
285 and close to zero (usually small oscillations about zero), as in panel J, rather
286 than dipping negative (panel K, repulsive interparticle interference) or
287 staying slightly positive (panel L, aggregation).
288
289 Aggregation
290 *************
291
292 Aggregation in solution means some amount of larger particles are present.
293 The presence of these larger particles causes the |Dmax| to be hard to
294 determine. Typically this manifests as there being a significantly extended tail
295 on the P(r) distribution, which does not fall to zero naturally regardless of the
296 chosen |Dmax|. The P(r) function calculated |Rg| and I(0) will also be larger
297 than they would be for the monodisperse sample.
298
299 Small amounts of aggregation can look similar to the P(r) function for a flexible
300 system, so other methods should be used to determine the true state of the system.
301 The Guinier analysis will usually reveal the presence of aggregates, and Kratky
302 plot will show if the system is flexible. If you are unsure whether your P(r)
303 function is showing aggregation or flexibility, check with these other techniques.
304
305
306 Interparticle interference
307 ******************************
308
309 Interparticle interference usually manifests as repulsion in solution. This
310 repulsive effect manifests as an artificially small |Dmax|. The P(r) function
311 calculated |Rg| and I(0) values are reduced compared to what they would be
312 for the non-interacting sample.
313
314 Since you usually don't know the |Dmax| of your sample prior to making the
315 measurement, it can be hard to tell if the |Dmax| is artificially small. In
316 this case, the easiest way to see this effect is to extend the |Dmax| out past
317 what you found to be a 'good' |Dmax|. If the P(r) function goes and stays negative,
318 as in K of the above figure, then you have a repulsive interaction. If it stays
319 near zero (possibly with some small oscillation about zero), as in J of the
320 above figure, then you are not seeing a repulsive interaction.
321
322
323
324 How to interpret features of a P(r) function
325 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
326
327 The P(r) function provides a significant amount of information on particle
328 shape and size in solution. The easiest parameters to interpret are the
329 |Dmax|, |Rg|, and I(0), which all inform on particle size. The |Dmax| is simply
330 the maximum dimension of the particle. The |Rg| is the radius of gyration,
331 and I(0) is the scattering at zero angle, which is proportional to the
332 molecular weight and concentration. Beyond these parameters, the shape of
333 the P(r) function contains significant information about the particle shape.
334 This is seen clearly in the plot of P(r) functions for different
335 geometric bodies shown below.
336
337 .. figure:: images/pr_shapes.png
338 :target: ../_images/pr_shapes.png
339
340 P(r) functions for geometric bodies, adapted from figure 5 of [5].
341
342 In the above figure, there are several things worth noting:
343
344 #. In the P(r) function for a long rod, the initial peak at short distance
345 comes from electron pairs across the short dimension of the rod. The long
346 extend tail comes from electron pairs along the length of the rod.
347 #. In the P(r) function for a dumbbell, the peak at lower r comes from the
348 electron pairs within each individual domain of the dumbbell. The peak
349 at longer distance comes from the electron pairs between the two domains
350 of the dumbbell.
351 #. For the hollow sphere, the peak at long distance is coming from the electron
352 pairs across the diameter of the sphere.
353
354
355 While macromolecules do not have P(r) functions that exactly match those of
356 geometric bodies, the dominant features of the P(r) function can be used to
357 determine overall shape characteristics of the macromolecule. Most usefully:
358
359 * Globular proteins tend to have P(r) functions similar to that of a solid
360 sphere.
361 * Long rigid rod-like systems, like duplex DNA, have P(r) functions very
362 similar to that of a long rod.
363 * Multi-domain proteins have two peaks, like that of a dumbbell. However,
364 as the domains are not usually symmetric in size or widely separated,
365 the peaks are usually more of a strong peak and an overlapping shoulder
366 peak.
367
368 The plot below shows the P(r) function for several actual macromolecules.
369
370 .. figure:: images/pr_protein_shapes.png
371 :target: ../_images/pr_protein_shapes.png
372 :width: 500 px
373
374 P(r) functions for flexible (unfolded), multidomain, and globular proteins.
375 Figure 24 in [6].
376
377
378 FAQ
379 ^^^^^^^^
380
381 Is a small change in |Dmax| significant?
382 *********************************************
383
384 Small changes in |Dmax| are usually not significant. Even for good quality data
385 with a mostly rigid globular macromolecule like glucose isomerase (shown in the
386 plots above), you could reasonably pick a |Dmax| value from ~99-104, which is
387 a 5% variation. For macromolecules with more flexibility, |Dmax| is even more
388 poorly defined. As a rule of thumb, |Dmax| is usually never determined to
389 better than 5%, sometimes the uncertainty is closer to 10%.
390
391 My P(r) function goes negative. Is that okay?
392 *************************************************
393
394 Generally speaking, no. However, if you have a system that is detergent or lipid
395 bound, such as a protein embedded in a nanodisc, then you may see a negative
396 dip in your P(r) function.
397
398
399
400 References
401 ^^^^^^^^^^^^
402
403 1. Hansen, S. J. Appl. Crystallogr.(2000) 33, 1415-1421. DOI:
404 `10.1107/S0021889800012930 <https://doi.org/10.1107/S0021889800012930>`_
405
406 2. Svergun D.I. (1992). J. Appl. Crystallogr. 25, 495-503. DOI:
407 `10.1107/S0021889892001663 <https://doi.org/10.1107/S0021889892001663>`_
408
409 3. Kikhney, A. G. & Svergun, D. I. (2015). FEBS Lett. 589, 2570–2577. DOI:
410 `10.1016/j.febslet.2015.08.027 <https://doi.org/10.1016/j.febslet.2015.08.027>`_
411
412 4. Jacques, D. A. & Trewhella, J. (2010). Protein Sci. 19, 642–657.
413 DOI: `10.1002/pro.35 <https://doi.org/10.1002/pro.351>`_
414
415 5. Svergun, D. I. & Koch, M. H. J. (2003). Reports Prog. Phys. 66, 1735–1782.
416 DOI: `10.1088/0034-4885/66/10/R05 <https://doi.org/10.1088/0034-4885/66/10/R05>`_
417
418 6. Putnam, C. D., Hammel, M., Hura, G. L. & Tainer, J. a (2007). Q. Rev.
419 Biophys. 40, 191–285. DOI: `10.1017/S0033583507004635
420 <https://doi.org/10.1017/S0033583507004635>`_
421
422 .. |Rg| replace:: R\ :sub:`g`
423
424 .. |Dmax| replace:: D\ :sub:`max`