Main Content

Smooth signal with peaks using nonparametric method

* Yout* = mslowess(

`X`

`Intensities`

mslowess(..., 'Order',

`OrderValue`

mslowess(..., 'Span',

`SpanValue`

mslowess(..., 'Kernel',

`KernelValue`

mslowess(..., 'RobustIterations',

`RobustIterationsValue`

mslowess(..., 'ShowPlot',

`ShowPlotValue`

`X` | Vector 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 .
The separation unit can quantify wavelength, frequency, distance,
time, or m/z depending on the instrument that generates the signal
data.`Intensities` |

`Intensities` | Matrix 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` |

**Tip**

Use the following syntaxes with data from any separation technique that produces signal data, such as spectroscopy, NMR, electrophoresis, chromatography, or mass spectrometry.

smooths
raw noisy signal data, * Yout* = mslowess(

`X`

`Intensities`

`Intensities`

`10`

samples.**Note**

`mslowess`

assumes the input vector, * X*,
may not have uniformly spaced separation units. Therefore, the sliding
window for smoothing is centered using the closest samples in terms
of the

`X`

`X`

**Note**

When the input vector, * X*, does not
have repeated values or NaN values, the algorithm is approximately
twice as fast.

`mslowess(`

calls * X*,

`Intensities`

`PropertyName`

`PropertyValue`

`mslowess`

with optional properties
that use property name/property value pairs. You can specify one or
more properties in any order. Each `PropertyName`

```
mslowess(..., 'Order',
```

specifies the order (* OrderValue*,
...)

`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`

. **Note**

Curve Fitting Toolbox™ software also refers to Lowess smoothing
of order `2`

as Loess smoothing.

`mslowess(..., 'Span', `

specifies the window size for the smoothing kernel.
If * SpanValue*,
...)

`SpanValue`

is greater
than `1`

, the window is equal to `SpanValue`

`X`

`10`

samples. Higher values
will smooth the signal more at the expense of computation time. If `SpanValue`

`1`

, the window size is taken to be a fraction
of the number of points in the data. For example, when `SpanValue`

`0.005`

,
the window size is equal to `0.50`

% of the number
of points in `X`

`mslowess(..., 'Kernel', `

selects the function specified by * KernelValue*,
...)

`KernelValue`

`KernelValue`

`'tricubic'`

(default) —`(1 - (dist/dmax).^3).^3`

`'gaussian'`

—`exp(-(2*dist/dmax).^2)`

`'linear'`

—`1-dist/dmax`

`mslowess(..., 'RobustIterations', `

specifies the number of iterations (* RobustIterationsValue*,
...)

`RobustValue`

)
for a robust fit. If `RobustIterationsValue`

`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.**Note**

For an * X* vector that has uniformly
spaced separation units, a nonrobust smoothing with

`OrderValue`

`0`

is equivalent to filtering the signal with
the kernel vector.

`mslowess(..., 'ShowPlot', `

plots the smoothed signal over the original signal.
When you call * ShowPlotValue*,
...)

`mslowess`

without output arguments,
the signals are plotted unless `ShowPlotValue`

`false`

.
When `ShowPlotValue`

`true`

,
only the first signal in `Intensities`

`ShowPlotValue`

`Intensities`

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

`load sample_lo_res`

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);`

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])

`mspalign`

| `msbackadj`

| `msdotplot`

| `msalign`

| `msheatmap`

| `mslowess`

| `msnorm`

| `mspeaks`

| `msresample`

| `msppresample`

| `mssgolay`

| `msviewer`

- Mass Spectrometry and Bioanalytics
- Preprocessing Raw Mass Spectrometry Data
- Visualizing and Preprocessing Hyphenated Mass Spectrometry Data Sets for Metabolite and Protein/Peptide Profiling
- Differential Analysis of Complex Protein and Metabolite Mixtures using Liquid Chromatography/Mass Spectrometry (LC/MS)