Protein I/O for JAX with high-performance Rust backend
Project description
Proxide
Proxide is a high-performance library for Protein I/O and Physics bridging in JAX. It combines a flexible Python/JAX frontend with a highly optimized Rust backend (_proxider) to provide fast structure parsing, force field parameterization, and seamless integration with JAX MD.
NOTE: This is a research library in active development.
🚀 Features
- Hybrid Architecture:
- Rust Backend: 25x faster parsing (PDB/mmCIF), 50x faster topology generation, and robust force field parameterization.
- JAX Frontend: Differentiable physics, geometric deep learning utilities, and seamless GPU integration.
- Robust I/O: Load PDB, mmCIF, and PQR files with automatic error handling and corrections.
- Molecular Dynamics: Parse OpenMM XML force fields, assign GAFF parameters, and generate fully parameterized
AtomicSystemobjects for JAX MD. - Trajectory Support: High-performance parsing of XTC, DCD, and TRR trajectories.
📦 Installation
Proxide requires a Rust toolchain to build the backend extension.
Prerequisites
- Python: 3.11+
- Rust: 1.75+ (Install via rustup.rs)
- C++ Compiler: For compiling HDF5/chemfiles dependencies if needed.
From Source
# Clone the repository
git clone https://github.com/maraxen/proxide.git
cd proxide
# Install with uv (recommended) or pip
uv pip install .
# For development (includes test dependencies)
uv pip install -e ".[dev]"
The installation process will automatically compile the Rust _proxider extension using maturin.
Optional: Espaloma Charge (ML partial charges)
Inference uses the JAX/Equinox port expaloma (bundled weights; no PyTorch/DGL at runtime). The [espaloma] extra pulls expaloma from PyPI (and rdkit).
uv pip install -e ".[espaloma]"
For local development against an editable expaloma checkout, use a path override (e.g. uv.sources in your workspace) or:
uv pip install -e ../expaloma
uv pip install -e ".[dev]"
OpenFF toolkit wrapper (legacy upstream espaloma_charge): uv pip install -e ".[espaloma-openff]".
API: proxide.chem.partial_charges (assign_espaloma_charges_rdkit, etc.). Validation uses golden vectors under tests/data/espaloma_golden/; refresh those files when bumping expaloma.
pytest -m espaloma
🛠️ Usage
Loading a Structure
Use the high-level parse_structure function for fast, robust parsing:
from proxide import parse_structure
# Load a PDB file to a unified Protein object
protein = parse_structure("path/to/structure.pdb")
# Access data as JAX arrays
print(protein.coordinates.shape) # (N_residues, 37, 3)
Force Field Parameterization
Proxide can automatically assign force field parameters (charges, radii, etc.) via the Rust backend:
from proxide import parse_structure, OutputSpec
# Configure parsing options
spec = OutputSpec(
add_hydrogens=True, # Add missing geometric hydrogens
infer_bonds=True, # Infer connectivity if missing
parameterize_md=True, # Compute MD parameters
force_field="protein.ff14SB.xml" # Use standard AMBER force field
)
# Parse and parameterize in one step
protein = parse_structure("path/to/structure.pdb", spec)
# Access MD parameters
print(protein.charges) # Partial charges
print(protein.sigma) # Lennard-Jones sigma
Trajectory Parsing
from proxide import parse_xtc
# Fast Rust-based XTC parsing
traj_data = parse_xtc("path/to/trajectory.xtc")
coords = traj_data["coordinates"] # (N_frames, N_atoms, 3)
Fast Partial Charges (Espaloma)
Proxide provides access to high-performance Expaloma graph-neural-network inference for charge assignment using native Rust embedded weights:
# Assign charges with the fast Rust backend
proxide charges molecule.sdf --backend rust
⚡ Performance
The migration to a Rust backend has yielded significant performance improvements compared to the pure Python implementation:
| Operation | Speedup | Example Metric |
|---|---|---|
| PDB Parsing | 25x | - |
| mmCIF Parsing | 25x | - |
| Topology Generation | 50x | - |
| Force Field Loading | 10x | - |
| Espaloma Inference | 7.5x | 13.6ms (JAX) ➔ 1.8ms (Rust) |
🚀 Deployment & CI/CD
Proxide uses Maturin to seamlessly build Python wheels and publish them to PyPI. To publish proxide releases securely without secrets, we utilize PyPI Trusted Publishing (OIDC).
Do not configure a PYPI_API_TOKEN GitHub Secret. Instead, create a Trusted Publisher in the PyPI dashboard bound to this repository to allow .github/workflows/publish.yml to authenticate.
⚠️ Migration Notes
If you are migrating from older versions of Proxide:
- Biotite Removal: Direct dependency on
biotitefor parsing has been removed. All parsing is now handled by_proxider. - API Changes:
proxide.io.parsing.biotite->proxide.parse_structureproxide.physics.force_fields->proxide.load_forcefield
- JAX by Default: Most I/O functions now return JAX arrays by default. Use
use_jax=Falseif you specifically need NumPy arrays.
🔧 Development
Running Tests
# Run all tests
uv run pytest
# Run fast smoke tests
uv run pytest -m smoke
Building Wheels Locally
Before pushing a release to GitHub, test the wheel build locally to catch platform-specific issues early:
# Test the build locally (validates HDF5 static compilation and workflow config)
bash scripts/test-wheel-build.sh
# This will:
# 1. Check build prerequisites (cargo, rustc, python3)
# 2. Build the Rust extension with static HDF5 compilation
# 3. Verify the GitHub workflow is correctly configured
Note: The Rust extension uses static HDF5 compilation via the hdf5-metno crate with the static feature enabled. This means HDF5 is compiled from source during the build and included in the binary, eliminating platform-specific library dependencies.
Linting and Typing
# Linting
uv run ruff check src/proxide/ --fix
# Type Checking
uv run ty check
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 Distributions
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 proxide-0.1.0a4.tar.gz.
File metadata
- Download URL: proxide-0.1.0a4.tar.gz
- Upload date:
- Size: 7.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
731f23d7d5df54fd42deff117c9c48eb2eb5a8efb2b4112a11df6fbea76d8c01
|
|
| MD5 |
2ed8caa522a0d16e837733ff4bf4961b
|
|
| BLAKE2b-256 |
c63bedcc7aabda833c9a4592b6bc2453db8316bc7a1b8b45fa73a9fb6e219b07
|
Provenance
The following attestation bundles were made for proxide-0.1.0a4.tar.gz:
Publisher:
publish.yml on maraxen/proxide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proxide-0.1.0a4.tar.gz -
Subject digest:
731f23d7d5df54fd42deff117c9c48eb2eb5a8efb2b4112a11df6fbea76d8c01 - Sigstore transparency entry: 1452473225
- Sigstore integration time:
-
Permalink:
maraxen/proxide@0a443ba6ece19706d2f20394273a1ec371b6295a -
Branch / Tag:
refs/tags/v0.1.0-alpha.4 - Owner: https://github.com/maraxen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a443ba6ece19706d2f20394273a1ec371b6295a -
Trigger Event:
push
-
Statement type:
File details
Details for the file proxide-0.1.0a4-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: proxide-0.1.0a4-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 12.1 MB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
66fc97812490795ba27d985d039835a0b05534e677655ad5a2e282ac7fdd0b22
|
|
| MD5 |
df1709d7ae0d0725a565360bf96cabb6
|
|
| BLAKE2b-256 |
3721a8f7691f1bf52c155ebcf2fca04f1a4b376feeb6745b83f35c6ebd80793b
|
Provenance
The following attestation bundles were made for proxide-0.1.0a4-cp311-abi3-win_amd64.whl:
Publisher:
publish.yml on maraxen/proxide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proxide-0.1.0a4-cp311-abi3-win_amd64.whl -
Subject digest:
66fc97812490795ba27d985d039835a0b05534e677655ad5a2e282ac7fdd0b22 - Sigstore transparency entry: 1452473989
- Sigstore integration time:
-
Permalink:
maraxen/proxide@0a443ba6ece19706d2f20394273a1ec371b6295a -
Branch / Tag:
refs/tags/v0.1.0-alpha.4 - Owner: https://github.com/maraxen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a443ba6ece19706d2f20394273a1ec371b6295a -
Trigger Event:
push
-
Statement type:
File details
Details for the file proxide-0.1.0a4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: proxide-0.1.0a4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 11.2 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
176fb2c0214f828c298efd740a270a2399063407afde11fae9f62cc0f52bf977
|
|
| MD5 |
d0cdab96a50d1c48d49d1864275331ba
|
|
| BLAKE2b-256 |
c4c7fd72214ec0f0c91ad6f068d92421e2a84532f2e537256f2c1f282a816ba7
|
Provenance
The following attestation bundles were made for proxide-0.1.0a4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on maraxen/proxide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proxide-0.1.0a4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
176fb2c0214f828c298efd740a270a2399063407afde11fae9f62cc0f52bf977 - Sigstore transparency entry: 1452473550
- Sigstore integration time:
-
Permalink:
maraxen/proxide@0a443ba6ece19706d2f20394273a1ec371b6295a -
Branch / Tag:
refs/tags/v0.1.0-alpha.4 - Owner: https://github.com/maraxen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a443ba6ece19706d2f20394273a1ec371b6295a -
Trigger Event:
push
-
Statement type:
File details
Details for the file proxide-0.1.0a4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: proxide-0.1.0a4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 11.0 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa9d3c6d128fee50633208040a2f76a6070bdc4f4d923e2e5b1cbb270580b3a9
|
|
| MD5 |
2564146a1ee05891f8b9484943682647
|
|
| BLAKE2b-256 |
302152b12db4954d8aae06b7950a17378e27900212d2e9f393f7b5c8100dc3d5
|
Provenance
The following attestation bundles were made for proxide-0.1.0a4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yml on maraxen/proxide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proxide-0.1.0a4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
aa9d3c6d128fee50633208040a2f76a6070bdc4f4d923e2e5b1cbb270580b3a9 - Sigstore transparency entry: 1452474206
- Sigstore integration time:
-
Permalink:
maraxen/proxide@0a443ba6ece19706d2f20394273a1ec371b6295a -
Branch / Tag:
refs/tags/v0.1.0-alpha.4 - Owner: https://github.com/maraxen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a443ba6ece19706d2f20394273a1ec371b6295a -
Trigger Event:
push
-
Statement type:
File details
Details for the file proxide-0.1.0a4-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: proxide-0.1.0a4-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 10.5 MB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1df09d3564d21d0194bc829eb8337dac1cd3704d11d0c1a37d23b3719dec8ae
|
|
| MD5 |
6d14c448f43237cae82ef4b4740cb3ff
|
|
| BLAKE2b-256 |
e673a8431b577dab2b14a33dfd04634f200359267cca78b130b9fa396aa45a58
|
Provenance
The following attestation bundles were made for proxide-0.1.0a4-cp311-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on maraxen/proxide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proxide-0.1.0a4-cp311-abi3-macosx_11_0_arm64.whl -
Subject digest:
e1df09d3564d21d0194bc829eb8337dac1cd3704d11d0c1a37d23b3719dec8ae - Sigstore transparency entry: 1452473407
- Sigstore integration time:
-
Permalink:
maraxen/proxide@0a443ba6ece19706d2f20394273a1ec371b6295a -
Branch / Tag:
refs/tags/v0.1.0-alpha.4 - Owner: https://github.com/maraxen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a443ba6ece19706d2f20394273a1ec371b6295a -
Trigger Event:
push
-
Statement type:
File details
Details for the file proxide-0.1.0a4-cp311-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: proxide-0.1.0a4-cp311-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 10.8 MB
- Tags: CPython 3.11+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdd15e41108636c31581f04fb8f1ea621df3d4b5701045c1c5c7bcd1682a9add
|
|
| MD5 |
5b409b5ed0b85b2b3a665c49f1d0d14b
|
|
| BLAKE2b-256 |
5b81ed61a5297ce1e750b17c6927646a683f2b0dc24a411e4fae191162602d5c
|
Provenance
The following attestation bundles were made for proxide-0.1.0a4-cp311-abi3-macosx_10_12_x86_64.whl:
Publisher:
publish.yml on maraxen/proxide
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
proxide-0.1.0a4-cp311-abi3-macosx_10_12_x86_64.whl -
Subject digest:
bdd15e41108636c31581f04fb8f1ea621df3d4b5701045c1c5c7bcd1682a9add - Sigstore transparency entry: 1452473748
- Sigstore integration time:
-
Permalink:
maraxen/proxide@0a443ba6ece19706d2f20394273a1ec371b6295a -
Branch / Tag:
refs/tags/v0.1.0-alpha.4 - Owner: https://github.com/maraxen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0a443ba6ece19706d2f20394273a1ec371b6295a -
Trigger Event:
push
-
Statement type: