Learn R Programming

MALDIquant (version 0.2)

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

Description

This methods estimates the baseline of mass spectrometry data (represented by a SingleSpectrum object).

Usage

## S3 method for class 'SingleSpectrum':
estimateBaseline(object, 
    method=c("SNIP", "ConvexHull", "MovingEstimator"),
    ...)

Arguments

object
SingleSpectrum object
method
a baseline estimation function; see .estimateBaselineSnip, .estimateBaselineConvexHull,
...
arguments to be passed to method

Value

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

See Also

SingleSpectrum, .estimateBaselineSnip, .estimateBaselineConvexHull, .estimateBaselineMovingEstimator, removeBaseline,SingleSpectrum-method

Examples

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

## load readBrukerFlexData library for fid file import 
## (is also done automatically by importSingleSpectrum)
library("readBrukerFlexData");

## get examples directory
exampleDirectory <- system.file("Examples", package="readBrukerFlexData");

## read example spectrum
s <- importSingleSpectrum(file.path(exampleDirectory,
    "2010_05_19_Gibb_C8_A1/0_A1/1/1SLin/fid"));

## plot spectrum
plot(s);

## estimate baseline
b <- estimateBaseline(s);

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

Run the code above in your browser using DataLab