Skip to content

[codex] Add AF3 layout and Boltz-2 parser support#12

Merged
DimaMolod merged 4 commits into
mainfrom
codex/af3-boltz-parsers
May 20, 2026
Merged

[codex] Add AF3 layout and Boltz-2 parser support#12
DimaMolod merged 4 commits into
mainfrom
codex/af3-boltz-parsers

Conversation

@DimaMolod
Copy link
Copy Markdown
Collaborator

Summary

This PR fixes the two parser compatibility gaps reported in issues #3 and #11:

  • adds direct Boltz-2 prediction-directory support (<input>_model_<rank>.cif, confidence_<input>_model_<rank>.json, optional PAE/pLDDT NPZ files)
  • teaches the AF3 parser to detect both AlphaPulldown/normalized AF3 output and current vanilla DeepMind AlphaFold3 output with <job>_ranking_scores.csv and prefixed per-sample files
  • adds a real Boltz-2 fixture from the best readable 6OGE_ABC_DSSO_CDI seed/model plus focused regression tests
  • bumps the package version to 1.0.2

Closes #3.
Fixes #11.

Notes

Vanilla AlphaFold3 writes one sanitized job directory under the selected --output_dir. Users passing the parent output directory should still run AlphaJudge with --recursive, or pass the job directory directly.

Boltz-2 protein-ligand outputs can include trailing small-molecule tokens in PAE/pLDDT arrays. AlphaJudge now trims larger Boltz-2 arrays to the protein/nucleic residue block it scores.

Validation

PYTHONPATH=src python -m py_compile \
  src/alphajudge/parsers/af3.py \
  src/alphajudge/parsers/boltz.py \
  src/alphajudge/parsers/__init__.py \
  test/test_parsers_and_runner.py

OPENBLAS_NUM_THREADS=1 OMP_NUM_THREADS=1 MKL_NUM_THREADS=1 NUMEXPR_NUM_THREADS=1 \
PYTHONPATH=src conda run -n alphajudge pytest \
  test/test_parsers_and_runner.py::test_af3_parser_accepts_official_prefixed_layout \
  test/test_parsers_and_runner.py::test_boltz2_parser_processes_ranked_prediction_dir \
  --tb=short -q

Result: 2 passed in 12.54s.

Additional parser smoke checks:

  • AlphaPulldown-style AF3 fixture: af3 5 seed-19698302_sample-1
  • Real Boltz-2 fixture: boltz2 6OGE_ABC_DSSO_CDI_Boltz2_model_0 (1058, 1058) 1058 0.8897088170051575

@DimaMolod DimaMolod marked this pull request as ready for review May 20, 2026 09:26
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 00959778bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/alphajudge/parsers/af3.py Outdated
Comment on lines +220 to +223
logger.warning(
"No recognised PAE keys in confidences.json/summary_confidences.json; "
"using default PAE=100 for all residue pairs."
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Raise on unknown AF3 confidence schema

Falling back to an all-100 PAE matrix here silently turns missing/invalid AF3 confidence files into apparently valid results, which can produce misleading interface metrics instead of failing fast. This is triggered whenever confidences.json/summary_confidences.json is absent or in an unsupported format (for example, a layout mismatch where _read_json returns {}), and the run is then scored with fabricated PAE values rather than being skipped with an error as before.

Useful? React with 👍 / 👎.

@DimaMolod DimaMolod merged commit 2afa169 into main May 20, 2026
8 checks passed
@DimaMolod DimaMolod deleted the codex/af3-boltz-parsers branch May 20, 2026 11:09
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.

AlphaJudge is not working with AF3 run Boltz-2 support?

1 participant