Learn R Programming

MALDIquant (version 1.7)

.estimateBaselineMedian: Estimates the baseline by moving estimators.

Description

This function estimates the baseline of mass spectrometry data. The baseline estimation is based on median which is used in a moving window. It is hidden by NAMESPACE because it is a private function and estimateBaseline,MassSpectrum-method should be used instead.

Usage

.estimateBaselineMedian(x, y,
    halfWindowSize=100)

Arguments

x
vector of x values
y
vector of y values
halfWindowSize
half size of the moving window for the median (based on runmed) The resulting window reaches from mass[cur_index-halfWindowSize] to mass[cur_index+halfWindowSize].

Value

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

See Also

MassSpectrum, estimateBaseline,MassSpectrum-method, removeBaseline,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]]

## plot spectrum
plot(s)

## estimate baseline
b <- estimateBaseline(s, method="Median")

## draw baseline on the plot
lines(b, col="red")

Run the code above in your browser using DataLab