mhcmatch#

NEOANTIGEN RANKING AND CASSETTE DESIGN

Which neoantigens are presented, which ones a T cell will see, and which twenty to put in a construct. MHC I and MHC II, human and mouse, pure Python on the seqtree search core.

Version 1.20.2. Everything on these pages is what this release does; the release history is in ROADMAP.md.

Every reference dataset is fetched from isalgo/pmhc_data on first use, so a fresh pip install mhcmatch runs every example here with no manual downloads.

What it does#

Presentation, without a per-allele model

Per-allele weight matrices over an anchor-factored decomposition, reported as a control-calibrated %rank. Rare allotypes borrow from groove-similar frequent ones through a pseudosequence diffusion kernel, which recovers most of what an allele's own measured repertoire buys.

Affinity as a Potts model

Peptide binding core against the 34-residue groove pseudosequence, fitted on measured IC50. Combined with presentation through Fisher's method into binder — a soft AND, which is what makes the gated fast path worth having.

Recognition, not just binding

The TCR-facing strip scored on burial and charge, plus anchor-masked k-mer density against three reference corpora — self, thymic and viral. Resemblance to the thymic immunopeptidome raises the score; resemblance to self is the largest negative term in the model.

Mimicry as signed risk

Viral, self and thymic resemblance split by anchor and TCR-facing channel, as signed log-odds rather than one distance. The two families have opposite signs, so a whole-peptide distance averages them to nothing.

A cassette is a set, not a list

Choosing k units is a portfolio problem: two constructs with identical expected responders can differ twofold in P(at least one works). The objective prices shared allotypes and shared sequence — the two mechanisms — and is submodular, so greedy carries a bound.

Assembly, safety and escape

Withdraw units matching essential-tissue self peptides, size each allotype, order them, choose the spacer by minimising junctional binding, back-translate and emit a map. Price what the tumour pays to delete a unit, and what it costs to lose an allele.