Skip to content

Releases: elkins-lab/diff-biophys

diff-biophys v0.2.1

Choose a tag to compare

@elkins elkins released this 30 Jun 17:10

Changed

  • Test Infrastructure: Enabled parallel testing via pytest-xdist, isolated slow interactive notebook tests with @pytest.mark.slow, and correctly configured the JAX compilation cache.
  • Linting & Typing: Fixed minor docstring formatting issues in diff_biophys/nmr/chemical_shifts.py for MkDocs strict builds, and resolved mypy typing errors for tests/ and examples/ directories.

v0.2.0: The Structural Refinement & Benchmarking Milestone

Choose a tag to compare

@elkins elkins released this 17 Jun 15:56

Added

  • Benchmarking Suite: Validated diff-biophys against experimental NMR data for proteins 2KZV and GmR58A (Li et al. 2023).
  • Refinement Factories: New high-level APIs make_rdc_refinement_fns and make_ca_shift_loss to simplify experimental data integration.
  • Robust Backbone I/O: Direct support for loading PDB models and extracting N–CA–C coordinates into JAX arrays via biotite.
  • Edge Case Test Suite: Comprehensive tests for numerical singularities (CD), collinearity (Kabsch), and empty input handling.

Fixed

  • RDC Overfitting: Implemented fixed-tensor refinement (periodically updated) to prevent trivial Q-factor minimization.
  • NH Bond Reconstruction: Improved peptide-plane bisector method for more accurate NH vector orientations from backbone coordinates.
  • Test Coverage: Achieved 100% coverage across all core biophysical modules.

v0.1.6 — Scientific test suite & notebook fix

Choose a tag to compare

@elkins elkins released this 14 Jun 02:39

What's changed

Fixed

  • Syntax error in Tutorial 3 (03_cd_spectroscopy.ipynb): a stray backslash continuation in the notebook generator fused the docstring of cd_at_222nm with its function body, causing a SyntaxError when the cell was executed in Colab. Fixed in both the notebook and the generator source.

Added

  • Regression tests for four scientific-review findings:
    • NeRF geometry (Issue 1): test_nerf_dihedral_roundtrip — parametrized over 13 angles, verifies position_atom_3d → compute_dihedrals roundtrip to < 0.01°. test_nerf_alpha_helix_is_right_handed — confirms φ=−57.8°/ψ=−47° builds a right-handed spiral.
    • Karplus offset (Issue 2): test_karplus_requires_phi_offset_not_raw_phi — quantifies the >1 Hz error that results from passing raw φ instead of θ = φ − 60° to calculate_karplus_j.
    • Chemical shift cap (Issue 3): test_ca_shift_max_helix_offset_is_half_of_offset_helix — pins the ~50% effective-weight cap intrinsic to the softmax coil prior.
    • SAXS excluded volume (Issue 4): test_saxs_excluded_volume_fraser.py — validates the Fraser (1978) 4π Gaussian denominator via q→0 limit, q→∞ limit, 1/e decay point, and Gaussian slope recovery.
  • Expanded calculate_karplus_j docstring with an explicit .. important:: block documenting the θ = φ − 60° offset requirement.
  • Inline NOTE comment in chemical_shifts.py explaining the 50% maximum helical weight and compensation strategies for SPARTA+ parity.

Removed

  • examples/interactive_tutorials/generate_notebooks.py removed from version control. The .ipynb files are the authoritative source; the generator was the root cause of the Tutorial 3 syntax error.

Refactored

  • __version__ in diff_biophys/__init__.py is now derived from importlib.metadata rather than a hardcoded string, so pyproject.toml is the single source of truth for the version number.

Full changelog: https://github.com/elkins-lab/diff-biophys/blob/main/CHANGELOG.md

v0.1.5 — Critical Fixes: Autodiff Test Suite & URL Migration

Choose a tag to compare

@elkins elkins released this 13 Jun 00:11

What's Changed

🔴 Critical Fixes

Repository URLs migrated to elkins-lab org

All references in README.md and pyproject.toml updated from github.com/elkins/ to github.com/elkins-lab/:

  • CI badge and codecov badge (were showing as broken/stale)
  • Both Colab notebook launch links (were returning 404)
  • Contributing link, Related Projects section, BibTeX citation URL

Missing autodiff test coverage — now added

The library's core promise is JAX auto-differentiability, but there were previously zero tests verifying that jax.grad works on any kernel. This release adds 68 new tests across 4 new files.

🆕 New Test Files

