Skip to content

Add explicit --model selection and robust ESMfold2 .cif + .json support - #2

Merged
colbyford merged 13 commits into
mainfrom
copilot/add-ipsae-scoring-for-esmfold2
Sep 12, 2026
Merged

Add explicit --model selection and robust ESMfold2 .cif + .json support#2
colbyford merged 13 commits into
mainfrom
copilot/add-ipsae-scoring-for-esmfold2

Conversation

Copilot AI commented Sep 12, 2026

Copy link
Copy Markdown

ESMfold2 confidence JSON differs from AF3, which made .cif + .json inputs ambiguous and brittle under auto-detection. This PR adds explicit model-source selection and aligns parsing/detection so ESMfold2 keyed/raw PAE formats are handled predictably.

  • Explicit model-source control

    • Added CLI flag: --model <af2|af3|boltz2|esmfold2>.
    • Propagated explicit model choice into score_interactions(..., model_type=...).
    • Added boltz2 -> boltz normalization.
    • When --model is provided, model-source auto-detection is bypassed (file-format detection remains extension-based).
  • ESMfold2 confidence parsing + schema handling

    • Added ESMfold2 loader path for .cif + .json inputs.
    • Supports:
      • keyed dict payloads (predicted_aligned_error or pae)
      • raw top-level matrix payloads
      • .json.gz variants
    • Added NaN-tolerant pLDDT normalization and explicit fallback behavior when ESMfold2 pair ipTM is absent.
  • Detection hardening for AF3 vs ESMfold2

    • Prioritizes AF3-specific markers when present.
    • Recognizes ESMfold2 signals for both keyed and raw formats.
    • Raises clear errors for unsupported top-level JSON types / unknown schemas instead of silently routing to the wrong parser.
    • Preserves missing-file error behavior for .cif + .json model detection paths.
  • Parser and docs alignment

    • Tightened mmCIF _atom_site validation edge cases.
    • Updated CLI/README usage to document --model and .cif + .json ambiguity guidance.
# Explicit source selection (recommended for .cif + .json)
ipsae --model esmfold2 esmfold2_complex_pae.json esmfold2_complex.cif 10 10
ipsae --model af3      fold_x_full_data_0.json   fold_x_model_0.cif   10 10

# API
result = score_interactions(pae_file, structure_file, 10, 10, model_type="boltz2")

Copilot AI and others added 13 commits September 12, 2026 01:55
Co-authored-by: colbyford <3814088+colbyford@users.noreply.github.com>
Co-authored-by: colbyford <3814088+colbyford@users.noreply.github.com>
Co-authored-by: colbyford <3814088+colbyford@users.noreply.github.com>
Co-authored-by: colbyford <3814088+colbyford@users.noreply.github.com>
Co-authored-by: colbyford <3814088+colbyford@users.noreply.github.com>
Co-authored-by: colbyford <3814088+colbyford@users.noreply.github.com>
Co-authored-by: colbyford <3814088+colbyford@users.noreply.github.com>
Co-authored-by: colbyford <3814088+colbyford@users.noreply.github.com>
Co-authored-by: colbyford <3814088+colbyford@users.noreply.github.com>
Co-authored-by: colbyford <3814088+colbyford@users.noreply.github.com>
Co-authored-by: colbyford <3814088+colbyford@users.noreply.github.com>
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.

2 participants