Skip to main content

MaldiSuite

Website PyPI meta-package Python License: MIT

MaldiSuite

A Python ecosystem for MALDI-TOF spectral processing and analysis in antimicrobial resistance research

MaldiSuite combines preprocessing, batch effect correction, and deep learning classifiers in a single sklearn-compatible workflow for clinical microbiology and computational biology research.

Landing page: MaldiSuite


What this repository contains

This repository serves two purposes:

  1. Landing page for the website.
  2. Meta-package: a minimal PyPI package (maldisuite) that installs the three packages of the suite with pinned compatible versions.

This repository does not contain the source code of the three packages. Each package lives in its own repository, with its own issues, documentation, and release cycle.

The three packages

MaldiAMRKit owns the data model, preprocessing, evaluation, and biomarker / drift modules; MaldiBatchKit re-exports every corrector (ComBat variants, Limma, Harmony, MALDI-specific harmonisers) at the top level; MaldiDeepKit ships scikit-learn-compatible deep classifiers (MaldiMLPClassifier, MaldiCNNClassifier, MaldiResNetClassifier, MaldiTransformerClassifier).

Logo Package Purpose Repository
MaldiAMRKit MaldiAMRKit Preprocessing, evaluation, biomarkers, drift monitoring MaldiAMRKit
MaldiBatchKit MaldiBatchKit Batch effect correction for mass spectra MaldiBatchKit
MaldiDeepKit MaldiDeepKit Deep learning classifiers for MALDI-TOF spectra MaldiDeepKit

Installation

Install the full suite with a single command:

pip install maldisuite

This installs maldiamrkit, maldibatchkit, and maldideepkit at compatible versions. maldisuite 0.3.0 pins:

Package Pinned range
MaldiAMRKit maldiamrkit[batch,formats]>=0.22.1,<0.23
MaldiBatchKit maldibatchkit[viz]>=0.2.0,<0.3
MaldiDeepKit maldideepkit>=0.3.0,<0.4

Alternatively, install individual packages separately:

pip install maldiamrkit     # preprocessing, biomarkers, drift
pip install maldibatchkit   # batch effect correction
pip install maldideepkit    # deep learning classifiers

Quick start

from maldiamrkit import MaldiSet
from maldiamrkit.evaluation import CaseGroupedKFold, vme_scorer
from maldiamrkit.susceptibility import LabelEncoder
from maldibatchkit import BatchAwareWarping, SpeciesAwareComBat
from maldideepkit import MaldiMLPClassifier
from sklearn.model_selection import cross_val_score
from sklearn.pipeline import Pipeline

# metadata.csv: ID, Drug (R/S), Species, batch, patient_id
data = MaldiSet.from_directory("spectra/", "metadata.csv", bin_width=3)
meta = data.meta.loc[data.X.index]
y = LabelEncoder().fit_transform(data.get_y_single("Drug"))  # R=1, S=0

pipe = Pipeline([
    ("warp",   BatchAwareWarping(batch=meta["batch"])),
    ("combat", SpeciesAwareComBat(batch=meta["batch"],
                                  species=meta["Species"])),
    ("clf",    MaldiMLPClassifier(input_dim=data.X.shape[1],
                                  random_state=0)),
])

scores = cross_val_score(
    pipe, data.X, y,
    scoring=vme_scorer,
    cv=CaseGroupedKFold(n_splits=5, random_state=0),
    groups=meta["patient_id"],
)
print(f"VME: {-scores.mean():.3f}")

Every step is refitted inside each training fold, and CaseGroupedKFold keeps all spectra of a patient in the same fold. Tested with maldiamrkit 0.22.1, maldibatchkit 0.2.0 and maldideepkit 0.3.0.

Citation

MaldiSuite is described in an Application Note currently under review at Bioinformatics. The full citation will be added here once the article is published.

License

MIT License - see LICENSE for the full text.

Acknowledgments

MaldiSuite builds on the work of the mass spectrometry and clinical microbiology communities. In particular, we acknowledge:

  • MALDIquant (Gibb & Strimmer, 2012, Bioinformatics)
  • The Borgwardt Lab and the DRIAMS benchmark (Weis et al., 2022, Nature Medicine), which established Python-based MALDI-TOF AMR prediction as a research area

Metadata

Release files for maldisuite 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for maldisuite 0.3.0
File Size Uploaded Provenance Actions
maldisuite-0.3.0.tar.gz 6.6 kB Without provenance Details for maldisuite-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for maldisuite 0.3.0
File Interpreter ABI Platform Actions
maldisuite-0.3.0-py3-none-any.whl Python 3 none any Details for maldisuite-0.3.0-py3-none-any.whl

Total release size: 11.3 kB

Release files / maldisuite-0.3.0.tar.gz

Download URL maldisuite-0.3.0.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3b9c0bebd62ff96f211a091a0cf9636dd36857eae7b3a59392f203f162e68e50
BLAKE2b-256 checksum
How to use checksums
4469be0a16844530c42bd02d2a0c677f8275cbf10c847f9fef10a6f02e1ed661
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / maldisuite-0.3.0-py3-none-any.whl

Download URL maldisuite-0.3.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
034bf2fb2527982dde6a459e9a7b3d193a9413051a8c99cb05fcb5159325da04
BLAKE2b-256 checksum
How to use checksums
b466fd2ab4732a65538522bac54d3ffd16436049ef5b0162c46879895ec369d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for maldisuite 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page