findPeaksImpl.Rd
Detects regions of interest with peaks in a sample.
findPeaksImpl(
drift_time,
retention_time,
int_mat,
verbose = FALSE,
dt_length_ms = 0.07,
rt_length_s = 8,
dt_peakwidth_range_ms = c(0.15, 0.4),
rt_peakwidth_range_s = c(10, 25),
dt_peakDetectionCWTParams = list(exclude0scaleAmpThresh = TRUE),
rt_peakDetectionCWTParams = list(exclude0scaleAmpThresh = TRUE),
dt_extension_factor = 0,
rt_extension_factor = 0,
exclude_rip = FALSE,
iou_overlap_threshold = 0.2,
debug_idx = list(dt = NULL, rt = NULL)
)
The drift time vector
The retention time vector
The intensity matrix, of dimensions length(drift_time)
rows and length(retention_time)
columns
If TRUE
information will be printed on screen
Length of the filters used to compute the second derivative. See details.
A vector of length 2 with the minimum and maximum peak width. See details
Additional parameters to MassSpecWavelet::peakDetectionCWT()
. See details
Whether to exclude ROIs with a drift time apex smaller than the RIP drift time end.
A number, between 0 and 1. Pairs of ROIs with an intersection over union larger than this threshold are merged.
A list with two numeric vectors named dt
and rt
each of them having a the indices to where debug info is kept
A list with the peak_list
and debug_info
elements.
Peaks are detected on the intensity matrix.
In detail, the approach is as follows:
We compute the second derivative with respect to the drift and retention times.
Based on the given peak width ranges, mexican hat wavelets are scaled
Peaks are detected using MassSpecWavelet::peakDetectionCWT()
.
We intersect the maxima to discard saddle points
We merge similar ROIs using a threshold on the intersection over union
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.