Skip to main content

ChiralFold

Chirality-correct protein stereochemistry toolkit — audit any PDB, fix AF3 chirality errors, build D-peptides by construction, and generate exact L↔D mirrors.

Tests Hugging Face Space Reproduce D-residue errors (5 min) Quick Demo


Start here

Goal Link
Use in a browser (upload PDB → correct / mirror → download) Hugging Face Space
Reproduce D-residue survey errors (<5 min) Colab notebook · or python benchmarks/reproduce_d_residue_errors.py
Interactive results dashboard Colab dashboard ⚠️ auto-installs (~1–2 min)
Demo: unusual cases + clash-safety Colab notebook

Install

Works on Linux, macOS, and Windows (Python 3.9–3.12).

# Recommended — always current (PyPI package pending Trusted Publisher setup)
pip install -U pip
pip install "chiralfold @ git+https://github.com/Tommaso-R-Marena/ChiralFold.git@v3.5.1"

# Or clone + editable
git clone https://github.com/Tommaso-R-Marena/ChiralFold.git
cd ChiralFold
pip install -e .

Note: Bare pip install chiralfold requires PyPI publishing to succeed. See docs/PYPI_PUBLISHING.md for Trusted Publisher setup (or set secret PYPI_API_TOKEN). Until then, use the Git install above — same package.

Core dependencies: numpy, scipy, pandas, rdkit.
Optional: pip install "chiralfold[web]" (Gradio UI) · pip install "chiralfold[viz]" (matplotlib/seaborn for benchmarks).

If rdkit fails on your platform:

conda install -c conda-forge rdkit
pip install "chiralfold @ git+https://github.com/Tommaso-R-Marena/ChiralFold.git"

Full platform notes: docs/INSTALL.md.

# Verify
python -c "import chiralfold; print(chiralfold.__version__)"
chiralfold --help

Reviewer path (<5 minutes, offline)

Reproduce the 29 D-label / L-coordinate mismatches from the frozen survey CSV — no network, no ChiralFold install required beyond numpy:

git clone --depth 1 https://github.com/Tommaso-R-Marena/ChiralFold.git
cd ChiralFold
pip install numpy   # only dependency for this script
python benchmarks/reproduce_d_residue_errors.py

Expected output: 12,573 checkable residues · 29 errors · 16 structures · rate 0.23%.

Or open the Reproduce D-residue errors Colab.


What ChiralFold does

from chiralfold import audit_pdb, correct_af3_output, mirror_pdb, ChiralFold

report = audit_pdb("protein.pdb")          # chirality, Rama, clashes, score
correct_af3_output("af3.pdb", "fixed.pdb") # fix inverted stereocenters
mirror_pdb("1YCR.pdb", "1YCR_D.pdb")       # exact L↔D (RMSD 0.0 Å)
pred = ChiralFold().predict("AFWKELDR")     # D-peptide, 0% violations by construction

Web UI (local):

pip install "chiralfold[web]"
chiralfold-web   # http://localhost:7860

Key results (at a glance)

Result Number Where
PDB-wide D-residue survey 12,573 residues · 29 errors in 16 structures (0.23%) results/d_residue_verification_summary.json
Experimental validation 14/14 non-borderline pass (2 borderline) results/experimental_validation_report.json
Ramachandran vs wwPDB (paper) n=362 · Spearman ρ=0.52 · Pearson r=0.853 results/ramachandran_279struct_chainfix_summary.json
AF3 synthetic correction 100% detection · 0% residual · ~37 ms results/af3_resource_benchmark.json
Mirror clashscore Unchanged (isometry — distances preserved) tests/test_clash_preservation.py
Lean 4 chirality no-go Distance-only reps cannot recover signed orientation formal/chirality_nogo/

MolProbity does not flag the D-residue annotation errors (L-only Cα check).


Unusual cases

ChiralFold is tested on structures that break naive assumptions:

Case Example What happens
Strained / cyclic macrocycle 1XT7 daptomycin · 2RMI astressin Signed volume still classifies Cα; Stereochem errors detected
Non-standard ligands (CCD) 1OF6 (8× DTY←L-Tyr) · 1BG0 DAR←L-Arg Coordinates match L; CCD InChI confirms mislabel
Ultra-high resolution 1HHZ (0.99 Å) DAL error Not a density/resolution artifact
Low-res / non-protein Rama 5M2K vancomycin glycopeptide Excluded from protein Rama benchmark by pre-specified rule

See demos/Demo_Unusual_Cases_Clash_Safety.ipynb and results/5m2k_benchmark_exclusion.json.

“By construction” does not invent clashes

  • Mirror L↔D is a global isometry: all pairwise distances are preserved → clashscore is identical before and after (tests/test_clash_preservation.py).
  • AF3 chirality correction reflects only the violating Cα across the N–C–Cβ plane, preserving CA–N / CA–C / CA–Cβ bond lengths. Clashscore may change slightly when a bad stereocenter is fixed; residual chirality violations go to 0%.

Repository map

chiralfold/          # Installable Python package
web/                 # Gradio UI (chiralfold-web)
hf_space/            # Hugging Face Space source
demos/               # Colab notebooks (start with Reproduce_PDB_D_Residue_Errors_5min)
benchmarks/          # Reproducible survey / validation / Rama scripts
results/             # Frozen CSV/JSON artefacts (do not hand-edit)
tests/               # pytest suite
paper/submission/    # Bioinformatics Overleaf package
docs/                # Install notes, navigation

Citation

@software{chiralfold2026,
  author = {Marena, Tommaso R.},
  title  = {ChiralFold: Chirality-correct protein stereochemistry toolkit},
  year   = {2026},
  url    = {https://github.com/Tommaso-R-Marena/ChiralFold}
}

AF3 D-peptide context: Childs, Zhou & Donald (2025) bioRxiv 10.1101/2025.03.14.643307.


License

MIT — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chiralfold-3.5.1.tar.gz (117.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chiralfold-3.5.1-py3-none-any.whl (98.5 kB view details)

Uploaded Python 3

File details

Details for the file chiralfold-3.5.1.tar.gz.

File metadata

  • Download URL: chiralfold-3.5.1.tar.gz
  • Upload date:
  • Size: 117.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for chiralfold-3.5.1.tar.gz
Algorithm Hash digest
SHA256 20a2790b9222619c031ee16ffad356932edf9c7918861416f1fba89371c3897b
MD5 884c05e8c3447c6ea8d94bd5ed4a1c6c
BLAKE2b-256 f39a5abb93d06595f8aedebbe13279541c93d8083ba96132e5d3e4bc3dddb2b4

See more details on using hashes here.

File details

Details for the file chiralfold-3.5.1-py3-none-any.whl.

File metadata

  • Download URL: chiralfold-3.5.1-py3-none-any.whl
  • Upload date:
  • Size: 98.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for chiralfold-3.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 074cc914bdec482ae81380b64da95acbf37ef0a230f287e195d631a9a7814ed6
MD5 8a2cd5b7944870032a3286913d0da5c0
BLAKE2b-256 6e33e9b8117cec7c2027383cf849b8fd1bf84d190a3780272540c5786284e0c7

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

3.5.1 This release

2 files

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