peakRegionMask: Peak Region Mask

Description Usage Arguments Value Author(s) See Also Examples

Description

This function finds the mz region spanning by a peak. It creates an 0/1 matrix used for multiplications in other functions.

Usage

1
.peakRegionMask(x, p, k = 30L)

Arguments

x

numeric, e.g. intensity values.

p

integer, indices of identified peaks/local maxima.

k

integer(1): maximum number of values left and right of the peak that should be looked for valleys.

Value

A matrix with a column for each peak in p and 2 * k + 1 rows where the middle row k + 1 is the peak centroid. If the values is 1 the index belongs to the peak region.

Author(s)

Sebastian Gibb

See Also

Other extreme value functions: localMaxima(), refineCentroids(), valleys()

Examples

1
2
3
4
5
ints <- c(5, 8, 12, 7, 4, 9, 15, 16, 11, 8, 3, 2, 3, 2, 9, 12, 14, 13, 8, 3)
mzs <- seq_along(ints)
peaks <- which(localMaxima(ints, hws = 3L))

m <- MsCoreUtils:::.peakRegionMask(ints, peaks, k = 5L)

MsCoreUtils documentation built on Nov. 8, 2020, 10:59 p.m.