Main Content

msviewer

Explore mass spectrum or set of mass spectra

Description

msviewer(MZ, Intensities) displays the MS Viewer, which lets you view and explore a mass spectrum defined by MZ and Intensities.

The MS Viewer includes the following features:

  • Plot mass spectra. The spectra are plotted with different colors according to their group labels.

  • An overview displays a full spectrum, and a box indicates the region that is currently displayed in the main window.

  • Five different zoom in options, one zoom out option, and a reset view option resize the spectrum.

  • Add/focus/move/delete marker operations

  • Import/Export markers from/to MATLAB® workspace

  • Print and preview the spectra plot

  • Print the spectra plot to a MATLAB Figure window

MSViewer has five components:

  • Menu bar: File, Tools, Window, and Help

  • Toolbar: Move marker, Zoom XY, Zoom X, Zoom Y, Zoom out, Reset view, and Help

  • Main window: display the spectra

  • Overview window: display the overview of a full spectrum (the average of all spectra in display)

  • Marker control panel: a list of markers, Add Marker, Delete Marker, up and down buttons

example

msviewer(..., 'Markers', MarkersValue) specifies a list of marker positions from the mass/charge vector, MZ, for exploration and easy navigation. Enter a column vector with MZ values.

msviewer(..., 'Group', GroupValue) specifies a group to which the spectra belong. The groups are specified by GroupValue, a vector of values or cell array of character vectors or string vector. The number of values or character vectors or strings is the same as the number of rows in the matrix Intensities. Each value or character vector specifies a group to which the corresponding spectrum belongs. Spectra from the same group are plotted with the same color. Default is [1:numSpectra].

Examples

collapse all

This example shows how to plot mass spectra data.

Load and plot a sample mass spectra data.

load sample_lo_res
msviewer(MZ_lo_res, Y_lo_res)

Figure Mass Spectra Viewer contains an axes object and other objects of type uitoolbar, uipanel, uimenu. The axes object contains 2 objects of type patch, line.

Add a marker by pointing to a mass peak, right-clicking, and then clicking Add Marker.

The File menu has the following options.

  • Import Markers from Workspace - Opens the Import Markers From MATLAB® Workspace dialog. The dialog displays a list of double Mx1 or 1xM variables. If the selected variable is out of range, the viewer displays an error message.

  • Export Markers to Workspace - Opens the Export Markers to MATLAB® Workspace dialog. Enter a variable name for the markers. All markers are saved. If thre is no marker available, this menu item is disabled.

  • Print to Figure - Prints the spectra plot in the main display to a MATLAB® figure window.

The Tools menu has the following options.

  • Add Marker - Opens the Add Marker dialog where you can enter an m/z marker.

  • Delete Marker - Removes the currently selected m/z marker from the Markers (m/z) list.

  • Next Marker or Previous Marker - Moves the selection up and down the Markers list.

  • Zoom XY, Zoom X, Zoom Y, or Zoom Out - Changes the cursor from an arrow to a crosshair. Left-click and drag a rectangle box over an area and then release it. The display zooms the area covered by the box.

From the range window at the bottom, move the view box to a new location.

Input Arguments

collapse all

Column vector of common mass/charge (m/z) values for a set of spectra. The number of elements in the vector equals the number of rows in the matrix Intensities.

Matrix of 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 the number of elements in vector MZ.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | char | string | struct | table | cell | function_handle | categorical | datetime | duration | calendarDuration | fi
Complex Number Support: Yes

MZ Column vector of common mass/charge (m/z) values for a set of spectra. The number of elements in the vector equals the number of rows in the matrix Intensities.
Intensities Matrix of 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 the number of elements in vector MZ.
MarkersValueColumn vector to specify a list of marker positions from the mass/charge vector MZ.
GroupValue

Either of the following:

  • Vector of values with the same number of elements as rows in the matrix Intensities

  • Cell array of character vectors or string vector with the same number of elements as rows (spectra) in the matrix Intensities

Each value, character vector, or string specifies a group to which the corresponding spectrum belongs. Spectra from the same group are plotted with the same color. Default is [1:numSpectra].

Name-Value Arguments

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: msviewer(..., 'Markers', MarkersValue) specifies a list of marker positions from the mass/charge vector, MZ, for exploration and easy navigation. Enter a column vector with MZ values.

Column vector to specify a list of marker positions from the mass/charge vector, MZ, for exploration and easy navigation. Enter a column vector with MZ values.

Example: msviewer(..., 'Markers', MarkersValue)

msviewer(..., 'Group', GroupValue) specifies a group to which the spectra belong. The groups are specified by GroupValue, a vector of values or cell array of character vectors or string vector. The number of values or character vectors or strings is the same as the number of rows in the matrix Intensities. Each value or character vector specifies a group to which the corresponding spectrum belongs. Spectra from the same group are plotted with the same color. Default is [1:numSpectra].

Example: msviewer(..., 'Group', GroupValue )

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | char | string | struct | table | cell | function_handle | categorical | datetime | duration | calendarDuration | fi
Complex Number Support: Yes

Version History

Introduced before R2006a