Learn R Programming

MALDIquant (version 0.2)

removeBaseline-methods: Removes the baseline of a SingleSpectrum object.

Description

This method removes the baseline of mass spectrometry data (represented by a SingleSpectrum object). The intensity of the mass spectrometry data would be reduced by baseline.

Usage

## S3 method for class 'SingleSpectrum':
removeBaseline(object,
    baseline=NULL,
    \dots)

Arguments

object
SingleSpectrum object
baseline
a two column matrix with intensities (y-values) as second column. If no baseline argument is given the baseline would be estimate automatically by calling
...
arguments to be passed to estimateBaseline,SingleSpectrum-method

Value

  • Returns a modified SingleSpectrum object with reduced intensities.

References

See website: http://www.sebastiangibb.de/maldiquant

See Also

SingleSpectrum, estimateBaseline,SingleSpectrum-method, loess

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);

## subtract baseline 
ms <- removeBaseline(s);

## draw modified spectrum on the plot
lines(ms, col="blue");

Run the code above in your browser using DataLab