Skip to main content

Cluster immunopeptidomics peptides by HLA/MHC binding motif, with an interactive HTML report

Reason this release was yanked:

legacy-name renamed mhc-to now

Project description

HLA-PepClust

Cluster immunopeptidomics peptides by their HLA/MHC binding motif and get a ranked table plus a standalone interactive HTML report.

clust-search takes a GibbsCluster output folder, correlates each cluster's position-specific scoring matrix against a reference of HLA/MHC class I + II binding motifs (human & mouse), and writes the best allele match per cluster.


For users

Requirements: Python 3.9–3.11.

1. Install

Clone the repo and install it (editable, so git pull updates the tool):

git clone https://github.com/PurcellLab/MHC-TP.git
cd MHC-TP
pip install -e .

Prefer a one-liner without cloning? pip install git+https://github.com/PurcellLab/MHC-TP.git A virtual environment (python -m venv .venv && source .venv/bin/activate) is recommended.

2. Download the reference data (once)

The reference motifs are fetched from the GitHub release, not bundled:

clust-search fetch -s human     # or:  mouse  |  all

3. Run a search

clust-search search <gibbscluster_output_dir> -s human -o results/

<gibbscluster_output_dir> is a GibbsCluster run folder (it must contain a matrices/ subdirectory).

Outputs land in results/clust_result/:

file what it is
correlations.csv every cluster→allele match above the threshold (hla = display name, formatted = raw key, correlation = PCC)
clust-search-result.html standalone report — open it in any browser

Common options

flag meaning default
-s, --species human or mouse human
-r, --reference path to a <species>.parquet (otherwise the fetched one is used) auto
-t, --threshold minimum Pearson correlation to report 0.70
-o, --output output directory output
--threads max CPU threads (also $HLA_PEPCLUST_THREADS) 4
--no-html write only the CSV off
-l, --log also save the coloured session log off

Run clust-search search --help for the full list.


For contributors / developers

The project uses pixi for a reproducible dev environment (Python 3.11) and a src/ layout packaged with hatchling.

git clone https://github.com/PurcellLab/MHC-TP.git
cd MHC-TP
pixi install            # create the dev env from pixi.lock
pixi run dev-install    # editable-install the package into the env (run once)

pixi run test           # pytest
pixi run lint           # ruff
pixi run fmt            # black

Always run via pixi run … — a bare python may pick up a different interpreter without the pinned dependencies.

Rebuilding the reference data (dev only)

End users never do this. The per-species parquets are built once from the NetMHCpan / NetMHCIIpan packs and uploaded to the release. Embedding the Seq2Logo reference logos (--with-logos) needs a separate Python 2.7 env and is slow — run it on a cluster:

clust-search build-ref <species> <classI_pack> <classII_pack> <out.parquet> \
    --with-logos --workers 16
# Seq2Logo itself runs in its own env:  pixi run -e seq2logo ...

Layout

src/hla_pepclust/
  cli.py            entry point (clust-search)
  engine/           numba correlation search
  refdata/          reference parquet read/write, fetch, schema
  report/           HTML report rendering (data, logos, templates)
  db/               DEV-ONLY reference-pack ingestion
  tui/              Rich console banner, logging, results table
tests/              pytest suite

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hla_pepclust-2.0.0.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hla_pepclust-2.0.0-py3-none-any.whl (42.7 kB view details)

Uploaded Python 3

File details

Details for the file hla_pepclust-2.0.0.tar.gz.

File metadata

  • Download URL: hla_pepclust-2.0.0.tar.gz
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hla_pepclust-2.0.0.tar.gz
Algorithm Hash digest
SHA256 dcc0082a07a513cb5467bdbcd39e8475f6a1dc7355754547a01c0cc0bf3abc14
MD5 636312e5af24627a7d5b3f797a3df909
BLAKE2b-256 99bd13d9d7f7ea1321164b7377911631e8515a86eb09cdab63c984a9a7fc32df

See more details on using hashes here.

File details

Details for the file hla_pepclust-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: hla_pepclust-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 42.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hla_pepclust-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7db787aa5d8c4a742b00ba7584746935c24cb87739e626406c3afc4b33e0547
MD5 c344c4fcd451f395dffa3b4a27e3f670
BLAKE2b-256 b36ad287c8e0c11dd60bacdf7712042d486c1e04fc6c9469daf7398d407e7b01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page