GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - elkins-lab/synth-saxs: A lightweight Python library for simulating Small-Angle X-ray Scattering (SAXS) profiles from protein coordinates, with Jupyter Notebook examples.

BranchesTags
Open more actions menu

Latest commit

 

History

107 Commits
107 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
bioconda_recipe
bioconda_recipe
 
 
docs
docs
 
 
examples
examples
 
 
synth_saxs
synth_saxs
 
 
tests
tests
 
 
.coverage
.coverage
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
PUBLISHING.md
PUBLISHING.md
 
 
README.md
README.md
 
 
SECURITY.md
SECURITY.md
 
 
codecov.yml
codecov.yml
 
 
mkdocs.yml
mkdocs.yml
 
 
publish.sh
publish.sh
 
 
pyproject.toml
pyproject.toml
 
 

Repository files navigation

synth-saxs

codecov OpenSSF Best Practices PyPI version Python License: MIT DOI Tests Ruff Checked with mypy

synth-saxs is a lightweight Python library for simulating Small-Angle X-ray Scattering (SAXS) profiles from protein coordinates.

Extracted from the synth-pdb ecosystem, it provides a physically grounded, education-focused engine for reciprocal space simulation.


๐Ÿงช For Structural Biologists

  • Guinier & Kratky Analysis: Built-in plots to determine Radius of Gyration ($R_g$), forward scattering $I(0)$, and assess protein compactness.
  • Hydration Modeling: Physically accurate solvent displacement model based on Pavlov & Svergun (1997).

๐Ÿค– For Machine Learning Researchers

  • Debye Back-Calculation: O(Nยฒ) scattering intensity from atomic coordinates, suitable as a differentiable-style loss signal for structure validation.
  • Educational Clarity: Explicit, well-commented implementation of form factors and solvent contrast โ€” easy to audit and extend.

Features

  • Debye Formula: O(Nยฒ) calculation of scattering intensity.
  • Solvent Displacement: Physically accurate solvent contrast model based on Pavlov & Svergun (1997).
  • Atomic Form Factors: Standard Waasmaier & Kirfel (1995) coefficients.
  • Visualization: Built-in support for Kratky and Guinier plots.

๐Ÿ“š Tutorials

Experience synth-saxs directly in your browser:

  • Open In Colab SAXS Profile Generation โ€” Learn how to compute I(q) from coordinates and perform Kratky analysis.
  • Open In Colab Hydration Shell Analysis โ€” Interactive visualization of solvent contrast and its effect on perceived protein size.
  • Open In Colab End-to-End Validation โ€” Compare synthetic SAXS data against experimental benchmarks.
  • Open In Colab Synth Suite Bridge โ€” Demonstrate how to seamlessly link synth-pdb structure generation with synth-saxs.
  • Open In Colab Allosteric Hinge Motions โ€” Use $P(r)$ distance distributions to detect conformational changes in HIV-1 RT.
  • Open In Colab Interactive Sandbox โ€” Real-time SAXS profile manipulation.
  • Open In Colab IDPs vs Folded Proteins โ€” Contrasting scattering profiles of rigid and disordered proteins.

Installation

# Basic installation
pip install synth-saxs

# Installation with visualization support
pip install "synth-saxs[viz]"

# Documentation tooling for contributors
pip install "synth-saxs[docs]"

Command-Line Interface (CLI)

synth-saxs provides a CLI for rapid simulation and plotting:

# Basic simulation
synth-saxs protein.pdb --output profile.dat

# Plotting with Kratky analysis
synth-saxs protein.pdb --plot report.png --plot-type kratky

# Advanced modeling (Hydration Shell + P(r) distribution)
synth-saxs protein.pdb --shell-density 0.03 --p-dist pr.png --p-dist-dat pr.dat

CLI Arguments

  • input: Path to PDB/mmCIF file.
  • --output: Save $I(q)$ data to a .dat file.
  • --plot: Path to save a SAXS report image.
  • --shell-density: Excess hydration shell density (default: 0.0).
  • --p-dist: Save a plot of the $P(r)$ distribution.
  • --p-dist-dat: Save raw $P(r)$ data to a .dat file.

Quick Start

1. Single Structure Simulation

import biotite.structure.io.pdb as pdb_io
from synth_saxs import calculate_saxs_profile, add_noise

# Load a structure
struct = pdb_io.PDBFile.read("protein.pdb").get_structure(model=1)

# Calculate I(q) and add realistic noise
q, I = calculate_saxs_profile(struct)
I_noisy = add_noise(I, noise_level=0.02)

2. Ensemble Averaging

The SaxsSimulator can handle both Biotite stacks and standard Python lists of structures.

from synth_saxs import SaxsSimulator

# List of different conformation models
models = [model1, model2, model3]

sim = SaxsSimulator(q_max=0.3)
avg_intensity = sim.simulate(models)

3. Pair Distance Distribution P(r)

from synth_saxs import calculate_p_dist, plot_p_dist

r, pr = calculate_p_dist(struct)
plot_p_dist(r, pr, output_path="p_dist.png")

4. Visualization

from synth_saxs import plot_saxs_results
plot_saxs_results(q, I, plot_type="all", output_path="saxs_report.png")

Scientific Rationale

The engine is designed for numerical stability and educational clarity. It correctly handles the delicate balance between atomic contrast and solvent displacement decay to ensure monotonic scattering curves in the Guinier regime.

For detailed information on how the engine was validated against peer-reviewed experimental data, see the Scientific Validation Report.

References

  • Waasmaier, D. & Kirfel, A. (1995). Acta Cryst. A51, 416-431.
  • Pavlov, M.Y. & Svergun, D.I. (1997). J. Appl. Cryst. 30, 712-717.
  • Svergun, D., et al. (1995). J. Appl. Cryst. 28, 768-773.

Related Projects

This library is part of the synth-pdb ecosystem for synthetic biophysics data generation:

  • synth-pdb โ€” Core protein structure generator (CLI + API)
  • synth-nmr โ€” NMR observables simulator
  • synth-cryo-em โ€” Cryo-EM density map simulator
  • synth-dynamics โ€” ANM/Langevin dynamics engine
  • diff-biophys โ€” Differentiable JAX biophysics kernels
  • diff-ensemble โ€” IDP structural ensemble generator

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub. The project uses ruff for linting/formatting and mypy for type checking โ€” run pre-commit run --all-files before submitting.

See CONTRIBUTING.md for more details.

Community & Security

  • Code of Conduct: We expect all participants to follow our Code of Conduct.
  • Security: Please report security vulnerabilities privately according to our Security Policy.

License

MIT License โ€” see LICENSE for details.

Citation

If you use synth-saxs in your research, please cite:

@software{synth_saxs,
  author  = {Elkins, George},
  title   = {synth-saxs: SAXS profile simulation from protein coordinates},
  year    = {2026},
  url     = {https://github.com/elkins/synth-saxs},
  version = {0.1.10}
}

About

A lightweight Python library for simulating Small-Angle X-ray Scattering (SAXS) profiles from protein coordinates, with Jupyter Notebook examples.

elkins.github.io/synth-saxs/

Topics

biophysicscomputational-biophysicscomputational-structural-biologyproteinprotein-data-banksaxsscience-educationsimulationsmall-angle-xray-scatteringstructural-biology

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.