Skip to contents

This function sanitizes spectra

Usage

sanitize_spectra(spectra, cutoff = 0, dalton = 0.01, polarity = NA, ppm = 10)

Arguments

spectra

Spectra object

cutoff

Absolute minimal intensity

dalton

Dalton tolerance

polarity

Polarity

ppm

PPM tolerance

Value

The sanitized spectra

Examples

data.frame(
  FEATURE_ID = c("FT001", "FT002", "FT003"),
  mz = c(list(123.4567, 234.5678, 345.6789))
) |>
  Spectra::Spectra() |>
  sanitize_spectra()
#> 2024-09-18 14:33:04 Applying sanitization of the spectra 
#> Combining spectra in case...
#> MSn data (Spectra) with 0 spectra in a MsBackendMemory backend:
#> Processing:
#>  For groups of peaks with similar m/z keep the one with the highest intensity. [Wed Sep 18 14:33:04 2024]
#>  Remove fast fourier artefacts. [Wed Sep 18 14:33:04 2024]
#>  Remove peaks with intensities outside [0, Inf] in spectra of MS level(s) NA. [Wed Sep 18 14:33:04 2024]
#>  ...3 more processings. Use 'processingLog' to list all.