Metadata-Version: 2.5
Name: maldisuite
Version: 0.4.0
Summary: MaldiSuite: a Python ecosystem for MALDI-TOF spectral processing and analysis in antimicrobial resistance research
Project-URL: Homepage, https://ettorerocchi.github.io/MaldiSuite/
Project-URL: Documentation, https://ettorerocchi.github.io/MaldiSuite/
Project-URL: Repository, https://github.com/EttoreRocchi/MaldiSuite
Project-URL: Bug Tracker, https://github.com/EttoreRocchi/MaldiSuite/issues
Project-URL: MaldiAMRKit, https://github.com/EttoreRocchi/MaldiAMRKit
Project-URL: MaldiBatchKit, https://github.com/EttoreRocchi/MaldiBatchKit
Project-URL: MaldiDeepKit, https://github.com/EttoreRocchi/MaldiDeepKit
Author: Ettore Rocchi
License: MIT License
        
        Copyright (c) 2026 Ettore Rocchi
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: AMR,MALDI-TOF,antimicrobial resistance,batch effect correction,clinical microbiology,deep learning,machine learning,mass spectrometry
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Healthcare Industry
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.10
Requires-Dist: maldiamrkit[batch,formats]<0.23,>=0.22.2
Requires-Dist: maldibatchkit[viz]<0.3,>=0.2.0
Requires-Dist: maldideepkit<0.5,>=0.4.0
Description-Content-Type: text/markdown

# MaldiSuite

[![Website](https://img.shields.io/badge/website-online-0b6f82)](https://ettorerocchi.github.io/MaldiSuite/)
[![PyPI meta-package](https://img.shields.io/pypi/v/maldisuite.svg?color=4f9a2c)](https://pypi.org/project/maldisuite/)
[![Python](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/EttoreRocchi/MaldiSuite/blob/main/LICENSE)

<p align="center">
  <img src="https://raw.githubusercontent.com/EttoreRocchi/MaldiSuite/main/assets/maldi_suite_logo.png" alt="MaldiSuite" width="320"/>
</p>

<p align="center">
  <strong>A Python ecosystem for MALDI-TOF spectral processing and analysis in antimicrobial resistance research</strong>
</p>

<p align="center">
  <img src="https://raw.githubusercontent.com/EttoreRocchi/MaldiSuite/main/assets/suite_packages.svg" alt="Animated overview of the three packages, side by side: MaldiAMRKit (preprocessing, alignment, MIC interpretation), MaldiBatchKit (correction, diagnostics, tuning) and MaldiDeepKit (four backbones, uncertainty, dual-branch models); use one, or all three with pip install maldisuite" width="720"/>
</p>

**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](<https://ettorerocchi.github.io/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, 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 |
|:---:|---|---|---|
| <img src="https://raw.githubusercontent.com/EttoreRocchi/MaldiSuite/main/assets/web/maldiamrkit_logo.png" alt="MaldiAMRKit" width="80"> | **MaldiAMRKit** | Preprocessing, evaluation, differential analysis, drift monitoring | [MaldiAMRKit](https://github.com/EttoreRocchi/MaldiAMRKit) |
| <img src="https://raw.githubusercontent.com/EttoreRocchi/MaldiSuite/main/assets/web/maldibatchkit_logo.png" alt="MaldiBatchKit" width="80"> | **MaldiBatchKit** | Batch effect correction for mass spectra | [MaldiBatchKit](https://github.com/EttoreRocchi/MaldiBatchKit) |
| <img src="https://raw.githubusercontent.com/EttoreRocchi/MaldiSuite/main/assets/web/maldideepkit_logo.png" alt="MaldiDeepKit" width="80"> | **MaldiDeepKit** | Deep learning classifiers for MALDI-TOF spectra | [MaldiDeepKit](https://github.com/EttoreRocchi/MaldiDeepKit) |

## Installation

Install the full suite with a single command:

```bash
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:

```bash
pip install maldiamrkit     # preprocessing, evaluation, drift
pip install maldibatchkit   # batch effect correction
pip install maldideepkit    # deep learning classifiers
```

## Quick start

```python
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`](https://github.com/EttoreRocchi/MaldiSuite/blob/main/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