msbackadj

Correct the baseline of a mass spectrum

Syntax

Yout = msback(MZ, Y, 'PropertyName', PropertyValue...)
msbackadj(..., 'WindowSize', WindowSizeValue)
msbackadj(..., 'StepSize', StepSizeValue)
msbackadj(..., 'RegressionMethod', RegressionMethodValue)
msbackadj(..., 'EstimationMethod', EstimationMethodValue)
msbackadj(..., 'SmoothMethod', SmoothMethodValue)
msbackadj(..., 'QuantileValue', QuantileValueValue)
msbackadj(..., 'PreserveHeights', PreserveHeightsValue)
msbackadj(..., 'ShowPlot', ShowPlotValue)

Arguments

MZ

Mass/charge vector with the range of ions in the spectra.

Y

Ion intensity vector with the same length as the mass/charge vector (MZ). Y can also be a matrix with several spectra that share the same mass/charge (MZ) range.

Description

Yout = msback(MZ, Y, 'PropertyName', PropertyValue...) adjusts the variable baseline of a raw mass spectrum by following three steps:

  1. Estimates the baseline within multiple shifted windows of width 200 m/z

  2. Regresses the varying baseline to the window points using a spline approximation

  3. Adjusts the baseline of the spectrum (Y)

msbackadj(..., 'WindowSize', WindowSizeValue) specifies the width for the shifting window. WindowSizeValue can also be a function handler. The function is evaluated at the respective MZ values and returns a variable width for the windows. This option is useful for cases where the resolution of the signal is dissimilar at different regions of the spectrogram. The default value is 200 (baseline point estimated for windows with a width of 200 m/z).

msbackadj(..., 'StepSize', StepSizeValue)specifies the steps for the shifting window. The default value is 200 m/z (baseline point is estimated for windows placed every 200 m/z). StepSizeValue may also be a function handle. The function is evaluated at the respective m/z values and returns the distance between adjacent windows.

msbackadj(..., 'RegressionMethod', RegressionMethodValue) specifies the method to regress the window estimated points to a soft curve. Enter 'pchip' (shape-preserving piecewise cubic interpolation), 'linear'(linear interpolation), or 'spline'(spline interpolation). The default value is 'pchip'.

msbackadj(..., 'EstimationMethod', EstimationMethodValue) specifies the method for finding the likely baseline value in every window. Enter 'quantile' (quantile value is set to 10%) or 'em' (assumes a doubly stochastic model). With em, every sample is the independent and identically distributed (i.i.d.) draw of any of two normal distributed classes (background or peaks). Because the class label is hidden, the distributions are estimated with an Expectation-Maximization algorithm. The ultimate baseline value is the mean of the background class.

msbackadj(..., 'SmoothMethod', SmoothMethodValue) specifies the method for smoothing the curve of estimated points and eliminating the effects of possible outliers. Enter 'none', 'lowess' (linear fit), 'loess' (quadratic fit), 'rlowess' (robust linear), or 'rloess' ( robust quadratic fit). Default value is 'none'.

msbackadj(..., 'QuantileValue', QuantileValueValue) specifies the quantile value. The default value is 0.10.

msbackadj(..., 'PreserveHeights', PreserveHeightsValue), when PreserveHeightsValue is true, sets the baseline subtraction mode to preserve the height of the tallest peak in the signal. The default value is false and peak heights are not preserved.

msbackadj(..., 'ShowPlot', ShowPlotValue) plots the baseline estimated points, the regressed baseline, and the original spectrum. When msbackadj is called without output arguments, the spectra are plotted unless ShowPlotValue is false. When ShowPlotValue is true, only the first spectrum in Y is plotted. ShowPlotValue can also contain an index to one of the spectra in Y.

Example

  1. Load sample data.

    load sample_lo_res
  2. Adjust the baseline for a group of spectra and show only the third spectrum and its estimated background.

     YB = msbackadj(MZ_lo_res,Y_lo_res,'SHOWPLOT',3);
    



  3. Plot the estimated baseline for the fourth spectrum in Y_lo_res using an anonymous function to describe an m/z dependent parameter.

     wf = @(mz) 200 + .001 .* mz;
     msbackadj(MZ_lo_res,Y_lo_res(:,4),'STEPSIZE',wf);

See Also

The Bioinformatic Toolbox functions msalign, mslowess, msheatmap, msnorm, msresample, mssgolay, msviewer


© 1994-2005 The MathWorks, Inc.