Learn R Programming

MALDIquant (version 1.1)

estimateBaseline-methods: Estimates the baseline of a MassSpectrum object.

Description

This method estimates the baseline of mass spectrometry data (represented by a MassSpectrum object).

Usage

## S3 method for class 'MassSpectrum':
estimateBaseline(object,
  method=c("SNIP", "TopHat", "ConvexHull", "median"),
  ...)

Arguments

object
MassSpectrum object
method
a baseline estimation function; see .estimateBaselineSnip, .estimateBaselineTopHat,
...
arguments to be passed to method

Value

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

See Also

MassSpectrum, .estimateBaselineSnip, .estimateBaselineTopHat, .estimateBaselineConvexHull, .estimateBaselineMedian, removeBaseline,MassSpectrum-method

Examples

Run this code
## load package
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="SNIP")

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

Run the code above in your browser using DataLab