small_molecule_binding: replace AF2 with Boltz-2 co-folding, port to Delta - #62
Open
drawadiagram wants to merge 1 commit into
Open
small_molecule_binding: replace AF2 with Boltz-2 co-folding, port to Delta#62drawadiagram wants to merge 1 commit into
drawadiagram wants to merge 1 commit into
Conversation
…Delta
Small-molecule workflow changes extracted from the impress_fixes branch,
up to the point where the guided-RFD3 fix series begins. Depends on the
ImpressManager/find_gpus changes in the core commit.
Fold prediction: AlphaFold2 is replaced by Boltz-2. The STEP_AF2 constant
keeps its name for compatibility, but the step now co-folds the protein
together with the ligand (supplied as SMILES) and reports ligand_iptm, a
protein-ligand interface confidence AF2 could not provide since it never
folded the ligand at all. The new fold_min_ligand_iptm gate defaults to
None in PROD so the switch does not silently tighten production
thresholds. scripts/af2.sh is replaced by scripts/boltz.sh, which holds
the CCD cache lock across a completeness check so concurrent tasks cannot
read a half-extracted mols/ directory.
Ligand SMILES: a Rosetta .params file contains no SMILES, so
scripts/derive_ligand_smiles.py derives one offline via RDKit bond-order
perception from the params connectivity plus a reference structure's 3D
coordinates. Its output is committed as p{1..8}_in/ALR.smiles.
RFD3: drop the scaffoldguided.* CLI argument. RFD3 has no such namespace
(unlike older RFDiffusion versions) and guidance is expressed entirely
inside the InputSpecification JSON, so the argument was silently inert.
Also set PYTHONNOUSERSITE and clear PYTHONPATH/PYTHONUSERBASE so the
host's ~/.local cannot shadow packages inside the container.
Configuration: the loose module-level threshold constants become a
RunConfig dataclass with PROD and TEST instances, selected by
IMPRESS_TEST_MODE, and the backend is chosen by IMPRESS_BACKEND
(dragon|local). GPUs are assigned round-robin from find_gpus().
Retry logic: _stage_metrics_improving() gives the fastrelax and interface
stages a metric-agnostic "is this retry actually helping" check, so an
attempt whose every still-failing metric stayed flat or regressed
short-circuits instead of burning the task budget.
Portability and hygiene: every scripts/*.sh re-activates $VIRTUAL_ENV
instead of sourcing a hardcoded /anvil path; mpnn_run.py restores the
numpy aliases NumPy 1.24 removed but LigandMPNN's bundled openfold still
uses; filter_shape.py moves to argparse; packmin.py and fastrelax.py use
pyrosetta.rosetta.* imports and mute Rosetta's tracer output.
Note for review: filter_shape.py also changes the RosettaScripts
ScoreTermValueBased score_fxn from "sfxn" to "sfxn_clean". That is a
scoring change, not part of the argparse refactor.
Adds delta_env_setup.sh, delta_gpu_run.sh, pull_foundry.sh, and
scripts/validate_run.py (post-run output-tree validator).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lo8DwSbyvdWZRkkkka6gA2
This was referenced Sep 11, 2026
Closed
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.
Splits the small-molecule workflow out of #59. Third of four.
Based on #60 (needs
find_gpusandIMPRESS_SESSION_DIR); GitHub retargets this tomainwhen #60 merges. #63 stacks on this one — the guided-RFD3 fix series is split out separately so this PR stays reviewable.The cut point is the merge commit where the Boltz-2 migration and the Delta portability work met, before the guided-RFD3 fixes began. Everything here is that first half.
Fold prediction: AlphaFold2 → Boltz-2 co-folding
STEP_AF2keeps its name for compatibility, but the step now co-folds the protein together with the ligand (supplied as SMILES) and reportsligand_iptm— a protein-ligand interface confidence AF2 could never provide, since it never folded the ligand at all. AF2 here ran in single-sequence mode with zero ligand awareness, so this is a real capability upgrade rather than a swap.The new
fold_min_ligand_iptmgate defaults toNoneinPRODso the switch doesn't silently tighten production thresholds.scripts/af2.sh→scripts/boltz.sh, which holds the CCD cache lock across a completeness check so concurrent tasks can't read a half-extractedmols/(the same race later ported to the protein workflow in #61).Ligand SMILES
A Rosetta
.paramsfile contains no SMILES, soscripts/derive_ligand_smiles.pyderives one offline via RDKit bond-order perception from the params connectivity plus a reference structure's 3D coordinates. Output committed asp{1..8}_in/ALR.smiles.RFD3
Drops the
scaffoldguided.*CLI argument: RFD3 has no such namespace (unlike older RFDiffusion versions) and guidance lives entirely inside the InputSpecification JSON, so the argument was silently inert. Also setsPYTHONNOUSERSITEand clearsPYTHONPATH/PYTHONUSERBASEso the host's~/.localcan't shadow packages inside the container.filter_shape.pychanges the RosettaScriptsScoreTermValueBasedscore_fxnfromsfxntosfxn_clean. That is a scoring change sitting inside what otherwise reads as asys.argv→argparserefactor. Calling it out so it doesn't slip through as cleanup.Configuration and retries
The loose module-level threshold constants become a
RunConfigdataclass withPRODandTESTinstances selected byIMPRESS_TEST_MODE; backend chosen byIMPRESS_BACKEND(dragon|local); GPUs assigned round-robin fromfind_gpus()._stage_metrics_improving()gives the fastrelax and interface stages a metric-agnostic "is this retry actually helping" check, so an attempt whose every still-failing metric stayed flat or regressed short-circuits instead of burning the task budget.Portability and hygiene
Every
scripts/*.shre-activates$VIRTUAL_ENVinstead of a hardcoded/anvilpath;mpnn_run.pyrestores the numpy aliases NumPy 1.24 removed but LigandMPNN's bundled openfold still uses;packmin.py/fastrelax.pyusepyrosetta.rosetta.*imports and mute Rosetta's tracer.Adds
delta_env_setup.sh,delta_gpu_run.sh,pull_foundry.sh, andscripts/validate_run.py(post-run output-tree validator).@AymenFJA — the
--mail-useraddress you flagged on the protein-binding script was still present in this workflow'sdelta_gpu_run.sh; it's a<your e-mail>placeholder here now. One more remains inexamples/discontinuous_scaffolds/rfd3_benchmark/run_islands.slurm:10, pre-existing onmainand untouched by any of these four PRs — worth a separate cleanup.Replaces part of #59.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Lo8DwSbyvdWZRkkkka6gA2