This function performs post acquisition signal processing for list
of MassSpectrum
objects using commonly used methods : transform intensities ("sqrt"), smoothing ("Wavelet"), remove baseline ("SNIP"), calibrate intensities ("TIC") and align spectra. Methods used are selected from the MALDIquant
and MALDIrppa
R packages.
SignalProcessing(x,
transformIntensity_method = "sqrt",
smoothing_method = "Wavelet",
removeBaseline_method = "SNIP",
removeBaseline_iterations = 25,
calibrateIntensity_method = "TIC",
alignSpectra_NoiseMethod = "MAD",
alignSpectra_method = "lowess",
alignSpectra_halfWs = 11,
alignSpectra_SN = 3,
tolerance_align = 0.002,
referenceSpectra = NULL,
minFrequency= 0.5,
binPeaks_method = "strict",
keepReferenceSpectra = FALSE,
...)
A list of modified MassSpectrum
objects (see MALDIquant
R package) according to chosen arguments. If the argument referenceSpectra
is not completed and the argument keepReferenceSpectra
is TRUE
, a list containing the MassSpectrum
objects modified named "spectra"
and the created reference spectrum named "RefS"
is returned.
a list
of MassSpectrum
objects (see MALDIquant
R package).
a character
indicating the method used to transform intensities: "sqrt"
by default. This function can be replaced by another mathematical function such as "log"
.
a character
indicating the smoothing methods used. By default, it performs undecimated Wavelet
transform (UDWT) for list
of MassSpectrum
objects. This Smoothing method can be remplaced by "SavitzkyGolay"
or "MovingAverage"
. See wavSmoothing
in the MALDIrppa
R package for details.
a character
indicating the method used to remove baseline. It uses "SNIP"
method for list
of MassSpectrum
objects. This baseline estimation method can be remplaced "TopHat"
, "ConvexHull"
or "median"
. See removeBaseline-methods
of the MALDIquant
R package for details.
a numeric
value indicting the number of iterations to remove baseline (by default = 25
). See removeBaseline-methods
of the MALDIquant
R package for details.
a character
indicating the intensities calibration method used ("TIC"
method by default). This calibration method can be remplaced by "PQN"
or "median"
.See calibrateIntensity-methods
of the MALDIquant
R package for details.
a character
indicating the noise estimation method. It uses "MAD"
method for list
of MassSpectrum
objects. This noise estimation method estimation method can be remplaced "SuperSmoother"
. See estimateNoise-methods
of the MALDIquant
R package for details.
a character
indicating the warping method. It uses "lowess"
method for list
of MassSpectrum
objects. This warping method method can be remplaced "linear"
, "quadratic"
or "cubic"
. See determineWarpingFunctions
of the MALDIquant
R package for details.
a numeric
value half window size to detect peaks (by default = 11
). See detectPeaks-methods
of the MALDIquant
R package for details.
a numeric
value indicating the signal-to-noise ratio used to detect peaks (by default = 3
). See detectPeaks-methods
of the MALDIquant
R package for details.
a numeric
value indicating a maximal relative deviation of a peak position (mass) to be considered as identical in ppm (by default = 0.002
). See determineWarpingFunctions
of the MALDIquant
R package for details.
a MassPeaks
reference spectrum for alignment of the sample(s). If this reference spectrum is not provided, a reference spectrum is created using the minFrequency
and binPeaks_method
arguments. See referencePeaks
of the MALDIquant
R package for details.
a numeric
minimum frequency for each peak over all analyzed spectra (by default = 0.5
) for the creation of the reference spectrum. See referencePeaks
of the MALDIquant
R package for details.
a character
indicating the method used to equalize masses for similar peaks for the creation of the reference spectrum. The "strict"
method is used by default corresponding to a unique peak per bin from the same sample. This method can be remplaced by "relaxed"
corresponding to multiple peaks per bin from the same sample. See binPeaks
of the MALDIquant
R package for more details.
a logical
value indicating if the created reference spectrum is returned by the function (FALSE
, default).
other arguments from MALDIrppa
packages for the wavSmoothing
function such as n.levels
(corresponding to the depth of the decomposiion for the wavelet function). See wavSmoothing
of the MALDIrppa
R package for details.
The SignalProcessing
function provides an analysis pipeline for MassSpectrum
objects including intensity transformation, smoothing, removing baseline.
The Wavelet
method relies on the wavShrink
function of the wmtsa
package and its dependencies (now archived by CRAN). The original C code by William Constantine and Keith L. Davidson, in turn including copyrighted routines by Insightful Corp., has been revised and included into MALDIrppa
for the method to work.
All the methods used for SignalProcessing
functions are selected from MALDIquant
and MALDIrppa
packages.
Godmer et al. (2025) presents a comparison of different pre-processing workflows that can help you to optimize your workflow.For a comprehensive guide, additional applications, and detailed examples of using this package, please visit our GitHub repository: here.
Gibb S, Strimmer K. MALDIquant: a versatile R package for the analysis of mass spectrometry data. Bioinformatics. 2012 Sep 1;28(17):2270-1. tools:::Rd_expr_doi("10.1093/bioinformatics/bts447"). Epub 2012 Jul 12. PMID: 22796955.
Javier Palarea-Albaladejo, Kevin Mclean, Frank Wright, David G E Smith, MALDIrppa: quality control and robust analysis for mass spectrometry data, Bioinformatics, Volume 34, Issue 3, 01 February 2018, Pages 522 - 523, tools:::Rd_expr_doi("https://doi.org/10.1093/bioinformatics/btx628")
Alexandre Godmer, Yahia Benzerara, Emmanuelle Varon, Nicolas Veziris, Karen Druart, Renaud Mozet, Mariette Matondo, Alexandra Aubry, Quentin Giai Gianetto, MSclassifR: An R package for supervised classification of mass spectra with machine learning methods, Expert Systems with Applications, Volume 294, 2025, 128796, ISSN 0957-4174, tools:::Rd_expr_doi("10.1016/j.eswa.2025.128796").
library("MALDIquant")
library("MSclassifR")
## Load mass spectra
data("CitrobacterRKIspectra", package = "MSclassifR")
# plot first unprocessed mass spectrum
PlotSpectra(SpectralData=CitrobacterRKIspectra[[1]], col_spec="blue")
## spectral treatment
spectra <- SignalProcessing(CitrobacterRKIspectra,
transformIntensity_method = "sqrt",
smoothing_method = "Wavelet",
removeBaseline_method = "SNIP",
removeBaseline_iterations = 25,
calibrateIntensity_method = "TIC",
alignSpectra_Method = "MAD",
alignSpectra_halfWs = 11,
alignSpectra_SN = 3,
tolerance_align = 0.002)
# plot first processed mass spectrum
PlotSpectra(SpectralData=spectra[[1]], col_spec="blue")
Run the code above in your browser using DataLab