Learn R Programming

MALDIquant (version 0.3)

estimateNoise-methods: Estimates the noise of a MassSpectrum object.

Description

This methods estimates the noise of mass spectrometry data (represented by a MassSpectrum object). Default noise estimation uses the median absolute deviation.

Usage

## S3 method for class 'MassSpectrum':
estimateNoise(object, 
    fun=mad,
    \dots)

Arguments

object
MassSpectrum object
fun
used noise estimator (default: mad; but every function returning a single numeric value or a vector of equal size as object would be possible).
...
arguments to be passed to fun

Value

  • Returns a single numeric value or a vector of equal size as object. It depends on the used noise estimator function fun.

See Also

MassSpectrum, detectPeaks,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);

## estimate noise 
n <- estimateNoise(s);

## draw noise on the plot
abline(h=n, col="red");

Run the code above in your browser using DataLab