Main Content

mzxml2peaks

R2026b

Convert mzXML structure to peak list

Description

[PeakList,Times] = mzxml2peaks(mzXMLStruct) extracts peak information from mzXMLStruct, a structure containing information from an mzXML file and returns mass/charge (m/z) values and ion intensity values PeakList and retention times Times from a liquid chromatography/mass spectrometry (LC/MS) or gas chromatography/mass spectrometry (GC/MS) data set.

example

[PeakList,Times] = mzxml2peaks(mzXMLStruct,Levels=lvlValue) specifies the levels of the spectra in mzXMLStruct to convert, assuming the spectra are from tandem MS data sets.

Examples

collapse all

Suppose you have an mzXML file named results.mzxml. Extract the peak information of only the first-level ions from the structure.

mzxml_struct = mzxmlread('results.mzxml');
[peaks,time] = mzxml2peaks(mzxml_struct);

Create a dot plot of the LC/MS data.

msdotplot(peaks,time);

Input Arguments

collapse all

mzXML information, specified as a structure containing information from an mzXML file. You can create such a file using the mzxmlread function.

mzXMLStruct includes the following fields:

FieldDescription
scanStructure 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.
indexStructure 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

Levels of spectra in the input structure to convert, specified as positive integer or vector of integers. The default value is 1, which converts only the first-level spectra, that is, spectra containing precursor ions. Setting lvlValue to 2 converts only the second-level spectra, which are the fragment spectra (created from a precursor ion).

Output Arguments

collapse all

Mass/charge (m/z) and ion intensity values, returned as a two-column matrix or cell array of peak lists.

If it is a two-column matrix, the first column contains mass/charge (m/z) values and the second column contains ion intensity values.

If it is a cell array, 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.

Data Types: double | cell

Retention times associated with a liquid chromatography/mass spectrometry (LC/MS) or gas chromatography/mass spectrometry (GC/MS) data set, returned as a numeric vector. The number of elements in Times equals the number of elements in PeakList.

Version History

Introduced in R2007a