Main Content

msheatmap

Create pseudocolor image of set of mass spectra

Description

msheatmap(MZ,Intensities) displays a pseudocolor heatmap image of the intensities for the spectra in the Intensities matrix.

example

msheatmap(MZ,Times,Intensities) displays a pseudocolor heatmap image of the intensities for the spectra in matrix Intensities, using the retention times in the Times vector to label the y-axis.

example

msheatmap(___,Name=Value) specifies additional options using one or more name-value arguments.

example

Examples

collapse all

Load the SELDI-TOF sample data provided with the software.

load sample_lo_res

Create a vector of four m/z values to mark along the top horizontal axis of the heatmap.

M = [3991.4 4598 7964 9160];

Display the heat map with m/z markers and a limited m/z range.

msheatmap(MZ_lo_res,Y_lo_res,Markers=M,Range=[3000 10000]);

Figure contains an axes object. The axes object with xlabel Mass/Charge (M/Z), ylabel Spectrogram Indices contains an object of type image.

Display the heat map again grouping each spectrum into one of two groups.

TwoGroups = [1 1 2 2 1 1 2 2];
msheatmap(MZ_lo_res,Y_lo_res,Markers=M,Group=TwoGroups);

Figure contains an axes object. The axes object with xlabel Mass/Charge (M/Z), ylabel Spectrogram Groups contains 2 objects of type image, line.

Load the LC/MS sample data provided with the software.

load lcmsdata

Resample the peak lists to create a vector of m/z values and a matrix of intensity values.

[MZ,Intensities] = msppresample(ms_peaks,5000);

Display the heat map showing mass spectra at different retention times.

msheatmap(MZ,ret_time,log(Intensities));

Figure contains an axes object. The axes object with xlabel Mass/Charge (M/Z), ylabel Retention Time contains an object of type image.

Input Arguments

collapse all

Common mass/charge (m/z) values for a set of spectra, specified as a numeric column vector.

The number of elements in the vector equals the number of rows in the Intensities matrix.

You can use msppresample to create the MZ vector.

Data Types: double

Retention times associated with a liquid chromatography mass spectrometry (LC/MS) or gas chromatography/mass spectrometry (GC/MS) data set, specified as a numeric column vector.

The number of elements in the vector equals the number of columns in the Intensities matrix. The retention times are used to label the y-axis of the heatmap.

You can use mzxml2peaks to create the Times vector.

Data Types: double

Intensity values for set of mass spectra that share the same m/z range, specified as a numeric matrix.

Each row corresponds to an m/z value, and each column corresponds to a spectrum or retention time. The number of rows equals the number of elements in the MZ vector. The number of columns equals the number of elements in the Times vector.

You can use msppresample to create the Intensities matrix.

Data Types: double

Name-Value Arguments

collapse all

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: msheatmap(MZ,Intensities,Resolution=0.05)

Quantile of the ion intensity values to fall below the midpoint of the colormap to mean they do not represent peaks, specified as a numeric value ≥ 0 and ≤ 1.

The default value is as follows:

  • 0.99 — For LC/MS or GC/MS data or when input T is provided. The default value means that 1% of the pixels are warm colors and represent peaks.

  • 0.95 — For non-LC/MS or non-GC/MS data or when input T is not provided. The default value means that 5% of the pixels are warm colors and represent peaks.

Tip

You can also change the midpoint interactively after creating the heatmap by right-clicking the color bar, selecting Interactive Colormap Shift, and then click-dragging the cursor vertically on the color bar. This technique is useful when comparing multiple heatmaps.

Data Types: double

M/Z range for the x-axis of the heatmap, specified as a 1-by-2 numeric vector.

The range value must be within [min(MZ) max(MZ)]

Data Types: double

M/Z values to mark on the top horizontal axis of the heatmap, specified as a numeric vector.

Data Types: double

Labels for spectra, specified as a numeric vector, string vector, or cell array of character vectors. Each numeric value, character vector, or string specifies a label for the corresponding spectrum. The values label the y-axis of the heatmap.

The numeric vector, string vector, or cell array must have the same number of elements as columns (spectra) in the Intensities matrix.

Note

If input Times is provided, it is assumed that Intensities contains LC/MS or GC/MS data, and SpecIdx is ignored.

Data Types: double | strings | cell

Grouping labels for spectra, specified as a numeric vector, string vector, or cell array of character vectors. The default value is [1:numSpectra], where numSpectra is the total number of spectra.

Each numeric value, character vector, or string specifies a group to which the corresponding spectrum belongs. The spectra are sorted and combined into groups along the y-axis in the heatmap. The number of numeric values, character vectors, or strings is the same as the number of rows in the Intensities matrix.

Data Types: double | strings | cell

Horizontal resolution of the heatmap image, specified as a positive scalar. If MZ contains greater than 2500 elements, the default resolution value is 0.5. Otherwise, the value is 0.05.

Increase this value to enhance the details of the heatmap. Decrease this value to reduce memory usage.

Data Types: double

Version History

Introduced before R2006a