Repository navigation
Integration of RGI-toolkit - #858
Merged
Merged
Conversation
Two changes, both already on sokrypton/alphafold3@main. The model table says DeepMind's parameters are granted on request, for non-commercial research, at Google's discretion -- and the install cell was wgetting them from a public bucket and printing "public, no login required". The URL does serve 1,020 MB, but reachable is not the same as ours to hand out. The `alphafold3` entry now looks for a .bin.zst you placed in af3_native_weights/ yourself and, if there is none, says where to request them. Every other model still fetches its own weights. And most of the comments in the three code cells were a log of last night's debugging -- why %%time was removed, what a HuggingFace 429 looked like, which wheel used to be installed. That belongs in the history, not in front of someone trying to fold a protein. No behaviour change; what is left explains a decision a reader cannot infer. Verified on a cold Colab T4 before pushing: setup 34 s, fold 68 s, ATP ligand present (31 HETATM), zero rasa warnings. Also green on A100 (Triton path) and L4 (XLA fallback).
Still too much explaining of history rather than of code: what %%time did, what a 429 looked like, what `Done ->` used to print, the exact RMSDs a language model is worth. What is left says what a line does or why it could not be simpler. No behaviour change; the AlphaFold 3 message still names the request page and the directory to put the file in.
The table row said they are granted on request and the install cell had been changed to match; the bucket is DeepMind's intended public release, so the row is what needed fixing. A copy already in af3_native_weights/ is now used as-is rather than deleted before downloading. Verified on a cold Colab T4: 1 GB in 15 s, fold in 62 s.
The int8 weights were republished with per-block scales (and with the parameters several blobs were missing -- boltz2 and opendde would not load at all). 3.1.10's loader raises on the new scale records, so the pin has to move with them.
Add beginner distance and ligand forms, custom configurations, and per-seed geometry reports while preserving vanilla execution. Reuse the shared AF3 adapter in the pinned ColabFold JAX runtime and the native Boltz-1 fork. Validate all supported models on Slurm GPUs, complete guided and vanilla Colab notebook runs, and add reproducible sampler and batch-isolation checks.
Replace preset-specific controls with the shared RGI-toolkit editor for distance, conformer, angle, custom and RMSD. Read the current form when prediction starts and preserve the existing optional vanilla path. Pin the toolkit revision, update E2E fixtures to native configuration, and keep detailed form documentation with the toolkit.
Number the setup and prediction cells, link directly to Configure RGI, and show a complete distance example before execution. Explain that the editable form appears below its cell after pressing play. Replace outdated Run all and preset instructions and report skipped configuration steps before starting prediction. Pin the toolkit's guided editor and exercise these notebook cells in regression tests.
Keep the original headings and Run all workflow. Put the RGI switch and editable fields in one native Colab form, with toolkit parsing for repeated and mixed restraints. Remove widget-only interaction and its dependency.
Route SM 12 devices away from Triton in notebook commands and the installed Tokamax and predictor capability gates. Share the compatibility patch with the E2E runner and cover fresh installs, previously patched installs, and reruns. Enable verbose restraint inventory output in the native Boltz E2E fixture.
Track RGI-generated features so enabling RGI, editing restraints, and returning to vanilla cannot reuse incompatible preprocessing. Preserve vanilla-only cache reuse and add regression coverage.
There was a problem hiding this comment.
🟡 Changes recommended
The download cell breaks configured output paths, and citation deduplication does not handle alternate BibTeX entry types.
3 open findings
What changed in this PR
Integrates optional RGI-guided restraints into ColabFold’s AF3-family and Boltz workflows while preserving vanilla prediction paths.
Changes:
- Adds RGI sampler/runtime adapters, reporting, and citations.
- Adds notebook forms and guided/vanilla execution paths.
- Adds unit, notebook, citation, and end-to-end coverage.
| File | Description |
|---|---|
colabfold/rgi/__init__.py |
Defines supported models and version pin. |
colabfold/rgi/__main__.py |
Wraps the upstream prediction CLI. |
colabfold/rgi/sampler.py |
Instruments diffusion sampling with restraint hooks. |
colabfold/rgi/runtime.py |
Integrates RGI into parsing, inference, and reporting. |
colabfold/rgi/notebook.py |
Prepares notebook inputs and job names. |
colabfold/rgi/boltz.py |
Builds RGI-capable Boltz YAML inputs. |
colabfold/citations.py |
Adds RGI bibliography generation. |
ColabFold2_preview.ipynb |
Adds RGI controls and guided execution. |
AlphaFold3_of3.ipynb |
Adds model selection and RGI workflow. |
Boltz1.ipynb |
Adds isolated vanilla/RGI Boltz environments. |
docs/rgi.md |
Documents notebook usage. |
scripts/rgi_e2e.py |
Validates paired real predictions. |
scripts/rgi_boltz1_e2e.py |
Validates native Boltz-1 integration. |
scripts/rgi_batch_e2e.py |
Validates multi-job state isolation. |
tests/test_rgi_sampler.py |
Tests sampler instrumentation. |
tests/test_rgi_notebook.py |
Tests notebook input behavior. |
tests/test_notebook_vanilla.py |
Tests vanilla-path isolation. |
tests/test_citations.py |
Tests citation and archive handling. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
YoshitakaMo
force-pushed
the
rgi-integration
branch
2 times, most recently
from
October 9, 2026 16:02
84177be to
233d6ac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Current AF3-based structure prediction methods suffer from a critical limitation: the predicted stereochemistry of ligand molecules does not always match the enantiomers or diastereomers specified by the user. To address this issue, we developed the RGI-toolkit and implemented an interface that makes it accessible through ColabFold. The method and its benchmark results are currently available as a preprint on bioRxiv: https://www.biorxiv.org/content/10.64898/2026.10.05.756905v1 .
In addition to correcting ligand stereochemistry, this method allows users to apply flexible and extensible physical restraints to molecules. This enables users to specify and enforce desired distances between arbitrary atoms, including those belonging to different molecules, in AF3-predicted structures.