process_spectra {maldipickr} | R Documentation |
Process Bruker MALDI Biotyper spectra à la Strejcek et al. (2018)
Description
Process Bruker MALDI Biotyper spectra à la Strejcek et al. (2018)
Usage
process_spectra(
spectra_list,
spectra_names = get_spectra_names(spectra_list),
rds_prefix = deprecated()
)
Arguments
spectra_list |
A list of MALDIquant::MassSpectrum objects. |
spectra_names |
A tibble::tibble (or data.frame) of sanitized spectra names by default from get_spectra_names. If provided manually, the column |
rds_prefix |
Writing to disk as RDS is no longer supported. A character indicating the prefix for the |
Details
Based on the original implementation, the function performs the following tasks:
Square-root transformation
Mass range trimming to 4-10 kDa as they were deemed most determinant by Strejcek et al. (2018)
Signal smoothing using the Savitzky-Golay method and a half window size of 20
Baseline correction with the SNIP procedure
Normalization by Total Ion Current
Peak detection using the SuperSmoother procedure and with a signal-to-noise ratio above 3
Peak filtering. This step has been added to discard peaks with a negative signal-to-noise ratio probably due to being on the edge of the mass range.
Value
A named list of three objects:
-
spectra
: a list the length of the spectra list of MALDIquant::MassSpectrum objects. -
peaks
: a list the length of the spectra list of MALDIquant::MassPeaks objects. -
metadata
: a tibble indicating the median signal-to-noise ratio (SNR
) and peaks number for all spectra list (peaks
), with spectra names in thename
column.
Note
The original R code on which this function is based is accessible at: https://github.com/strejcem/MALDIvs16S
References
Strejcek M, Smrhova T, Junkova P & Uhlik O (2018). “Whole-Cell MALDI-TOF MS versus 16S rRNA Gene Analysis for Identification and Dereplication of Recurrent Bacterial Isolates.” Frontiers in Microbiology 9 doi:10.3389/fmicb.2018.01294.
See Also
import_biotyper_spectra and check_spectra for the inputs and merge_processed_spectra for further analysis.
Examples
# Get an example directory of six Bruker MALDI Biotyper spectra
directory_biotyper_spectra <- system.file(
"toy-species-spectra",
package = "maldipickr"
)
# Import the six spectra
spectra_list <- import_biotyper_spectra(directory_biotyper_spectra)
# Transform the spectra signals according to Strejcek et al. (2018)
processed <- process_spectra(spectra_list)
# Overview of the list architecture that is returned
# with the list of processed spectra, peaks identified and the
# metadata table
str(processed, max.level = 2)
# A detailed view of the metadata with the median signal-to-noise
# ratio (SNR) and the number of peaks
processed$metadata