Skip to content

Add DeepImmuno class-I immunogenicity predictor (#250) - #251

Merged
iskandr merged 1 commit into
masterfrom
add-deepimmuno-immunogenicity
Jul 10, 2026
Merged

Add DeepImmuno class-I immunogenicity predictor (#250)#251
iskandr merged 1 commit into
masterfrom
add-deepimmuno-immunogenicity

Conversation

@iskandr

@iskandr iskandr commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Closes #250.

Adds DeepImmuno (Li et al., Briefings in Bioinformatics 2021) — a small CNN that scores class-I CD8+ immunogenicity from a peptide and its HLA-A/B/C allele. It's the fourth immunogenicity predictor alongside Calis, PRIME, and BigMHC_IM, emitting one Kind.immunogenicity prediction per (peptide, allele).

Design

  • Subprocess + sidecar interpreter (the DeepTAP pattern). DeepImmuno ships MIT-licensed weights in-repo but its deepimmuno-cnn.py rebuilds the net and loads them with an old Keras 2 / TensorFlow stack, so mhctools shells out to that CLI in a user-provided checkout (DEEPIMMUNO_HOME) via a user-provided interpreter (DEEPIMMUNO_PYTHON). On newer TensorFlow the interpreter only needs the tf-keras shim — the wrapper sets TF_USE_LEGACY_KERAS=1 for the subprocess so the Keras-2 checkpoint loads.
  • 9- and 10-mers only (DeepImmuno's encoder handles no other length) — validated up front with a clear error.
  • ~62 supported alleles; DeepImmuno snaps anything else to the nearest it knows, so the wrapper only normalizes punctuation (HLA-A*02:01HLA-A*0201).
  • AsyncProcess/run_command gain cwd/env passthrough (backward-compatible) because DeepImmuno hardcodes ./data and ./models and must run in its own dir.

Verification

Confirmed end-to-end against a local DeepImmuno checkout on TF 2.17 + tf-keras: NLVPMVATV/HLA-A*02:01 = 0.9568, GILGFVFTL = 0.8872. Offline tests (parser, allele format, construction/validation) run in CI; the end-to-end tests are gated on DEEPIMMUNO_HOME. ruff clean.

⚠️ Same caveat as the other immunogenicity models: independent benchmarks put CD8 neoepitope immunogenicity near AUC 0.5–0.65 on unseen tumor neoepitopes. A prioritization aid, not ground truth.

Version bump 3.29.0 → 3.30.0.

https://claude.ai/code/session_01LZahFhBSCiehXTESCYQ7wG

DeepImmuno (Li et al., Briefings in Bioinformatics 2021) is a small CNN that
scores class-I CD8+ immunogenicity from a peptide and its HLA-A/B/C allele. It
joins the other immunogenicity predictors (Calis, PRIME, BigMHC_IM), emitting
one Kind.immunogenicity prediction per (peptide, allele).

DeepImmuno ships MIT-licensed weights in-repo but loads them with an old
Keras 2 / TensorFlow stack, so the wrapper shells out to its deepimmuno-cnn.py
CLI in a user-provided checkout (DEEPIMMUNO_HOME) via a user-provided
interpreter (DEEPIMMUNO_PYTHON) — the DeepTAP pattern. On newer TensorFlow the
interpreter only needs the tf-keras shim; the wrapper sets
TF_USE_LEGACY_KERAS=1 for the subprocess so the Keras-2 checkpoint loads.

- 9- and 10-mers only (validated up front); ~62 alleles, nearest-match rescue
  handled by DeepImmuno itself
- add cwd/env passthrough to AsyncProcess/run_command (the tool hardcodes
  ./data and ./models relative paths, so it must run in its own dir)
- register as "deepimmuno" in the CLI; export from the package
- tests: parser + allele-format + construction/validation offline, end-to-end
  gated on DEEPIMMUNO_HOME (verified locally: NLVPMVATV/HLA-A*02:01 = 0.9568)
- README + kind_support table; bump 3.29.0 -> 3.30.0

Verified end-to-end against a local DeepImmuno checkout on TF 2.17 + tf-keras.

Claude-Session: https://claude.ai/code/session_01LZahFhBSCiehXTESCYQ7wG
@iskandr
iskandr merged commit 9acb760 into master Jul 10, 2026
5 checks passed
@iskandr
iskandr deleted the add-deepimmuno-immunogenicity branch July 10, 2026 15:53
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.

Add DeepImmuno wrapper — class-I CD8 immunogenicity (MIT, self-contained)

1 participant