| Title: | Serialize and restore MsExperiment objects in interoperable file formats |
|---|---|
| Description: | The serialization mechanism of R allows to save and load R data objects in a binary format, that can however not be read by other programming languages or software. The MsExperimentStash package implements the serialization methods from the MsStash package for MsExperiment objects. Data can be stashed in a variety of file formats and types, including HDF5 and JSON-based formats defined by the Bioconductor *alabaster* package. |
| Authors: | Johannes Rainer [aut, cre] (ORCID: <https://orcid.org/0000-0002-6977-7147>), Philippine Louail [aut] (ORCID: <https://orcid.org/0009-0007-5429-6846>), Laurent Gatto [ctb] (ORCID: <https://orcid.org/0000-0002-1520-2268>), Gabriele Tomè [ctb] (ORCID: <https://orcid.org/0000-0002-3976-6068>, fnd: MetaRbolomics4Galaxy project (CUP: D53C25001030003) co-funded by the Autonomous Province of Bolzano under the Joint Projects South Tyrol–Germany 2025 program.) |
| Maintainer: | Johannes Rainer <[email protected]> |
| License: | GPL-3 |
| Version: | 0.97.1 |
| Built: | 2026-06-29 15:00:04 UTC |
| Source: | https://github.com/rformassspectrometry/MsExperimentStash |
MsExperimentFiles
The MsExperiment::MsExperimentFiles class stores files (or rather file names) that are part of a mass spectrometry experiment.
The supported stash formats for MsExperimentFiles objects are listed in
the sections below.
## S4 method for signature 'MsExperimentFiles,PlainTextParam' saveMsObject(object, param, ...) ## S4 method for signature 'MsExperimentFiles,PlainTextParam' readMsObject(object, param, ...) ## S4 method for signature 'MsExperimentFiles' saveObject(x, path, ...) ## S4 method for signature 'MsExperimentFiles,AlabasterParam' saveMsObject(object, param, ...) ## S4 method for signature 'MsExperimentFiles,AlabasterParam' readMsObject(object, param, ...)## S4 method for signature 'MsExperimentFiles,PlainTextParam' saveMsObject(object, param, ...) ## S4 method for signature 'MsExperimentFiles,PlainTextParam' readMsObject(object, param, ...) ## S4 method for signature 'MsExperimentFiles' saveObject(x, path, ...) ## S4 method for signature 'MsExperimentFiles,AlabasterParam' saveMsObject(object, param, ...) ## S4 method for signature 'MsExperimentFiles,AlabasterParam' readMsObject(object, param, ...)
object |
An |
param |
|
... |
Currently ignored. |
x |
An |
path |
For |
readMsObject() returns a MsExperiment::MsExperimentFiles object.
PlainTextParam
The text-file format stash folder for MsExperimentFile objects contains
a file ms_experiment_files.txt with two tabulator separated columns name
and files. Each row (except the first) is one element of the
MsExperimentFile, the first defining the object's names and the second
its content, which represents a characted vector with the file name(s),
separated by a "|" (if more than one).
AlabasterParam
The MsExperimentFiles stash folder contains the alabaster-specific
OBJECT file and a sub-folder x with the MsExperimentFiles
content serialized by alabaster.base.
Johannes Rainer
library(MsExperiment) fls <- MsExperimentFiles(list(input = c("file.mzML", "file2.mgf"))) ## Define the path to the stash d <- file.path(tempdir(), "ms_file_stash") ## Stash the object in alabaster format saveMsObject(fls, AlabasterParam(d)) ## The content of the stash: subfolder x contains the *character list* ## saved through the *alabaster.base* package. library(fs) dir_tree(d) ## Restore the object from stash res <- readMsObject(MsExperimentFiles(), AlabasterParam(d)) res ## In addition, it is possible to read the object also with the ## *alabaster.base* functionality library(alabaster.base) res <- readObject(d)library(MsExperiment) fls <- MsExperimentFiles(list(input = c("file.mzML", "file2.mgf"))) ## Define the path to the stash d <- file.path(tempdir(), "ms_file_stash") ## Stash the object in alabaster format saveMsObject(fls, AlabasterParam(d)) ## The content of the stash: subfolder x contains the *character list* ## saved through the *alabaster.base* package. library(fs) dir_tree(d) ## Restore the object from stash res <- readMsObject(MsExperimentFiles(), AlabasterParam(d)) res ## In addition, it is possible to read the object also with the ## *alabaster.base* functionality library(alabaster.base) res <- readObject(d)