mssgolay

Smooth mass spectrum with least-squares polynomial

Syntax

Yout = mssgolay(MZ,Y, 'PropertyName', PropertyValue...)
mssgolay(..., 'Span', SpanValue)
mssgolay(..., 'Degree', DegreeValue)
mssgolay(..., '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 = mssgolay(MZ,Y, 'PropertyName', PropertyValue...) smoothes a raw mass spectrum (Y) using a least squares digital polynomial filter (Savitzky and Golay filters). The default span or frame is 15 samples.

mssgolay(..., 'Span', SpanValue) modifies the frame size for the smoothing function. If SpanValue is greater than 1, the window is the size of SpanValue in samples independent of the MZ vector. Higher values will smooth the signal more with an increase in computation time. If SpanValue is less than 1, the window size is a fraction of the number of points in the data (MZ). For example, if SpanValue is 0.05, the window size is equal to 5% of the number of points in MZ.

mssgolay(..., 'Degree', DegreeValue) specifies the degree of the polynomial (DegreeValue) fitted to the points in the moving frame. The default value is 2. DegreeValue must be smaller than SpanValue.

mssgolay(..., 'ShowPlot', ShowPlotValue) plots smoothed spectra over the original. When mssgolay 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.

Examples

load sample_lo_res
YS = mssgolay(MZ_low_res, Y_low_res(:,1));
plot(MZ,[Y(:,1) YS])

See Also

Bioinformatic Toolbox functions msalign, msbackadj, msheatmap, mslowess, msnorm, , msresample, msviewer


© 1994-2005 The MathWorks, Inc.