Learn R Programming

MALDIquant (version 1.7)

.estimateNoiseMad: Estimates the noise by MAD.

Description

This function estimates the noise of mass spectrometry data by calculating the median absolute deviation. It is hidden by NAMESPACE because it is a private function and estimateNoise,MassSpectrum-method should be used instead.

Usage

.estimateNoiseMad(x, y)

Arguments

x
vector of x values
y
vector of y values

Value

  • Returns a two column matrix (first column: mass, second column: intensity) of the estimated baseline.

See Also

MassSpectrum, estimateNoise,MassSpectrum-method

Examples

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

## load example data
data("fiedler2009subset", package="MALDIquant")

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

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

## remove baseline
s <- removeBaseline(s)

## plot spectrum
plot(s)

## estimate noise
n <- estimateNoise(s, method="MAD")

## draw noise on the plot
lines(n, col="red")

Run the code above in your browser using DataLab