Pyteomics documentation v2.1.5

mzml - reader for mass spectrometry data in mzML format

«  fasta - manipulations with FASTA databases   ::   Contents   ::   mgf - read and write MS/MS data in Mascot Generic Format.  »

mzml - reader for mass spectrometry data in mzML format

Summary

mzML is a standard rich XML-format for raw mass spectrometry data storage. Please refer to http://www.psidev.info/index.php?q=node/257 for the detailed specification of the format and the structure of mzML files.

This module provides minimalistic infrastructure for access to data stored in mzML files. The most important function is read(), which reads spectra and related information as saves them into human-readable dicts. The rest of data can be obtained via a combination of get_node() and read_params() functions. These functions rely on the terminology of the underlying lxml library.

Data access

read() - iterate through spectra in mzML file. Data from a single spectrum are converted to a human-readable dict. Spectra themselves are stored under ‘m/z array’ and ‘intensity array’ keys.

version_info() - get version information about the mzML file

iterfind() - iterate over elements in the mzML file.


pyteomics.mzml.version_info(source, *args, **kwargs)

Provide version information about the mzML file.

pyteomics.mzml.iterfind(source, *args, **kwargs)

Parse source and yield info on elements with specified local name or by specified “XPath”. Only local names separated with slashes are accepted. An asterisk (*) means any element. You can specify a single condition in the end, such as: “/path/to/element[some_value>1.5]” Note: you can do much more powerful filtering using plain Python. The path can be absolute or “free”. Please don’t specify namespaces.

pyteomics.mzml.read(*args, **kwargs)[source]

Parse source and iterate through spectra.

Parameters :

source : str or file

A path to a target mzML file or the file object itself.

Returns :

out : iterator

An iterator over the dicts with spectra properties.

«  fasta - manipulations with FASTA databases   ::   Contents   ::   mgf - read and write MS/MS data in Mascot Generic Format.  »