Conversation
ERAP1 trims the N-termini of 9-16mer precursor peptides in the ER down to the 8-10mers MHC-I presents — the processing step between TAP transport and MHC loading, and previously the one empty Kind in mhctools (erap_trimming was "reserved, not yet used"; every other kind now has a predictor). ERAMER (Al-okaily 2024) models ERAP1 specificity as a per-length position-weight matrix and scores a precursor by averaging the PWM specificity over each residue trimmed off as it is cut toward a target epitope length. Licensing: ERAMER is GPLv3 and its PWM ships in a GPL-licensed PWM.xlsx; mhctools is Apache-2.0 and vendors neither. This is a clean-room Python-3 reimplementation of the (Python-2.7) tool's trimming-cascade average that loads the PWM from a user-provided ERAMER checkout at runtime (ERAMER_HOME / eramer_home= / pwm_path=) via openpyxl — exactly how the netMHC / MixMHCpred wrappers read user-provided model files. - mhctools/eramer.py: _find_pwm_path (honors explicit paths, else env/home), load_pwm (openpyxl, lazy import), _specificity + eramer_score (the cascade), and the allele-free ERAMER predictor (predict() / predict_dataframe()). - pred.py: PeptideResult.erap_trimming accessor. - annotate.py: "erap_trimming" output-field token so predict-table can consume ERAMER (--predictor eramer:col:erap_trimming). Verified end-to-end. - cli/args.py + __init__.py: registered/exported "eramer". - tests/test_eramer.py: cascade math tested binary-free with a synthetic PWM; validation/support tests; e2e gated on ERAMER_HOME + openpyxl, reproducing ERAMER v1.0's own sample outputs exactly (0.085322875, 0.273310375). Added to the public CI subset. - README: ERAP1 trimming section + kind_support row; erap_trimming kind is no longer "reserved". Every Kind in the taxonomy now has at least one predictor. Note: ERAMER's evaluation is self-reported and ERAP1 trimming is intrinsically noisy — treat the score as a pathway prior, not a validated oracle. Version 3.26.0 -> 3.27.0. Claude-Session: https://claude.ai/code/session_01LZahFhBSCiehXTESCYQ7wG
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.
Second of the two native-reimplementation PRs (Calis ✅ → ERAMER). This one closes the last empty stage of the processing pathway:
Kind.erap_trimmingwas "reserved, not yet used" — after this, every Kind in the taxonomy has at least one predictor.ERAP1 trims the N-termini of 9–16mer precursor peptides in the ER down to the 8–10mers MHC-I presents — the step between TAP transport (
DeepTAP) and MHC loading. Wraps ERAMER (Al-okaily et al., Comput. Biol. Med. 2024), which models ERAP1 specificity as a per-length position-weight matrix and scores a precursor by averaging the PWM specificity over each residue trimmed off as it is cut toward a target epitope length.Licensing — nothing vendored (like TULIP/MixMHCpred/netMHC)
ERAMER is GPLv3 and its PWM lives in a GPL-licensed
PWM.xlsx; mhctools is Apache-2.0 and vendors neither. This is a clean-room Python-3 reimplementation of the (Python-2.7) tool's trimming-cascade average that loads the PWM from a user-provided ERAMER checkout at runtime (ERAMER_HOME/eramer_home=/pwm_path=, viaopenpyxl) — exactly how the netMHC / MixMHCpred wrappers read user-provided model files. Reimplementing in py3 also avoids ERAMER's py2.7 toolchain.Faithfulness / validation
_specificity= per-position PWM mean;eramer_score= mean over the trimming steps) reproduces ERAMER v1.0's own sample outputs exactly:GGGGGVVVVVVAAAEE → 0.085322875,LLLLLLLLLLLAAAAA → 0.273310375. Cross-checked the upstreamcompute_specifictyno-oplength_weightterm (never set → 0) so I don't carry it.tests/test_eramer.py: cascade math tested binary-free with a synthetic PWM; construction/validation tests; e2e gated onERAMER_HOME+openpyxlreproducing the reference values. Added to the public CI subset (the e2e skips cleanly in CI, which has no checkout).Integration
mhc_dependence: none,mhc_class: I) — oneerap_trimmingprediction per peptide, emptyallele. New data model; adds thePeptideResult.erap_trimmingaccessor and a newerap_trimmingannotate token so it composes withmhctools predict-table(--predictor eramer:col:erap_trimming). Verified end-to-end.eramer;openpyxlis a lazy import with a clear install hint (only needed to read the user'sPWM.xlsx).Caveat (documented)
ERAMER's evaluation is self-reported and ERAP1 trimming is intrinsically noisy — treat the score as a pathway prior, not a validated oracle.
Version
3.26.0 → 3.27.0.https://claude.ai/code/session_01LZahFhBSCiehXTESCYQ7wG