Skip to main content

Differentiable Cryo-EM map fitting in JAX

Project description

❄️ diff-em: Differentiable Cryo-EM Fitting in JAX

Tests License: MIT JAX

diff-em provides high-performance, auto-differentiable kernels for fitting atomic structures into Cryo-EM density maps. Built on JAX, it enables gradient-based optimization of coordinates directly against 3D experimental data.


🎯 Features

  • Gaussian Mixture Volumes: Represent atomic models as differentiable 3D density maps using sum-of-Gaussians (electrostatic potential approximation).
  • Cross-Correlation Kernels: Differentiable computation of map-to-model correlation coefficients (CC) for structural refinement (Rossmann, 2000).
  • Optimization Strategy: Compatible with multi-resolution fitting and neural density fields (Zhong et al., 2021).
  • Hardware Acceleration: Optimized for GPU/TPU execution via XLA, enabling the fitting of large complexes in seconds.

📚 Tutorials

Experience diff-em directly in your browser:

  • Open In Colab Cryo-EM Density Fitting — Learn how to optimize atomic coordinates directly against 3D density maps using cross-correlation.

🏗️ Technical Architecture

  • Backend: JAX (XLA-compiled).
  • Physics: 3D Gaussian placement with B-factor smoothing.
  • Optimization: Pure JAX implementation compatible with optax for high-dimensional gradient descent.

🧪 Scientific Validation

  • Density Parity: Simulated densities are verified against standard EM map generation tools (e.g., gemmi or ChimeraX).
  • CC Gradient Stability: Verified numerically stable gradients for structural refinement in the presence of noise.
  • Resolution Limits: Benchmarked against known high-resolution and low-resolution experimental maps.

🚀 Roadmap

  • Differentiable 3D Gaussian density kernels.
  • Cross-correlation (CC) loss functions.
  • Integration with MRC map loaders.
  • Automated multi-resolution refinement schedules.

🔗 Related Projects

diff-em is part of the differentiable biophysics ecosystem:


📖 Citation

@software{diff_em,
  author  = {Elkins, George},
  title   = {diff-em: Differentiable Cryo-EM map fitting in JAX},
  year    = {2026},
  url     = {https://github.com/elkins-lab/diff-em},
  version = {0.1.2}
}

⚖️ License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

diff_em-0.1.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

diff_em-0.1.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file diff_em-0.1.2.tar.gz.

File metadata

  • Download URL: diff_em-0.1.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for diff_em-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e1503960b5a5adcf4b52aebb1608c558da3d3283a5dedb7c3bd5d5c0ef9e5b36
MD5 42cdd87b93ba4d20df73b42f756960e0
BLAKE2b-256 70ea3d5c5e43143ceaa58788489b15df81040c8611bb9467c0e5f559e0f3a102

See more details on using hashes here.

Provenance

The following attestation bundles were made for diff_em-0.1.2.tar.gz:

Publisher: publish.yml on elkins-lab/diff-em

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file diff_em-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: diff_em-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for diff_em-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e19c338d804e11661fdaa10b84fdbac1e4f4fd07de4ea77b53e6089f541b0fef
MD5 ae3e9da8e7a6221d78dd3a628f3a1696
BLAKE2b-256 b20a22fef75026907c031146967e26b5592cad78d69818a568492d8569968f05

See more details on using hashes here.

Provenance

The following attestation bundles were made for diff_em-0.1.2-py3-none-any.whl:

Publisher: publish.yml on elkins-lab/diff-em

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page