50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

peakPick (version 0.11)

detect.spikes: Detects spikes in series of numbers.

Description

This algorithm detects spikes rising above a user-specified number of standard deviations numbers in a certain window. Use this algorithm to detect short spikes rather than smooth bumps in series of numbers. Please refer to the paper by Weber et al. for more details.

Usage

detect.spikes(mat, roi, winlen, spike.min.sd = 3, mc.cores = 1, verbose = FALSE)

Arguments

mat
matrix of series with series organized columnwise. The algorithm treats each column separately.
roi
vector of two integers (c(min, max)) defining positions in all series (rows in mat) to consider for spike detection, used together with winlen. Must lie within the interval [2, nrow(mat) - 1]. Will be coerced to integers.
winlen
integer defining the window of positions to consider for mean and sem estimation for each series. Each estimation limits itself to the position and a plus/minus winlen positions large window. Thus, winlen must not be chosen larger than that the windows fit within mat, given the roi. I.e. roi[1] - winlen >=1 AND roi[length(roi)] + winlen
spike.min.sd
numeric minimum number of standard deviations for a spike to rise above the mean in order to be considered for a spike call and to be excluded from the mean estimation of each subsequent iteration of the spike calling algorithm
mc.cores
the number of cores do perform this calculation
verbose
Boolean indicating the number of new peaks detected with each iteration. The algorithm stops as soon as this number does not sink anymore. Turn this on if running into problems.

Value

boolean matrix corresponding to mat, representing spike positions.

References

Weber, C.M., Ramachandran, S., and Henikoff, S. (2014). Nucleosomes are context-specific, H2A.Z-modulated barriers to RNA polymerase. Molecular Cell 53, 819-830.