Detects regions of interest with peaks in a signal

findPeaksImpl1D(
  x,
  y,
  verbose = FALSE,
  length_in_xunits = 0.07,
  peakwidth_range_xunits = c(0.15, 0.4),
  peakDetectionCWTParams = list(exclude0scaleAmpThresh = TRUE),
  extension_factor = 0,
  iou_overlap_threshold = 0.2,
  debug = FALSE
)

Arguments

x

The x axis, to determine units

y

The vector where to find peaks, of dimensions length(x)

verbose

If TRUE information will be printed on screen

length_in_xunits

Length of the filter used to compute the second derivative. See details.

peakwidth_range_xunits

A vector of length 2 with the minimum and maximum peak width. See details.

peakDetectionCWTParams

Additional parameters to MassSpecWavelet::peakDetectionCWT(). See details.

extension_factor

A number to extend the ROIs beyond their default size

iou_overlap_threshold

A number, between 0 and 1. Pairs of ROIs with an intersection over union larger than this threshold are merged.

debug

If TRUE, return as well the debug information

Value

A list with the peak_list and debug_info elements.

Details

Peaks are detected on the intensity vector.

In detail, the approach is as follows:

  1. We compute the second derivative with respect to the drift and retention times.

  2. Based on the given peak width ranges, mexican hat wavelets are scaled

  3. Peaks on are detected using MassSpecWavelet::peakDetectionCWT().

  4. We merge similar ROIs using a threshold on the 1D-intersection over union

  5. Get some ROI metrics and return.

For the MassSpecWavelet-based peak detection, the scales are computed based on the requested peak widths. Besides, the scales, further tuning beyond the MassSpecWavelet defaults is possible through the peakDetectionCWTParams argument. By default, the only change we introduce is the exclude0scaleAmpThresh = TRUE which is a reasonable peak detection setting not enabled in MassSpecWavelet for backwards compatibility reasons.