baselineCorr: Baseline Correction

Description Usage Arguments Value Methods Author(s) References See Also Examples

View source: R/baselineCorr.R

Description

Offers three different methods for baseline correction of raw spectral data. Methods include monotone minimum, linear interpolation, and LOESS curve fitting.

Usage

1
baselineCorr(dat, mass_dat, intensity_dat, method = NULL, n = NULL)

Arguments

dat

The name of the spectral data frame, containing m/z data in the first column and spectral intensity data in subsequent columns.

mass_dat

Character string. The name of the column in dat containing the m/z data for the spectrum that will be corrected.

intensity_dat

Character string. The name of the column in dat containing the intensity data for the spectrum to be baseline corrected.

method

Character string. The method that is to be used to perform the baseline correction. Either "monotone" for monotone minimum correction, "linear" for linear interpolation, or "loess" for LOESS curve fitting.

n

Single odd numeric value. If method = "linear", the size of the window that should be used for linear interpolation of the spectral baseline.

Value

Returns a new data frame containing the baseline corrected spectral data.

Methods

monotone_min

Identifies valleys in the spectrum by evaluating the slopes between adjacent intensity values. Moving from left to right, if slope of point A is greater than 0, the nearest point B with slope of less than 0 is located. Points in between A and B are recorded as potential peaks. If slope of A < 0, nearest point B with slope > 0 is located. Points between A and B are recorded as valleys. Each intensity value in the spectrum is then subtracted by the intensity of the nearest valley, correcting any irregularities in the baseline of the data.

linear

Divides a spectrum into small segments and evaluates the mean of points in each segment as a valley (1). A baseline is then generated by linearly interpolating valleys across all small segments. In each segment, the intensity of each peak is subtracted by the intensity of the valley in that segment.

loess

Divides a spectrum into small segments and evaluates the quantile in each segment. The baseline is estimated as follows. If the intensity of point A in a segment is less than the quantile, the intensity of point A is recorded as a baseline predictor for that point. If the intensity of point A is greater than or equal to the quantile in the segment, the quantile for the segment is recorded the baseline predictor for that point. Local polynomial regression fitting is applied to the predictor points. The baseline is then subtracted from the raw spectral signal.

Author(s)

Kristen Yeh <kristenyeh@trentu.ca> Wesley Burr <wesleyburr@trentu.ca>

References

https://github.com/wesleyburr/subMaldi (1) Yang, C., He, Z. & Yu, W. Comparison of public peak detection algorithms for MALDI mass spectrometry data analysis. BMC Bioinformatics 10, 4 (2009). https://doi.org/10.1186/1471-2105-10-4

See Also

smoothSpectrum, peakDet

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Load sample dataset "bsline"
data("bsline")

## Correct the baseline using the monotone minimum method
bsline_mono <- baselineCorr(bsline, "mass", "raw", 
                      method = "monotone_min")

## Correct the baseline using the linear interpolation method
## Window size of 7
bsline_linear <- baselineCorr(bsline, "mass", "raw", 
                      method = "linear", n = 7)

wesleyburr/subMaldi documentation built on Oct. 1, 2021, 7:07 a.m.