saxs Module
The saxs module enables the simulation of Small-Angle X-ray Scattering (SAXS) profiles from atomic structures and ensembles.
Overview
SAXS is a technique used to probe the global shape, size, and flexibility of proteins in solution. This module uses the Debye Formula to calculate the scattering intensity \(I(q)\) as a function of the scattering vector magnitude \(q\).
Key Features
- Debye Formula Implementation: Accurate \(O(N^2)\) calculation of interference patterns.
- Atomic Form Factors: Uses \(q\)-dependent Gaussian approximations for C, N, O, S, P, and H.
- Solvent Contrast: Accounts for the scattering of the displaced solvent volume (hydration shell approximation).
- Ensemble Averaging: Computes the mean scattering profile for flexible structures or structural ensembles.
API Reference
saxs
EDUCATIONAL OVERVIEW - SAXS Curve Simulation:
---------------------------------------------
Small-Angle X-ray Scattering (SAXS) is a fundamental technique for studying
protein structure and dynamics in solution. This module computes synthetic
scattering curves (I(q) vs q) from atomic coordinates.
SCIENTIFIC PRINCIPLES:
----------------------
1. The Debye Formula: The scattering intensity I(q) is computed by summing the
interference between all pairs of atoms in the molecule.
I(q) = sum_i sum_j f_i(q) f_j(q) * sin(q * r_ij) / (q * r_ij)
where q is the scattering vector magnitude and r_ij is the distance between
atoms i and j.
2. Atomic Form Factors: Atoms of different elements scatter X-rays with
different efficiencies. We use q-dependent form factors approximated by
a sum of Gaussians (Waasmaier & Kirfel, 1995).
3. Solvent Contrast (Solvation Shell): In SAXS, we measure the "excess"
scattering of the protein relative to the solvent. We subtract the
scattering contribution of the displaced solvent volume (V) for each atom.
CRITICAL PHYSICAL STABILITY NOTE:
The effective scattering factor is f_eff(q) = f_vac(q) - rho_sol * V * exp(-q^2 * R^2 / 10).
If the volume V is underestimated (e.g., V=0 for H), the f_eff(q) contrast
profile becomes unstable. Specifically, the upward "pressure" from the
decaying solvent term can exceed the downward "pressure" from the protein's
interferometry, causing non-physical increases in I(q) at low q.
Maintaining standard volumes (Pavlov & Svergun, 1997) is essential.
REFERENCES:
-----------
- Waasmaier, D. & Kirfel, A. (1995). New analytical scattering-factor
functions for free atoms and ions. Acta Cryst. A51, 416-431.
- Pavlov, M.Y. & Svergun, D.I. (1997). A dataset for testing the
algorithms of small-angle scattering data analysis. J. Appl. Cryst. 30, 712-717.
- Svergun, D., Barberato, C. & Koch, M. H. (1995). CRYSOL - a program to
evaluate X-ray solution scattering of biological macromolecules from
atomic coordinates. J. Appl. Cryst. 28, 768-773.
Classes
SaxsSimulator
Stateful SAXS simulator for ensembles.
Source code in synth_pdb/saxs.py
Functions
simulate(structure)
Computes the averaged SAXS profile for a structure or ensemble.
Source code in synth_pdb/saxs.py
Functions
calculate_saxs_profile(structure, q_min=0.0, q_max=0.5, n_points=51, include_solvent=True, solvent_density=0.334)
Calculate the SAXS profile I(q) for a protein structure.
This implements the Debye formula with O(N^2) complexity.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
structure
|
AtomArray
|
Biotite AtomArray (full atom recommended). |
required |
q_min
|
float
|
Minimum q value (default 0.0). |
0.0
|
q_max
|
float
|
Maximum q value (default 0.5). |
0.5
|
n_points
|
int
|
Number of q points. |
51
|
include_solvent
|
bool
|
If True, subtracts displaced solvent volume. |
True
|
solvent_density
|
float
|
Electron density of the solvent. |
0.334
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
Tuple of (q_values, intensity_values). |
Source code in synth_pdb/saxs.py
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
export_saxs_profile(q, intensity, output_file)
Export SAXS data to a standard .dat file (q, I, error).
Source code in synth_pdb/saxs.py
Scientific Principles
The Debye Formula
The total scattering intensity \(I(q)\) is computed by summing the interference between all pairs of atoms \(i\) and \(j\):
where: - \(q\) is the scattering vector (\(q = \frac{4\pi \sin \theta}{\lambda}\)). - \(r_{ij}\) is the distance between atoms \(i\) and \(j\). - \(f_i(q)\) is the effective atomic form factor.
Solvent Subtraction
In solution, we measure the "excess" scattering of the protein. The module approximates the effective form factor as:
where \(\rho_{sol}\) is the electron density of the solvent and \(V_i\) is the atomic volume.
Usage Example
from synth_pdb.generator import PeptideGenerator
from synth_pdb.saxs import calculate_saxs_profile, export_saxs_profile
# 1. Generate a structure
gen = PeptideGenerator("NSDSECPLSHDGYCLHDGVCMYIEALDKYACNCVVGYIGERCQ")
structure = gen.generate(conformation="alpha")
# 2. Simulate SAXS profile
q, intensity = calculate_saxs_profile(
structure,
q_min=0.0,
q_max=0.5,
n_points=100
)
# 3. Export to .dat file
export_saxs_profile(q, intensity, "protein_saxs.dat")