Learn R Programming

MALDIquant (version 0.3)

detectPeaks-methods: Detects peaks in a MassSpectrum object.

Description

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.

Usage

## S3 method for class 'MassSpectrum':
detectPeaks(object,
    localMaxima, noise, SNR=2,
    \dots)

Arguments

object
MassSpectrum object
localMaxima
a two column matrix with intensities (y-values) as second column. If no localMaxima argument is given the local maxima would be searched automatically by calling
noise
single numeric value or vector of same size as object. If no noise argument is given the noise would be estimated automatically by calling
SNR
single numeric value. SNR is an abbreviation for signal-to-noise-ratio. A local maximum has to be higher than SNR*noise to be recognize as peak.
...

Value

  • Returns a MassPeaks object.

References

See website: http://strimmerlab.org/software/maldiquant/

See Also

MassPeaks, MassSpectrum, estimateNoise,MassSpectrum-method findLocalMaxima,MassSpectrum-method,

Examples

Run this code
## load library
library("MALDIquant");

## load example data
data("sA1", package="MALDIquant");

## choose only the first mass spectrum
s <- sA1[[1]];

## transform intensities
s <- transformIntensity(s, sqrt);

## 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);

Run the code above in your browser using DataLab