tests/conftest.py — Shared fixtures

Canonical biophysically-meaningful geometries (ideal α-helix, β-strand, Fibonacci N–H vectors, Gaussian density maps) shared across all test files.

tests/test_autodiff.py — 46 differentiability tests

Every kernel tested for: gradient exists, is finite (no NaN/Inf), is non-zero, has correct shape, and works inside jax.jit. Plus physics-correctness assertions:

  • SAXS Debye: grad + JIT + solvent subtraction + Hessian (jacfwd∘grad)
  • Karplus: dJ/dθ sign check at θ=5°
  • RDC: grad w.r.t. bond vectors and Saupe tensor; RDC = 0 at the magic angle (54.74°)
  • Chemical shifts: dδ/dφ, dδ/dψ; helix mean shift > sheet mean shift
  • Ring currents: shielding above ring (δ < 0), deshielding in-plane (δ > 0)
  • Rg: translation invariance, mass-weighted, single-atom edge case
  • NeRF: grad w.r.t. all four internal coordinates
  • Torsions, Kabsch RMSD, CD matrix method, FSC

tests/test_geometry_roundtrip.py — 11 round-trip tests

NeRF ↔ torsion round-trip is near-identity for helix, strand, and random geometries. Includes sign-convention and 2π-periodicity checks.

tests/test_e2e_gradient_descent.py — 10 integration tests

Real Adam gradient descent loops verifying the full pipeline works end-to-end: SAXS χ² refinement, NMR φ/ψ torsion refinement, Rg compaction/expansion, composite multi-observable joint loss.

🔧 Other

  • pyproject.toml: added optax>=0.1.0 to dev extras; mypy override for test files
    Full Changelog: v0.1.4...v0.1.5

Version 0.1.4

Choose a tag to compare

@elkins elkins released this 11 Jun 17:19

Added

  • Comprehensive property-based testing using hypothesis to verify Kabsch alignment and NeRF kinematics geometry.
  • New numerical stability checks testing edge cases (e.g. sinc limits in Debye scattering and overlaps in CD matrix method).
  • Added hypothesis to pyproject.toml dev optional-dependencies.
  • Added an Interdisciplinary "Concepts & Context" guide to documentation to clarify jargon for ML researchers and biologists.

Fixed

  • Fixed notebook integrity test relying on strict directory structure by recursively globbing for notebooks (rglob).
  • RDC Q-factor edge case when experimental data is strictly zero.

v0.1.2: PyPI Readiness

Choose a tag to compare

@elkins elkins released this 26 May 02:23

Release v0.1.2: Added MIT license and enhanced PyPI metadata.

v0.1.1 - PyPI Automated Launch

Choose a tag to compare

@elkins elkins released this 24 May 01:49

🚀 Release v0.1.1 - PyPI Automated Launch

This release triggers the automated publication to PyPI and includes fixes for package discovery.

Enhancements:

  • PyPI Readiness: Fixed pyproject.toml to correctly include all sub-packages (geometry, nmr, saxs, cd).
  • Automation: Added GitHub Actions workflow for automated PyPI publication via Trusted Publishing.

Core Features (carried from v0.1.0):

  • Differentiable Geometry: NeRF reconstruction, torsions, and Kabsch superposition.
  • Differentiable NMR: RDCs, Karplus J-couplings, Chemical Shifts (CA), and Ring Currents.
  • Differentiable SAXS: Debye formula with Hydration Shell correction.
  • Ensemble Support: Population-weighted averages in JAX.

v0.1.0 - Initial Differentiable Biophysics Release

Choose a tag to compare

@elkins elkins released this 24 May 01:41

🚀 Initial Release of DiffBiophys

DiffBiophys is a high-performance Python library for differentiable biophysical modeling in JAX.

Key Features:

  • Differentiable Geometry: Chain reconstruction via NeRF, backbone torsions, and Kabsch superposition.
  • Differentiable NMR:
    • RDC calculation and Saupe tensor fitting.
    • Karplus 3J-couplings.
    • Secondary structure-dependent Chemical Shifts (CA).
    • Johnson-Bovey Ring Current shifts.
  • Differentiable SAXS: Hardware-accelerated Debye formula with Hydration Shell (solvent subtraction) correction.
  • Ensemble Support: Native support for population-weighted averages across conformational ensembles.

Showcase:

Check out the examples/diff_biophys_showcase.ipynb for a complete demonstration of gradient-based structure refinement against multiple biophysical objectives.