detectPeaks-methods | R Documentation |
This method looks for peaks in mass spectrometry data
(represented by a MassSpectrum
object).
A peak is a local maximum above a user defined noise threshold.
## S4 method for signature 'MassSpectrum'
detectPeaks(object,
halfWindowSize=20, method=c("MAD", "SuperSmoother"), SNR=2,
...)
## S4 method for signature 'list'
detectPeaks(object, ...)
object |
|
halfWindowSize |
|
method |
a noise estimation function; see
|
SNR |
single numeric value. |
... |
arguments to be passed to
|
Returns a MassPeaks
object.
Sebastian Gibb mail@sebastiangibb.de
MassPeaks
,
MassSpectrum
,
estimateNoise,MassSpectrum-method
demo("peaks")
Website: https://strimmerlab.github.io/software/maldiquant/
## load package
library("MALDIquant")
## load example data
data("fiedler2009subset", package="MALDIquant")
## choose only the first mass spectrum
s <- fiedler2009subset[[1]]
## transform intensities
s <- transformIntensity(s, method="sqrt")
## smoothing spectrum
s <- smoothIntensity(s, method="MovingAverage")
## remove baseline
s <- removeBaseline(s)
## plot spectrum
plot(s)
## call peak detection
p <- detectPeaks(s)
## draw peaks on the plot
points(p)
## label 10 highest peaks
top10 <- intensity(p) %in% sort(intensity(p), decreasing=TRUE)[1:10]
labelPeaks(p, index=top10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.