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-12-18 14:28:26 Applying sanitization of the spectra 
#> Combining spectra in case...
#> MSn data (Spectra) with 3 spectra in a MsBackendMemory backend:
#>     msLevel     rtime scanIndex
#>   <integer> <numeric> <integer>
#> 1        NA        NA        NA
#> 2        NA        NA        NA
#> 3        NA        NA        NA
#>  ... 20 more variables/columns.
#> Processing:
#>  For groups of peaks with similar m/z keep the one with the highest intensity. [Wed Dec 18 14:28:27 2024]
#>  Remove fast fourier artefacts. [Wed Dec 18 14:28:27 2024]
#>  Remove peaks with intensities outside [0, Inf] in spectra of MS level(s) NA. [Wed Dec 18 14:28:27 2024]
#>  ...2 more processings. Use 'processingLog' to list all.