Conditional spectrum autoencoder and clustering for MS/MS dark-proteome discovery
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
SpecClust
SpecClust embeds MS/MS spectra with a conditional transformer autoencoder and clusters the latent space to discover candidate novel ("dark proteome") peptides. Spectra are conditioned on precursor m/z, charge, and ion mobility, so same-peptide spectra land close together in latent space.
The trained model is large (~650 MB), so it is not shipped on PyPI. The pip package contains the code; the weights are hosted externally and downloaded + cached on first use. Because embedding only needs the encoder, the default download is encoder-only — roughly half the full model.
Installation
pip install specclust # core: load model, embed, cluster
pip install "specclust[hdbscan]" # add HDBSCAN clustering
pip install "specclust[viz]" # add plotting (matplotlib, umap)
pip install "specclust[mzml]" # add pyteomics for mzML
pip install "specclust[train]" # everything needed to retrain
TensorFlow is a core dependency (the encoder needs it) but is imported lazily —
import specclust does not load TensorFlow until you actually build or load a
model.
Getting the weights
The package looks for model files in this order:
SPECCLUST_MODEL_DIR— set this to a folder holding the weights (handy on an HPC node where you already have them):export SPECCLUST_MODEL_DIR=/path/to/weights
- the local cache (downloaded once, then reused);
- download from the URLs in
specclust.modelhub.REGISTRY.
To enable automatic download, host the weights and fill in the url (and,
recommended, sha256) fields of REGISTRY. Good hosting options: a GitHub
Release asset (simple, up to 2 GB/file), the Hugging Face Hub
(purpose-built for model weights), or Zenodo (gives a citable DOI for the
paper). Any direct-download URL works.
You can always bypass the registry with explicit local paths:
from specclust import load_encoder
encoder = load_encoder(weights="encoder.weights.h5", config="encoder_config.json")
Quick start
import numpy as np
from specclust import load_encoder, embed_raw_spectra, cluster_latents, score_clusters
encoder = load_encoder() # downloads/caches the encoder on first call
# raw peak lists + precursor info (lists aligned by index)
latents = embed_raw_spectra(
encoder,
mz_list, intensity_list,
precursor_mz, charge, ion_mobility,
)
labels, info = cluster_latents(latents, method="hdbscan", min_cluster_size=5)
scores = score_clusters(latents, labels)
print(info["n_clusters"], "clusters")
Command line:
specclust embed -i parquet_dir/ -o latents.npy
specclust cluster -i latents.npy -o clusters/ --method hdbscan
Publishing the model (one-time)
Run the export step to produce the slim encoder assets from a trained autoencoder, then upload them to your release/Hub:
python training/export_encoder.py --ae-dir AE_DIR --out release_assets/
# -> release_assets/specclust_encoder.weights.h5
# release_assets/encoder_config.json
Compute SHA-256 for the registry:
python -c "import hashlib,sys;print(hashlib.sha256(open(sys.argv[1],'rb').read()).hexdigest())" \
release_assets/specclust_encoder.weights.h5
Repository layout
src/specclust/ installable package (model, embed, cluster, consensus, CLI)
training/ NOT installed: HPC data-prep, training, and export scripts
export_encoder.py run once to create the slim encoder assets to publish
reference/ the original monolithic scripts, kept verbatim
tests/ run without TensorFlow or weights (model tests auto-skip)
Citation
Publication Pending!
Vilenne, Frédérique & Valkenborg Dirk. Clustering the Dark Proteome: A Deep Learning Approach to Novel Peptide Discovery in Immunopeptidomics (2026)
License
MIT © 2026 Frédérique Vilenne, Dirk Valkenborg
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file specclust-0.1.0.tar.gz.
File metadata
- Download URL: specclust-0.1.0.tar.gz
- Upload date:
- Size: 51.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0bbccac93311490ea2ee596471146b1362394b4ae04e1b53b221f55c611b950
|
|
| MD5 |
c9bfd89f764ccecd7be6357c6bafed72
|
|
| BLAKE2b-256 |
90f8cda6e58caa4e3668b6b6ec8462e8c67c12e02b8e62c7ff707156afc77766
|
Provenance
The following attestation bundles were made for specclust-0.1.0.tar.gz:
Publisher:
publish.yml on VilenneFrederique/specclust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
specclust-0.1.0.tar.gz -
Subject digest:
a0bbccac93311490ea2ee596471146b1362394b4ae04e1b53b221f55c611b950 - Sigstore transparency entry: 1703912756
- Sigstore integration time:
-
Permalink:
VilenneFrederique/specclust@18342c7c5b721ca95bc3655fed9cf9278e65578f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/VilenneFrederique
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@18342c7c5b721ca95bc3655fed9cf9278e65578f -
Trigger Event:
release
-
Statement type:
File details
Details for the file specclust-0.1.0-py3-none-any.whl.
File metadata
- Download URL: specclust-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6808e65d9516836235ae23805a62f68d6214c8748db9a5011512550ea4320d0f
|
|
| MD5 |
4ed5bcb3d849cf05a7f320c097fbc749
|
|
| BLAKE2b-256 |
90fd21def19aae28075e1c20bc23075a7103ba827910f3eb2275fb64514231f0
|
Provenance
The following attestation bundles were made for specclust-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on VilenneFrederique/specclust
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
specclust-0.1.0-py3-none-any.whl -
Subject digest:
6808e65d9516836235ae23805a62f68d6214c8748db9a5011512550ea4320d0f - Sigstore transparency entry: 1703912767
- Sigstore integration time:
-
Permalink:
VilenneFrederique/specclust@18342c7c5b721ca95bc3655fed9cf9278e65578f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/VilenneFrederique
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@18342c7c5b721ca95bc3655fed9cf9278e65578f -
Trigger Event:
release
-
Statement type: