maldi_find_peaks_by_well: Extract intensities for given m/z values

Description Usage Arguments Details Value Examples

View source: R/maldi_fun.R

Description

Extract intensities for given m/z values

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
maldi_find_peaks_by_well(
  object,
  mass_list,
  tolerance_assignment = 0.5,
  method = "MAD",
  SNR = 3,
  ...,
  manual = FALSE,
  pivot = "[0-9]_[A-Z]+[0-9]+"
)

Arguments

object

A (list of) MassSpectrum.

mass_list

Named list specifying the m/z at which to try extracting the intensity.

tolerance_assignment

Maximum difference between the calculated m/z and the mass at the detected peak m/z.

method

a noise estimation function; see estimateNoise,MassSpectrum-method.

SNR

single numeric value. SNR is an abbreviation for signal-to-noise-ratio. A local maximum has to be higher than SNR*noise to be recognize as peak.

...

Further arguments passed to MALDIquant::detectPeaks.

manual

Logical whether all peaks must be picked manually (TRUE) or only in ambiguous cases (FALSE).

pivot

A regular expression describing the name of a single folder in each tree up to which "groups" and from which "replicates" are established. See Details.

Details

Peaks are pre-selected from a smoothed spectrum within the m/z range given by mass_list and tolerance_assignment. Peaks are measured in the original, unsmoothed spectrum using MALDIquant::detectPeaks.

Value

A tibble with columns "ion", "mass", "intensity", "percent" and well identifiers "well" etc. that relate the measured intensies to the object, e.g. using "findex" (position in list) and/or "gindex" (group number in list).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data("BobCAT")

my_masses <- c(ion_species_A = 2425, ion_species_B = 2441)

# trim the spectra during averaging to speed-up the peak detection; alternatively
# use MALDIquant::trim(...).
my_spectrum <- maldi_average_by_well(BobCAT, final_trim_range = c(2420, 2445))

maldi_find_peaks_by_well(my_spectrum, my_masses)  # automatically
maldi_find_peaks_by_well(my_spectrum, my_masses, manual = TRUE)  # all by hand
maldi_find_peaks_by_well(my_spectrum, mass_list = c(ion_species_C = 2439))  # tricky ones by hand

benjbuch/summerrmass documentation built on Dec. 19, 2021, 8:43 a.m.