snrPeaks: Extract signal-to-noise ratio thresholds from 'MassPeaks'...

View source: R/snrPeaks.R

snrPeaksR Documentation

Extract signal-to-noise ratio thresholds from MassPeaks objects

Description

This function extracts the thresholds used to determine peaks from mass spectra based on signal-to-noise ratio (SNR) (threshold equal to SNR*noise).

Usage

snrPeaks(x)

Arguments

x

A list of MassPeaks objects.

Details

Given a collection of MassPeaks objects as obtained from detectPeaks, this function provides the thresholds used in each case to determine peaks from the original mass spectra. The thresholds are calculated as the product of a SNR value set by the user and the estimated noise of the signal (see detectPeaks).

Value

A list of vectors of SNR-based thresholds, one for each sample.

Examples

# Load example data

data(spectra) # list of MassSpectra class objects

# Some pre-processing

spectra <- screenSpectra(spectra)$fspectra
spectra <- transformIntensity(spectra, method = "sqrt")
spectra <- wavSmoothing(spectra)
spectra <- removeBaseline(spectra)
peaks <- detectPeaks(spectra)

# Extract thresholds for each mass peak profile

SNRs <- snrPeaks(peaks)

Japal/MALDIrppa documentation built on Jan. 31, 2024, 12:15 p.m.