wave: Detect peaks in intensity vs time space by continuous wavelet...

Description Usage Arguments Details Value Attribution See Also

View source: R/wave_centWave.R

Description

wave returns a list of all peak regions detected in an EIC as well as characteristics such as signal to noise estimations and integration regions.

Usage

1
2
wave(eic, peakwidth = c(20, 50), valleywidth.min = 10, sensitivity = 1,
  smooth = T)

Arguments

eic

data.frame containing columns: i - the EIC intensities, i.sg - the smoothed EIC intensitites, rt - the retention time of the observation in seconds, inroi - 1 if the scan is part of the ROI being interrogated, baseline - the estimated baseline at each point, noise.sd - the estimated SD of the noise at each point.

peakwidth

integer A two number vector containing the min and max expected peakwidth in seconds. Note, do not make the minimum peakwidth too small - a 20 second peakwidth can still detect 2 second peaks. Smaller peakwidths limit the ability of the algorithm to distinguish noise from peakshape. The only downside of larger peakwidths is discerning poorly resolved peaks.

valleywidth.min

integer The minimum width of a valley in seconds before the peak is split. Stochastic fluctuations can generate multiple scan valleys which are challenging to discern. It is suggested that this remain reasonably large unless there is very little noise.

sensitivity

numeric Larger sensitivities will search for peaks in noisier regions as defined by noise.sd of the eic. This comes at the cost of additional processing time.

smooth

boolean Substitutes i for i.sg for relevant calculations.

Details

This function is a modification of the original centWave algorithm [1]. The modifications are extensive - this code has not been tested to the extent which centWave has.

Modifications include:

The algorithm accepts EICs rather than xcmsRaw objects for flexibility.

The peak detection algorithm has been separated from noise estimation code. (Noise estimation can be performed prior to analysis)

Valley tracking to limit the aggregation of closely eluting peaks

The ability to substitute smoothed EICs in relevant regions of the analysis

New peak quality measurements. (In our hands these provide more informative peak filters than the original code's signal to noise estimation.)

Value

A matrix, rows corresponding to peaks.

This matrix has many columns. Columns prefixed with "wavelet." are analyses performed on the wavelet suggested peak bounds. Columns prefixed with "descent." are analyses performed on the integration bounds (found by descending to the lowest point which can result in very long tails.) Peakshape comparisons like warpgroup may benefit from using the wavelet bounds as they will contain the bulk of the mass of the peak. Useful columns include wavelet.fold.above.waveletbaseline and descent.fold.above.descentbaseline which have shown good stratification of peak quality and can be used to filter noise.

Attribution

This code was modified from the originally published centWave algorithm [1]. The code was orginally distributed and obtained under the GPL2 license via the xcms software package [2]. The original algorithms depend on the wavelet analysis code included in the MassSpecWavelet package [3]. All code herein was obtained under the GPL2 license and remains under the GPL 3 license or greater.

See Also


nathaniel-mahieu/centWaveP documentation built on May 23, 2019, 12:19 p.m.