Products & Services Solutions Academia Support User Community Company

Learn more about Bioinformatics Toolbox   

mslowess - Smooth signal with peaks using nonparametric method

Syntax

Yout = mslowess(X, Intensities)

mslowess(..., 'Order', OrderValue, ...)
mslowess(..., 'Span', SpanValue, ...)
mslowess(..., 'Kernel', KernelValue, ...)
mslowess(..., 'RobustIterations', RobustIterationsValue, ...)
mslowess(..., 'ShowPlot', ShowPlotValue, ...)

Arguments

XVector of separation-unit values for a set of signals with peaks. The number of elements in the vector equals the number of rows in the matrix Intensities. The separation unit can quantify wavelength, frequency, distance, time, or m/z depending on the instrument that generates the signal data.
IntensitiesMatrix of intensity values for a set of peaks that share the same separation-unit range. Each row corresponds to a separation-unit value, and each column corresponds to either a set of signals with peaks or a retention time. The number of rows equals the number of elements in vector X.

Description

Yout = mslowess(X, Intensities) smooths raw noisy signal data, Intensities, using a locally weighted linear regression (Lowess) method with a default span of 10 samples.

mslowess(X, Intensities, ...'PropertyName', PropertyValue, ...) calls mslowess with optional properties that use property name/property value pairs. You can specify one or more properties in any order. Each PropertyName must be enclosed in single quotation marks and is case insensitive. These property name/property value pairs are as follows:


mslowess(..., 'Order', OrderValue, ...)
specifies the order (OrderValue) of the Lowess smoother. Enter 1 (linear polynomial fit or Lowess), 2 (quadratic polynomial fit or Loess), or 0 (equivalent to a weighted local mean estimator and presumably faster because only a mean computation is performed instead of a least-squares regression). The default value is 1.

mslowess(..., 'Span', SpanValue, ...) specifies the window size for the smoothing kernel. If SpanValue is greater than 1, the window is equal to SpanValue number of samples independent of the separation-unit vector, X. The default value is 10 samples. Higher values will smooth the signal more at the expense of computation time. If SpanValue is less than 1, the window size is taken to be a fraction of the number of points in the data. For example, when SpanValue is 0.005, the window size is equal to 0.50% of the number of points in X.

mslowess(..., 'Kernel', KernelValue, ...) selects the function specified by KernelValue for weighting the observed intensities. Samples close to the separation-unit location being smoothed have the most weight in determining the estimate. KernelValue can be any of the following strings:

mslowess(..., 'RobustIterations', RobustIterationsValue, ...) specifies the number of iterations (RobustValue) for a robust fit. If RobustIterationsValue is 0 (default), no robust fit is performed. For robust smoothing, small residual values at every span are outweighed to improve the new estimate. 1 or 2 robust iterations are usually adequate, while larger values might be computationally expensive.

mslowess(..., 'ShowPlot', ShowPlotValue, ...) plots the smoothed signal over the original signal. When you call mslowess without output arguments, the signals are plotted unless ShowPlotValue is false. When ShowPlotValue is true, only the first signal in Intensities is plotted. ShowPlotValue can also contain an index to one of the signals in Intensities.

Examples

  1. Load a MAT-file, included with the Bioinformatics Toolbox software, that contains some sample data.

    load sample_lo_res
  2. Smooth the spectra and draw a figure of the first spectrum with original and smoothed signals.

    YS = mslowess(MZ_lo_res,Y_lo_res,'Showplot',true);

  3. Zoom in on a region of the figure to see the difference in the original and smoothed signals.

    axis([7350 7550 0.1 1.0])

See Also

Bioinformatics Toolbox functions: msalign, msbackadj, msheatmap, msnorm, mspeaks, msresample, mssgolay, msviewer

Bioinformatics Toolbox demo:

Preprocessing Raw Mass Spectrometry Data
  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS