Learn R Programming

Cardinal (version 1.4.0)

reduceBaseline-methods: Reduce the Baseline for an Imaging Dataset

Description

Apply baseline reduction to a mass spectrometry imaging dataset.

Usage

"reduceBaseline"(object, method = "median", ..., pixel = pixels(object), plot = FALSE)
## Median baseline reduction reduceBaseline.median(x, blocks=500, fun=min, spar=1, ...)

Arguments

object
An object of class MSImageSet.
method
The baseline reduction method to use.
pixel
The pixels to baseline subtract. If less than the extent of the dataset, this will result in a subset of the data being processed.
plot
Plot the mass spectrum for each pixel while it is being processed?
...
Additional arguments passed to the baseline reduction method.
x
The mass spectrum to be baseline subtracted.
blocks
The number of intervals to break the mass spectrum into in order to choose minima or medians from which to interpolate the baseline.
fun
Function used to determine the points from which the baseline will be interpolated.
spar
Smoothing parameter for the spline smoothing applied to the spectrum in order to decide the cutoffs for throwing away baseline references that might occur inside peaks.

Value

An object of class MSImageSet with the baseline-subtracted spectra.

Details

Baseline reduction is usually performed using the provided functions, but a user-created function can also be passed to method. In this case it should take the following arguments:

  • x: A numeric vector of intensities.
  • ...: Additional arguments.

A user-created function should return a numeric vector of the same length. with the baseline-subtracted intensities.

Internally, pixelApply is used to apply the baseline reduction. See its documentation page for more details on additional objects available to the environment installed to the baseline reduction function.

See Also

MSImageSet, pixelApply

Examples

Run this code
data <- generateImage(as="MSImageSet")
reduceBaseline(data, method="median", plot=interactive())

Run the code above in your browser using DataLab