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 sanitized_name will be used to name the spectra.

rds_prefix

[Deprecated] Writing to disk as RDS is no longer supported. A character indicating the prefix for the .RDS output files to be written in the processed directory. By default, no prefix are given and thus no files are written.

Details

Based on the original implementation, the function performs the following tasks:

  1. Square-root transformation

  2. Mass range trimming to 4-10 kDa as they were deemed most determinant by Strejcek et al. (2018)

  3. Signal smoothing using the Savitzky-Golay method and a half window size of 20

  4. Baseline correction with the SNIP procedure

  5. Normalization by Total Ion Current

  6. Peak detection using the SuperSmoother procedure and with a signal-to-noise ratio above 3

  7. 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:

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

[Package maldipickr version 1.3.0 Index]