Differentiable biophysical modeling in JAX
Project description
🧬 DiffBiophys: Differentiable Biophysics for the AI Era
DiffBiophys is a high-performance Python library for differentiable biophysical modeling. Built on JAX, it re-implements core structural biology and spectroscopy observables (SAXS, NMR, CD) as hardware-accelerated, auto-differentiable kernels.
Documentation Website | Use Cases
🎯 Vision
To bridge the gap between static structural models and experimental solution-state data by providing a "differentiable bridge." This allows researchers to:
- Optimize protein structures directly against experimental spectra via gradient descent.
- Train machine learning models using physics-informed loss functions.
- Accelerate large-scale biophysical simulations on GPUs and TPUs.
🏗️ Core Components
1. diff_biophys.geometry (Differentiable Structural Engine)
- NeRF (Natural Extension Reference Frame): Differentiable conversion from internal coordinates ($\phi, \psi, \omega$, bond lengths/angles) to Cartesian XYZ.
- Kabsch Alignment: Differentiable optimal superposition using SVD.
- Torsion Analysis: Vectorized calculation of all backbone and side-chain dihedrals.
2. diff_biophys.saxs (Differentiable Scattering)
- Debye Formula: $O(N^2)$ inter-atomic interference summation.
- Hardware Acceleration: GPU-optimized pairwise distance kernels.
- Use Case: Fitting structure "compactness" and "radius of gyration" to solution-state X-ray scattering curves.
3. diff_biophys.nmr (Differentiable Spectroscopy)
- Residual Dipolar Couplings (RDCs): Differentiable Saupe tensor alignment and coupling calculation.
- Chemical Shifts: Differentiable Ring-Current (Johnson-Bovey) shielding and Karplus J-coupling kernels.
- Use Case: Refining side-chain packing and domain orientations against high-resolution NMR data.
4. diff_biophys.cd (Differentiable Dichroism)
- Matrix-Method Simulation: Differentiable simulation of peptide bond transition dipole coupling.
- Use Case: Predicting secondary structure content and verifying fold stability.
⚡ Technical Architecture
- Backend: JAX (XLA-compiled).
- Parallelism: Native support for
vmap(vectorization across ensembles/trajectories) andpmap(multi-device execution). - Differentiability: Support for both Forward and Reverse-mode autodiff.
- Interoperability: Seamless integration with PyTorch/TensorFlow (via DLPack) and standard structural formats (mmCIF/BCIF).
🚀 Roadmap
Phase 1: Foundations (Alpha)
- Differentiable NeRF and Kabsch alignment.
- GPU-accelerated Debye formula for SAXS.
- Unit tests verifying parity with
synth-pdbNumPy implementations.
Phase 2: NMR & Spectroscopy (Beta)
- Differentiable RDC and Karplus kernels.
- Differentiable Johnson-Bovey ring current model.
- Integration with
synth-nmrparameter libraries.
Phase 3: Integration & Optimization (v1.0)
- Example notebooks for structure refinement via gradient descent.
- Plugin for
torch-based AI models to use biophysical loss functions. - Full support for BinaryCIF streaming.
📂 Repository Structure (Proposed)
diff-biophys/
├── diff_biophys/ # Core package
│ ├── geometry/ # NeRF, Kabsch, Torsions
│ ├── saxs/ # Debye kernels, form factors
│ ├── nmr/ # RDCs, Karplus, Ring Currents
│ ├── cd/ # CD simulation
│ └── utils/ # Constants, JAX-NumPy shims
├── tests/ # Parity and gradient checks
├── examples/ # Jupyter notebooks (Refinement Lab)
├── docs/ # API and Theory
├── pyproject.toml # Modern build config
└── README.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file diff_biophys-0.1.2.tar.gz.
File metadata
- Download URL: diff_biophys-0.1.2.tar.gz
- Upload date:
- Size: 21.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
821deab431dde3fd5ca4e43461c6bb826606cff322053288c238e42f06cbd3f3
|
|
| MD5 |
f65a49d6126891b1ab126454c96ae0c4
|
|
| BLAKE2b-256 |
c604360b0ef6d67037263fe1a8b61216c52722e6a8a43fa74bb7249707f5789e
|
Provenance
The following attestation bundles were made for diff_biophys-0.1.2.tar.gz:
Publisher:
publish.yml on elkins/diff-biophys
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diff_biophys-0.1.2.tar.gz -
Subject digest:
821deab431dde3fd5ca4e43461c6bb826606cff322053288c238e42f06cbd3f3 - Sigstore transparency entry: 1631770332
- Sigstore integration time:
-
Permalink:
elkins/diff-biophys@f0b3f936126dae797d27eb234edaf63e67f155e8 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/elkins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f0b3f936126dae797d27eb234edaf63e67f155e8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file diff_biophys-0.1.2-py3-none-any.whl.
File metadata
- Download URL: diff_biophys-0.1.2-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c72d5273717ff613eee5ec0cd4006393ca7b101387cad9a8ef1ba731110bb6c
|
|
| MD5 |
a3814b91eef23dea6d105d039539faba
|
|
| BLAKE2b-256 |
a80ae6a9856d68d67ce2770e704e7c5160ffad8ce1a859c26543ccc6f759a441
|
Provenance
The following attestation bundles were made for diff_biophys-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on elkins/diff-biophys
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
diff_biophys-0.1.2-py3-none-any.whl -
Subject digest:
8c72d5273717ff613eee5ec0cd4006393ca7b101387cad9a8ef1ba731110bb6c - Sigstore transparency entry: 1631770384
- Sigstore integration time:
-
Permalink:
elkins/diff-biophys@f0b3f936126dae797d27eb234edaf63e67f155e8 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/elkins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f0b3f936126dae797d27eb234edaf63e67f155e8 -
Trigger Event:
release
-
Statement type: