Notebooks#
Six worked examples, one per section of the paper. They are
marimo notebooks — plain Python files with @app.cell decorators, so
they diff and review like source rather than like JSON, and they run three ways:
pip install 'mhcmatch[notebooks]'
marimo edit notebooks/01_binding_prediction.py # interactive
marimo run notebooks/01_binding_prediction.py # read-only app
python notebooks/01_binding_prediction.py # plain script; prints, no UI
Every notebook bootstraps its own data from
isalgo/pmhc_data and caches it, so a fresh
pip install is enough. No local paths, no pre-staged files.
They demonstrate this library solving a user’s problem, and nothing else. No rival tool is run
and no head-to-head is reproduced — those are a benchmark’s job and live in a separate repository.
Where the point is the method the notebook calls the Python API; where the point is a real run it
calls the mhcmatch command line, because that is what a reader would actually type.
1 · Binding prediction
Decompose a peptide, rank its presenting alleles, read binder. Why
p_binder is pool-invariant and a within-list percentile is not.
2 · Physicochemistry and recognition
The TCR-facing strip on a published immunogenicity corpus: burial, charge, the position-role evidence, and the six feature blocks of the recognition axis.
3 · Corpus overlap and similarity
Self, thymic and viral reference sets: what they share, what they do not, and the anchor-masked density that turns that into three scored channels.
4 · EPIC across datasets
The whole nine-term aggregate on held-out published neoantigens, from the command line, with the per-term decomposition read back.
5 · Cassettes on cohorts
Select and score on real manufactured units: why composition is not ranking, and why one offset per donor deletes the comparison it looks like it is making.
6 · Assembly and safety
Withdraw the unsafe units, order what is left, choose the linker, back-translate, and read the map of the finished construct.
Each notebook opens with a markdown cell stating what it demonstrates and what to conclude, and
every number shown is computed in the notebook — nothing is transcribed. notebooks/README.md
records each one’s measured wall clock and peak memory.