| Bioinformatics Toolbox™ | ![]() |
[MZ, Intensities]
= msppresample(Peaks, N)
[MZ, Intensities]
= msppresample(Peaks, N,
...'Range', RangeValue, ...)
[MZ, Intensities]
= msppresample(Peaks, N,
...'FWHH', FWHHValue, ...)
[MZ, Intensities]
= msppresample(Peaks, N,
...'ShowPlot', ShowPlotValue, ...)
| Peaks | Either of the following:
| |
| N | Integer specifying the number of equally spaced points (m/z values) in the resampled signal. | |
| RangeValue | 1-by-2 vector specifying the minimum and maximum m/z values for the output matrix Intensities. RangeValue must be within [min(inputMZ) max(inputMZ)], where inputMZ is the concatenated m/z values from the input Peaks. Default is the full range [min(inputMZ) max(inputMZ)]. | |
| FWHHValue | Value that specifies the full width at half height (FWHH) in m/z units. The FWHH is used to convert each peak to a Gaussian shaped curve. Default is median(diff(inputMZ))/2, where inputMZ is the concatenated m/z values from the input Peaks. The default is a rough approximation of resolution observed in the input data, Peaks. | |
| ShowPlotValue | Controls the display of a plot of an
original and resampled spectrum. Choices are true, false,
or I, an integer specifying the index of
a spectrum in Intensities. If set to true,
the first spectrum in Intensities is plotted.
Default is:
|
| MZ | Vector of equally spaced, common mass/charge (m/z) values for a set of spectra. The number of elements in the vector equals N or the number of rows in matrix Intensities. |
| Intensities | Matrix of reconstructed intensity values for a set of mass spectra that share the same mass/charge (m/z) range. Each row corresponds to an m/z value, and each column corresponds to a spectrum or retention time. The number of rows equals N or the number of elements in vector MZ. |
[MZ, Intensities] = msppresample(Peaks, N) resamples Peaks, a mass spectrometry peak list, by converting centroided peaks to a semicontinuous, raw signal that preserves peak information. The resampled signal has N equally spaced points. Output MZ is a vector of N elements specifying the equally spaced, common m/z values for the spectra. Output Intensities is a matrix of reconstructed intensity values for a set of mass spectra that share the same m/z range. Each row corresponds to an m/z value, and each column corresponds to a spectrum or retention time. The number of rows equals N.
msppresample uses a Gaussian kernel to reconstruct the signal. The ion intensity at any given m/z value is taken from the maximum intensity of any contributing (overlapping) peaks.
Tip msppresample is useful to prepare a set of spectra for imaging functions such as msheatmap and preprocessing functions such as msbackadj and msnorm. |
[MZ, Intensities] = msppresample(Peaks, N, ... 'PropertyName', PropertyValue, ...) calls msppresample 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:
[MZ, Intensities]
= msppresample(Peaks, N,
...'Range', RangeValue, ...) specifies
an m/z range for the output matrix Intensities using
the minimum and maximum m/z values specified in the 1-by-2 vector RangeValue. RangeValue must
be within [min(inputMZ) max(inputMZ)],
where inputMZ is the concatenated m/z values
from the input Peaks. Default is the full
range [min(inputMZ) max(inputMZ)]
[MZ, Intensities] = msppresample(Peaks, N, ...'FWHH', FWHHValue, ...) sets the full width at half height (FWHH) in m/z units. The FWHH is used to convert each peak to a Gaussian shaped curve. Default is median(diff(inputMZ))/2, where inputMZ is the concatenated m/z values from the input Peaks. The default is a rough approximation of resolution observed in the input data, Peaks.
Tip To ensure that the resolution of the peaks is preserved, set FWHHValue to half the distance between the two peaks of interest that are closest to each other. |
[MZ, Intensities] = msppresample(Peaks, N, ...'ShowPlot', ShowPlotValue, ...) controls the display of a plot of an original and resampled spectrum. Choices are true, false, or I, an integer specifying the index of a spectrum in Intensities. If set to true, the first spectrum in Intensities is plotted. Default is:
false — When return values are specified.
true — When return values are not specified.
Load a MAT-file, included with the Bioinformatics Toolbox software, which contains liquid chromatography/mass spectrometry (LC/MS) data variables, including peaks, a cell array of peak lists, where each element is a two-column matrix of m/z values and ion intensity values, and each element corresponds to a spectrum or retention time.
load lcmsdata
Resample the data, specifying 5000 m/z values in the resampled signal. Then create a heat map of the LC/MS data.
[MZ,Y] = msppresample(peaks,5000); msheatmap(MZ,ret_time,log(Y))

Plot the reconstructed profile spectra between two retention times.
figure
t1 = 3370;
t2 = 3390;
h = find(ret_time>t1 & ret_time<t2);
[MZ,Y] = msppresample(peaks(h),10000);
plot3(repmat(MZ,1,numel(h)),repmat(ret_time(h)',10000,1),Y)
xlabel('Mass/Charge (M/Z)')
ylabel('Retention Time')
zlabel('Relative Intensity')

Resample the data to plot the Total Ion Chromatogram (TIC).
figure
[MZ,Y] = msppresample(peaks,5000);
plot(ret_time,sum(Y))
title('Total Ion Chromatogram (TIC)')
xlabel('Retention Time')
ylabel('Relative Intensity')

Resample the data to plot the Extracted Ion Chromatogram (XIC) in the 450 to 500 m/z range.
figure
[MZ,Y] = msppresample(peaks,5000,'Range',[450 500]);
plot(ret_time,sum(Y))
title('Extracted Ion Chromatogram (XIC) from 450 to 500 M/Z')
xlabel('Retention Time')
ylabel('Relative Intensity')

Bioinformatics Toolbox functions: msdotplot, mspeaks, mspalign, msresample, mzcdf2peaks, mzcdfread, mzxml2peaks, mzxmlread
![]() | mspeaks | msresample | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |