Skip to main content

Mass spectrometry machine learning utilities derived from ProXAI notebooks.

Project description

ProXAI-MS Logo

ProXAI-MS

Transforming MS1 Data into Learnable Representations
via Gradient-Based Pseudo-MS1 Spectra


🚀 Overview

ProXAI-MS is a machine learning framework that converts MS1 data into interpretable pseudo-MS1 spectra using gradient-based saliency mapping.

It enables:

  • Binary classification (control vs experiment)
  • Gradient-based feature attribution
  • Reconstruction of spectra from learned signal importance

🔥 Key Features

  • Train ML models on binned MS1 data
  • Gradient-based explainability
  • Separate positive vs negative gradients
  • Convert gradients → pseudo-MS1 spectra
  • Supports flexible dataset formats (long or wide)
  • CLI + Python API

📦 Installation

From TestPyPI

pip install -i https://test.pypi.org/simple/ proxai-ms==0.1.0

From source

git clone https://github.com//proxai-ms.git cd proxai-ms pip install -e .


⚙️ CLI Usage

Run the full pipeline:

proxai-ms run ^ --csv "F:\20251110\dataset_rt.csv" ^ --label-column target ^ --bin-column bin ^ --bin-values 15 ^ --control-labels 0 1 2 ^ --experiment-labels 3 4 ^ --out-prefix "F:\20261110\proxai_test"


🔹 Arguments

  • --csv → Input dataset
  • --label-column → Label column
  • --bin-column → Column for bin grouping
  • --bin-values → Number of bins per sample
  • --control-labels → Control group labels
  • --experiment-labels → Experiment group labels
  • --out-prefix → Output prefix

📤 Outputs

  • _pseudo_ms1_positive.csv
  • _pseudo_ms1_negative.csv
  • _pseudo_ms1_plot.png

🧪 Python API

from proxai_ms import run_pipeline

result = run_pipeline( csv_path="dataset.csv", label_column="target", bin_column="bin", bin_values=15, control_labels=[0,1,2], experiment_labels=[3,4], )


📊 Input Format

Supports:

Wide format

Rows = samples, columns = m/z bins

Long format

  • bin column (grouping index)
  • intensity values
  • label column

🔬 Core Concept

ProXAI learns signal importance via gradients:

  • Positive gradients → experiment signal
  • Negative gradients → control signal

These are mapped back to spectral space to form:

Pseudo-MS1 = learned biochemical representation

Unlike traditional pipelines:

  • No peak picking required
  • No manual feature engineering
  • Fully data-driven representation learning

🧱 Project Structure

proxai-ms/

├── assets/
├── src/proxai_ms/
│ ├── training.py
│ ├── explain.py
│ ├── pipeline.py
│ └── cli.py
├── notebooks/
├── docs/
├── scripts/
└── pyproject.toml


⚠️ Important Notes

  • Disable normalization if gradients collapse to zero
  • Avoid averaging gradients across samples incorrectly
  • Always separate positive and negative gradients before aggregation

🛣️ Roadmap

  • Deep learning models (CNN / Transformer)
  • Multi-class classification
  • UniDec integration
  • mzML export
  • GUI (ProXAI Desktop)

👨‍🔬 Author

Benjamin Nouri Nigjeh
Proteomics • Machine Learning • Mass Spectrometry


📜 License

MIT License

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

proxai_ms-0.1.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

proxai_ms-0.1.0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file proxai_ms-0.1.0.tar.gz.

File metadata

  • Download URL: proxai_ms-0.1.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for proxai_ms-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ff8b6bf3e10c0ea39db59f7d5068862352cf675b5cce9a0c7f408569c3747b41
MD5 375b577da98f99ca6be9465cf9979504
BLAKE2b-256 b464f5ef69a918c1fdf879079d083ecc6455c6711026898c1ab429370bce4abc

See more details on using hashes here.

Provenance

The following attestation bundles were made for proxai_ms-0.1.0.tar.gz:

Publisher: publish.yml on benjaminnigjeh/proxai-ms

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

File details

Details for the file proxai_ms-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: proxai_ms-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for proxai_ms-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8b79008e5c0704beef3f6b027d88ef58723b64f8cc0e1ef0c57cc5f468c0f2a
MD5 96309ac5ea797590a4ad99087d7e7821
BLAKE2b-256 e39bfb9773cf9090fb4125263e09f6330ff2a6a61a12b5729f74b1a003ddfc3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for proxai_ms-0.1.0-py3-none-any.whl:

Publisher: publish.yml on benjaminnigjeh/proxai-ms

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