An open API service indexing awesome lists of open source software.

https://github.com/elkins-lab/diff-em

Differentiable Cryo-EM map fitting in JAX
https://github.com/elkins-lab/diff-em

biophysics computational-biophysics computational-structural-biology cryo-em differentiable-programming jax structural-biology

Last synced: 16 days ago
JSON representation

Differentiable Cryo-EM map fitting in JAX

Awesome Lists containing this project

README

          

# โ„๏ธ diff-em: Differentiable Cryo-EM Fitting in JAX

[![Tests](https://github.com/elkins-lab/diff-em/actions/workflows/test.yml/badge.svg)](https://github.com/elkins-lab/diff-em/actions/workflows/test.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![JAX](https://img.shields.io/badge/backend-JAX-9cf.svg)](https://github.com/google/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](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/elkins-lab/diff-em/blob/main/examples/interactive_tutorials/cryo_em_fitting_tutorial.ipynb) **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

- [x] Differentiable 3D Gaussian density kernels.
- [x] 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:

- [diff-biophys](https://github.com/elkins-lab/diff-biophys) โ€” Core differentiable biophysics engine.
- [diff-hdx](https://github.com/elkins-lab/diff-hdx) โ€” Differentiable HDX-MS prediction.
- [synth-cryo-em](https://github.com/elkins-lab/synth-cryo-em) โ€” Cryo-EM simulation.

---

## ๐Ÿ“– Citation

```bibtex
@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