Skip to main content

Conditional spectrum autoencoder and clustering for MS/MS dark-proteome discovery

Project description

ECLIPSE

ECLIPSE 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 eclipse-ms                 # core: load model, embed, cluster
pip install "eclipse-ms[hdbscan]"      # add HDBSCAN clustering
pip install "eclipse-ms[viz]"          # add plotting (matplotlib, umap)
pip install "eclipse-ms[mzml]"         # add pyteomics for mzML
pip install "eclipse-ms[train]"        # everything needed to retrain

TensorFlow is a core dependency (the encoder needs it) but is imported lazily — import eclipse_ms does not load TensorFlow until you actually build or load a model.

Getting the weights

load_encoder() resolves the model files in this order:

  1. ECLIPSE_MODEL_DIR — set this to a folder holding the weights (handy on an HPC node where you already have them):
   export ECLIPSE_MODEL_DIR=/path/to/weights
  1. the local cache (downloaded once, then reused);
  2. download from the GitHub release (the URLs are configured in eclipse_ms.modelhub.REGISTRY).

With no setup, option 3 runs automatically on first use. You can also bypass the registry with explicit local paths:

from eclipse_ms import load_encoder
encoder = load_encoder(weights="encoder.weights.h5", config="encoder_config.json")

Quick start

import numpy as np
from eclipse_ms 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:

eclipse embed   -i parquet_dir/ -o latents.npy
eclipse cluster -i latents.npy  -o clusters/ --method hdbscan

Repository layout

src/eclipse_ms/     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


Download files

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

Source Distribution

eclipse_ms-0.1.2.tar.gz (51.7 kB view details)

Uploaded Source

Built Distribution

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

eclipse_ms-0.1.2-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

File details

Details for the file eclipse_ms-0.1.2.tar.gz.

File metadata

  • Download URL: eclipse_ms-0.1.2.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eclipse_ms-0.1.2.tar.gz
Algorithm Hash digest
SHA256 444f65f59311edf6cd7e6ba79690dbf5e496a1d2205fc1408ab2a7e922d1c574
MD5 76e6ed14fcb4a700fe1a2a42cf414634
BLAKE2b-256 c808c90046133f95705f03b30d48d79814bf0e868ab6dafb705702aebdcff540

See more details on using hashes here.

Provenance

The following attestation bundles were made for eclipse_ms-0.1.2.tar.gz:

Publisher: publish.yml on VilenneFrederique/ECLIPSE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eclipse_ms-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: eclipse_ms-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 20.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for eclipse_ms-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ba3ec620697e361137b4b9251ff4fb66709b3764f2044551132ec1bf7eab3848
MD5 33d4d1f006fbff1b1b54ecbff5708504
BLAKE2b-256 7ecd3547bf2e36cd555bff1f8b393b2b0984cfd1bac0dde115a0280436972519

See more details on using hashes here.

Provenance

The following attestation bundles were made for eclipse_ms-0.1.2-py3-none-any.whl:

Publisher: publish.yml on VilenneFrederique/ECLIPSE

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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