Skip to content

Package ABCFold as a cofolding backend: pinned engines, MSA subsystem, batch mode - #9

Open
SergeiNikolenko wants to merge 1 commit into
mainfrom
cleanup-upgrade
Open

SergeiNikolenko wants to merge 1 commit into
mainfrom
cleanup-upgrade

Conversation

@SergeiNikolenko

Copy link
Copy Markdown
Member

ABCFold could not serve as a platform backend: per-run env creation pulled incompatible torch versions, several engines silently lost the MSA or failed on ions, --gpus 0 escaped the caller's GPU allocation, and results had no structured schema. This PR turns it into a package with pinned backends and a JSON report that the platform can consume.

What changes:

  • src/ layout, pyproject.toml only. Backend versions are pinned in a read-only backends.toml (Boltz-2 2.2.1, Chai-1 0.6.1, Protenix 2.0.0 with the public v1.0.0 checkpoint, OpenFold3 0.5.0, RF3) and installed into new abcfold2-* envs, so existing abcfold-* envs are left alone.
  • Settings come from data/defaults.toml plus CLI/env overrides; config.ini is no longer written.
  • CLI subcommands abcfold run | msa | batch | envs; every run writes report.json (cofolding-report-v2: engines, samples, scores, MSA stats).
  • MSA subsystem: ColabFold server client with a sha256 cache, custom A3M per chain (rejects empty files and mismatched queries), reuse of an AF3 *_data.json, per-engine export, and a guard that fails a run when an engine receives fewer MSA rows than requested.
  • AlphaFold 3 adapter (docker or apptainer) and a batch runner.
  • --gpus indices are mapped through the inherited CUDA_VISIBLE_DEVICES; docker gets physical ids.
  • Fixes for the defects found on the KRAS G12D fixture: argparse None defaults, Protenix ion entities / temporary MSA dir / duplicate rdkit / missing CUDA_HOME, PAE files rewritten in place, OpenFold3 fetching templates at run time, Chai weights re-downloaded per env, missing pyarrow for Chai MSAs.

Validation:

  • pytest: 198 passed, 4 skipped (including the network MSA tests).
  • GPU smoke test on Gauss (one RTX PRO 6000, CUDA_VISIBLE_DEVICES=2 abcfold run ... --gpus 0 -b -c -p -o --msa custom), KRAS G12D + GDP + Mg + MRTX1133 against 7RPZ; all engines ran on the allocated GPU and saw the full MSA:
Engine Wall time Score Cα RMSD Ligand RMSD
Boltz-2 131 s 0.984 0.45 Å 1.43 Å
Chai-1 66 s 0.957 1.13 Å 16.5 Å
Protenix 264 s 0.966 0.93 Å 17.4 Å
OpenFold3 34 s 0.982 0.46 Å 0.53 Å

Chai-1 and Protenix put the ligand in the wrong pocket with high confidence; this matches earlier runs and is model behaviour.

Not covered: AlphaFold 3 runs only where its weights and databases live (Lobachevsky); the adapter is unit-tested here. protenix-v2 weights are not publicly downloadable (403), so the pin uses protenix_base_default_v1.0.0.

…and batch mode

- src/ layout, pyproject only; read-only backends.toml pins (Boltz 2.2.1,
  Chai-1 0.6.1, Protenix 2.0.0, OpenFold3 0.5.0, RF3) in new abcfold2-* envs
- settings from data/defaults.toml + CLI/env, no writable config.ini
- `abcfold run|msa|batch|envs` CLI; cofolding report v2 JSON
- MSA subsystem: ColabFold server client with sha256 cache, custom A3M,
  AF3 data JSON reuse, per-engine export, guard that fails on lost MSAs
- AF3 adapter (docker/apptainer) and batch runner
- GPU selection maps --gpus through the inherited CUDA_VISIBLE_DEVICES
- fixes for the defects found on the KRAS G12D fixture (argparse None,
  Protenix ions/MSA dir/rdkit/CUDA_HOME, PAE files, OpenFold3 template
  fetch, empty custom A3M, Chai weights cache and pyarrow)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant