Store your mass spectrometry result objects in a safe place
MsStash provides flexible, language-agnostic import and export capabilities for mass spectrometry (MS) data objects in R. It facilitates interoperability by supporting various open file formats such as JSON, HDF5, plain text, and domain-specific standards like mzTab-M or MetaboLights archives.
While R’s native save()/load() functions allow object serialization, they
rely on R-specific binary formats, making cross-platform data exchange
difficult. MsStash addresses this by introducing standardized file formats
and programmatic interfaces, simplifying integration between R-based tools and
external software ecosystems.
- 📦 Export/import MS analysis results objects across interoperable file formats
- 🧩 Modular design via S4 parameter classes and generic methods
- 🔄 Integration with Bioconductor packages like Spectra, MsExperiment, xcms, and alabaster.base
- 🔧 Support for plain text, JSON+HDF5, mzTab-M, and MetaboLights repository data
saveMsObject(object, param)readMsObject(object, param)
These methods delegate the actual file handling based on the class of the
supplied param object (e.g., PlainTextParam, AlabasterParam).
Each format can be configured with their respective S4 class:
| Class | Purpose |
|---|---|
PlainTextParam |
Text-based tabular storage |
AlabasterParam |
HDF5/JSON archival via alabaster |
mzTabParam |
Export to mzTab-M (MS metabolomics) |
MetaboLightsParam |
Import from MetaboLights repository |
Implementation of the import/export methods for individual MS data structures are implemented in the corresponding R packages.
- Tab-delimited export/import for key objects:
- Structured archival using HDF5 and JSON (via
alabaster.base)
Future development directions include:
- 🔄 Import mzTab-M into
SummarizedExperiment - 🔄 Import mzTab-M into
QFeatures - 🔄 Generic ISA-tab import integration (if justified)
We welcome and encourage contributions — see below for how to get involved!
We appreciate contributions of all kinds — from bug fixes and tests to documentation and new format support.
If you're planning to contribute:
- Read our contribution guidelines
- Follow the RforMassSpectrometry style guide
- Fork the repo, create a branch, implement your changes, and submit a pull request
- For new formats, implement:
- A
*ParamS4 class - A
readMsObject()and/orsaveMsObject()method - Tests in
tests/testthat/
- A
This package is licensed under the Artistic 2.0 License: 📄 https://opensource.org/licenses/Artistic-2.0
Documentation (manuals, vignettes) is licensed under CC BY-SA 4.0: 📄 https://creativecommons.org/licenses/by-sa/4.0/
Part of this work was funded by the European Union under the HORIZON-MSCA-2021 project 101073062: HUMAN – Harmonising and Unifying Blood Metabolic Analysis Networks, by the Autonomous Province of Bolzano under the MetaRbolomics4Galaxy project (CUP: D53C25001030003) from the Joint Projects South Tyrol–Germany 2025 funding program and by the DFG grant no. 564004112.

