Skip to main content

Rustina

Linux x86-64 molecular docking in Rust, with a command-line interface and Python bindings.

Search Device
vina CPU, Vina Monte Carlo/BFGS
qvina2 CPU, QuickVina2 search
qvina2-race (default) CPU, staged QuickVina2 runs
gpu GPU, batched Monte Carlo search through wgpu

Every search mode supports vina, vinardo, and ad4 scoring. Fast CNN rescoring is enabled by default; use --skip-cnn or skip_cnn=True for empirical scoring alone. GPU search requires a compatible compute adapter and reports an error when none is available.

Build

cargo build --release --locked
python -m pip install maturin
maturin build --release --locked --out target/wheels
python -m pip install target/wheels/*.whl

The Python package supports Python 3.9+. Docking and scoring need no Python dependencies. Optional SMILES/SDF preparation uses pip install 'rustina[prep]'.

Command line

Inputs are receptor and ligand PDBQT files. Prepare the receptor with polar hydrogens and partial charges; AD4 uses explicit polar hydrogens and charges for scoring.

target/release/rustina dock -r data/receptor.pdbqt -l data/ligand.pdbqt \
  --cx 0 --cy -5 --cz 0 --sx 12 --sy 16 --sz 12 \
  --search-mode qvina2-race --scoring vina --runs 32 --seed 42 \
  -o target/docked.pdbqt

target/release/rustina score -r data/receptor.pdbqt -l data/ligand.pdbqt \
  --scoring ad4 --cnn

Use --search-mode gpu for GPU search. --batch DIRECTORY docks a directory of ligands against one receptor. dock --help and score --help list the available options.

CPU search budgets are fixed by the selected mode; --steps and --bfgs-iter overrides apply to GPU search. qvina2-race requires at least 16 runs. A supplied seed makes CPU output reproducible across thread counts. GPU reproducibility also depends on the adapter and driver.

pose_pool_size caps the returned search pool in every mode; QuickVina keeps its internal 20-minimum search history. direct_refine_candidates limits direct receptor refinement on both CPU and GPU, with zero disabling it. GPU bfgs_iter sets both search and polish iteration limits; diagnostics report the actual depth and local iteration limits.

PDBQT coordinates and charges must be finite numbers, atom serials must be unique, and branch endpoints must define valid torsion axes. Multi-model input selects its first model for both parsing and redocking. Grid interpolation includes the upper faces and uses the derivative of the clamped value outside the box. AD4 maps retain distinct atom parameters; macrocycle glue pseudo-atoms contribute only to closure restraints, without affecting covalent typing or CNN densities and centers. These correctness fixes can change poses and scores relative to earlier builds.

Receptor waters can be retained (--waters fixed, default) or removed (--waters strip). Hydrated ligands containing pseudo-water W atoms are rejected.

Python

import rustina

poses = rustina.dock(
    "data/receptor.pdbqt", "data/ligand.pdbqt",
    cx=0, cy=-5, cz=0, sx=12, sy=16, sz=12,
    search_mode="qvina2-race", scoring="vinardo", runs=32, seed=42,
)
print(poses[0]["affinity"], poses[0]["cnn_score"])

scores = rustina.score("data/receptor.pdbqt", "data/ligand.pdbqt", scoring="ad4")
cnn = rustina.score_cnn("data/receptor.pdbqt", "data/ligand.pdbqt")

screen(receptor, ligands, cx, cy, cz, sx, sy, sz, ...) shares receptor grids across a batch and returns one result per ligand, in input order. Individual failures contain an error string. prepare_ligand("CCO") returns prepared PDBQT states when preparation extras are installed. Paths and PDBQT text are accepted by the docking and scoring APIs.

The bundled fast CNN is described in docs/models.md. License and model attribution are in THIRD_PARTY_NOTICES.md.

Extending the core

screening.rs shares receptor preparation, docking, refinement, and pose ranking between the CLI and Python bindings. Search implementations live in optimize.rs, qvina.rs, and gpu/; empirical potentials live in scoring.rs and ad4.rs; cnn.rs handles fast CNN inference. Keeping new methods behind these shared boundaries makes them available to both interfaces. The retained tests check gradients, seeded results, atom typing, and CPU/GPU agreement.

AGENTS.md describes working in the repository. Agents have room to explore new methods, theories, and equations; docs/validation.md gives a starting protocol for assessing and reproducing their results.

Checks and navigation

cargo fmt --all --check
cargo clippy --all-targets --locked -- -D warnings
cargo test --all-targets --locked

Install the release wheel, then run python -m unittest discover -s /absolute/path/to/rustina/python/tests -v from outside the checkout. GPU tests exercise the available adapter; an absent adapter prints a skip message but is counted as passing by the Rust harness. Hardware validation requires checking that the tests actually ran on a real GPU.

Tagged releases publish one Linux x86-64 Python wheel and a CLI archive. Both are built in manylinux 2.28 and tested as installed/unpacked packages before publishing; source is available through the Git tag.

Graphify is optional navigation tooling. scripts/setup_graphify.sh installs it under target/graphify; scripts/graphify update . --force rebuilds the code graph under scratch/graphify/graphify-out. scripts/graphify query "GPU search and scoring" --budget 1500 explores it. Generated graphs and build products are ignored by Git.

Metadata

Release files for rustina 0.7.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for rustina 0.7.2
File Interpreter ABI Platform
rustina-0.7.2-cp39-abi3-manylinux_2_28_x86_64.whl CPython 3.9 abi3 Linux glibc 2.28+ x86-64 Details

Release files / rustina-0.7.2-cp39-abi3-manylinux_2_28_x86_64.whl

Download URL rustina-0.7.2-cp39-abi3-manylinux_2_28_x86_64.whl
Size 3.4 MB
Tags CPython 3.9 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
ad84711637bcc28ed1d72cab2f27c58901b8893001104058e38e57ff3d1cbcd5
BLAKE2b-256 checksum
How to use checksums
49bee893ef372cb870a0d8b77372bfb73a91e2d208aaa1cb1bf6bc08ca595639
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

Security for rustina 0.7.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 1 file in this release has been uploaded with provenance metadata.

Attestation for rustina-0.7.2-cp39-abi3-manylinux_2_28_x86_64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page