Main Content

mzxml2peaks

Convert mzXML structure to peak list

Syntax

[Peaklist,Times] = mzxml2peaks(mzXMLStruct)
[Peaklist,Times] = mzxml2peaks(mzXMLStruct, 'Levels',LevelsValue)

Input Arguments

mzXMLStruct

MATLAB®structure containing information from an mzXML file, such as one created by themzxmlreadfunction. It includes the fields shown in the table below.

LevelsValue

Positive integer or vector of integers that specifies the level(s) of spectra inmzXMLStructto convert, assuming the spectra are from tandem MS data sets. Default is1, which converts only the first-level spectra, that is, spectra containing precursor ions. SettingLevelsValueto2converts only the second-level spectra, which are the fragment spectra (created from a precursor ion).

Output Arguments

Peaklist Either of the following:
  • Two-column matrix, where the first column contains mass/charge (m/z) values and the second column contains ion intensity values.

  • 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.

Times 向量的保留时间与液体相关联chromatography/mass spectrometry (LC/MS) or gas chromatography/mass spectrometry (GC/MS) data set. The number of elements inTimesequals the number of elements inPeaklist.

Description

[Peaklist,Times] = mzxml2peaks(mzXMLStruct)extracts peak information frommzXMLStruct, a MATLAB structure containing information from an mzXML file, such as one created by themzxmlreadfunction, and createsPeaklist的单元阵列矩阵包含质量/电荷(m/z) values and ion intensity values, andTimes, a vector of retention times associated with a liquid chromatography/mass spectrometry (LC/MS) or gas chromatography/mass spectrometry (GC/MS) data set.mzXMLStructincludes the following fields:

Field Description
scan Structure array containing the data pertaining to each individual scan, such as mass spectrometry level, total ion current, polarity, precursor mass (when it applies), and the spectrum data.
index Structure containing indices to the positions of scan elements in the XML document.
mzXML

Structure containing:

  • Information in the root element of the mzXML schema, such as instrument details, experiment details, and preprocessing method

  • URLs pointing to schemas for the individual scans

  • Indexing approach

  • Digital signature calculated for the current instance of the document

[Peaklist,Times] = mzxml2peaks(mzXMLStruct, 'Levels',LevelsValue)specifies the level(s) of the spectra inmzXMLStructto convert, assuming the spectra are from tandem MS data sets. Default is1, which converts only the first-level spectra, that is, spectra containing precursor ions. SettingLevelsValueto2converts only the second-level spectra, which are the fragment spectra (created from a precursor ion).

Examples

Note

In the following example, the fileresults.mzxmlis not provided. Sample mzXML files can be found at:

  1. Use themzxmlreadfunction to read an mzXML file into the MATLAB software as structure. Then extract the peak information of only the first-level ions from the structure.

    mzxml_struct = mzxmlread('results.mzxml'); [peaks,time] = mzxml2peaks(mzxml_struct);
  2. Create a dot plot of the LC/MS data.

    msdotplot(peaks,time)
Introduced in R2007a