MaldiSuite
A Python ecosystem for MALDI-TOF spectral processing and analysis in antimicrobial resistance research
MaldiSuite brings together preprocessing, batch effect correction, and deep learning classifiers for clinical microbiology and computational biology research: use each package on its own, or combine them through the shared sklearn-compatible API.
Landing page: MaldiSuite
What this repository contains
This repository serves two purposes:
- Landing page for the website.
- 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, differential analysis and 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 | Preprocessing, evaluation, differential analysis, drift monitoring | MaldiAMRKit | |
| MaldiBatchKit | Batch effect correction for mass spectra | MaldiBatchKit | |
| 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.4.0 pins:
| Package | Pinned range |
|---|---|
| MaldiAMRKit | maldiamrkit[batch,formats]>=0.22.2,<0.23 |
| MaldiBatchKit | maldibatchkit[viz]>=0.2.0,<0.3 |
| MaldiDeepKit | maldideepkit>=0.4.0,<0.5 |
Alternatively, install individual packages separately:
pip install maldiamrkit # preprocessing, evaluation, 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.2, maldibatchkit 0.2.2 and maldideepkit 0.4.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.
Acknowledgements
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.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| maldisuite-0.4.0.tar.gz | 7.0 kB | Without provenance | Details for maldisuite-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| maldisuite-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for maldisuite-0.4.0-py3-none-any.whl |
Total release size: 12.0 kB
Release files / maldisuite-0.4.0.tar.gz
| Download URL | maldisuite-0.4.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b2d0e8692c2d0557139963e34db54dfa8330047c9e491730bd3eb4ed73586a74
|
|
BLAKE2b-256 checksum How to use checksums |
10ae7049d5b13cd2035af9e8dc4f269b61ec57f703733743264652b411bfe3ff
|
| 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.4.0-py3-none-any.whl
| Download URL | maldisuite-0.4.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b08398d53a84d2e30dc3d8dcf34976ee26ba2d80b870adeb7ee5b71279c460d
|
|
BLAKE2b-256 checksum How to use checksums |
2b58cf5b7f1bdd10a72b54e0e072df61527c0e93758ff66324248a303f4b6aa4
|
| 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.4.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.