mhctools gives a lovely uniform interface over the MHC-ligand predictors — NetMHCpan, NetMHCcons, NetMHCIIpan, NetMHCstabpan, MHCflurry, etc. — all "does this peptide bind this MHC" tools.
We've been leaning on it heavily (thank you!) and hit a gap one step down the antigen-presentation cascade: pMHC:TCR binding (does a given αβ TCR recognise a given pMHC). The reference model there is NetTCR-2.2 (mnielLab — the same lab as NetMHCpan), and it would be natural to call it through the same mhctools-style wrapper we already use for NetMHCpan.
Before proposing a PR, I wanted to check scope, because NetTCR differs from everything currently in mhctools in two ways:
- Modality — it predicts TCR specificity, not MHC-ligand binding. mhctools has so far been MHC-ligand-only; TCR:pMHC may be deliberately out of scope.
- Interface — NetTCR-2.2 isn't a compiled DTU
netMHC* binary you shell out to. It's a Python/Keras package that ships pretrained TFLite models; prediction runs on plain tensorflow (tf.lite.Interpreter) with no conda env. So a wrapper wouldn't follow the BaseCommandlinePredictor subprocess pattern — it'd be an in-process TFLite runner.
Questions:
- Is pMHC:TCR prediction something you'd want under
mhctools, or should such wrappers live in a separate package (or be contributed upstream to NetTCR itself)?
- If in scope: we have a small, working wrapper that runs NetTCR-2.2's pan CV ensemble on the six-CDR input format (peptide + A1/A2/A3/B1/B2/B3), averages the ensemble, and reproduces the published IMMREP-2022 per-peptide AUROC (~0.79) in a few seconds. Happy to open a PR if you'd take it.
Context: we're using it as the runnable SoTA for a TCR:pMHC benchmark task; the wrapper is ~40 lines.
mhctoolsgives a lovely uniform interface over the MHC-ligand predictors — NetMHCpan, NetMHCcons, NetMHCIIpan, NetMHCstabpan, MHCflurry, etc. — all "does this peptide bind this MHC" tools.We've been leaning on it heavily (thank you!) and hit a gap one step down the antigen-presentation cascade: pMHC:TCR binding (does a given αβ TCR recognise a given pMHC). The reference model there is NetTCR-2.2 (mnielLab — the same lab as NetMHCpan), and it would be natural to call it through the same
mhctools-style wrapper we already use for NetMHCpan.Before proposing a PR, I wanted to check scope, because NetTCR differs from everything currently in mhctools in two ways:
netMHC*binary you shell out to. It's a Python/Keras package that ships pretrained TFLite models; prediction runs on plaintensorflow(tf.lite.Interpreter) with no conda env. So a wrapper wouldn't follow theBaseCommandlinePredictorsubprocess pattern — it'd be an in-process TFLite runner.Questions:
mhctools, or should such wrappers live in a separate package (or be contributed upstream to NetTCR itself)?Context: we're using it as the runnable SoTA for a TCR:pMHC benchmark task; the wrapper is ~40 lines.