View source: R/process_spectra.R
process_spectra | R Documentation |
Process Bruker MALDI Biotyper spectra à la Strejcek et al. (2018)
process_spectra(
spectra_list,
spectra_names = get_spectra_names(spectra_list),
rds_prefix = deprecated()
)
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.
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 the name
column.
The original R code on which this function is based is accessible at: https://github.com/strejcem/MALDIvs16S
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.
import_biotyper_spectra and check_spectra for the inputs and merge_processed_spectra for further analysis.
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.