MzMLFile

class pyopenms.MzMLFile

Bases: object

Cython implementation of _MzMLFile

Original C++ documentation is available here

– Inherits from [‘ProgressLogger’]

File adapter for MzML files

Provides methods to load and store MzML files. PeakFileOptions allow to load a reduced subset of the data into an MSExperiment.

See help(MSExperiment) how data is stored after loading. See help(PeakFileOptions) for available options.

Usage:

exp = MSExperiment()
MzMLFile().load("test.mzML", exp)
spec = []
for s in exp.getSpectra():
  if s.getMSLevel() != 1:
    spec.append(s)
exp.setSpectra(spec)
MzMLFile().store("filtered.mzML", exp)
__init__()

Overload:

__init__(self) None

Overload:

__init__(self, in_0: MzMLFile) None

Methods

__init__

Overload:

endProgress(self)

Ends the progress display

getLogType(self)

Returns the type of progress log being used

getOptions(self)

isSemanticallyValid(self, filename, errors, ...)

load(self, filename, in_1)

Loads from an MzML file.

loadBuffer(self, input, exp)

Loads a map from a MzML file stored in a buffer (in memory)

nextProgress(self)

Increment progress by 1 (according to range begin-end)

setLogType(self, in_0)

Sets the progress log that should be used.

setOptions(self, in_0)

Set PeakFileOptions to perform filtering during loading.

setProgress(self, value)

Sets the current progress

startProgress(self, begin, end, label)

store(self, filename, in_1)

Stores a MSExperiment in an MzML file

storeBuffer(self, output, exp)

Stores a map in an output string

transform

endProgress(self) None

Ends the progress display

getLogType(self) int

Returns the type of progress log being used

getOptions(self) PeakFileOptions
isSemanticallyValid(self, filename: Union[bytes, str, String], errors: List[bytes], warnings: List[bytes]) bool
load(self, filename: Union[bytes, str, String], in_1: MSExperiment) None

Loads from an MzML file. Spectra and chromatograms are sorted by default (this can be disabled using PeakFileOptions)

loadBuffer(self, input: Union[bytes, str, String], exp: MSExperiment) None

Loads a map from a MzML file stored in a buffer (in memory)

Parameters
  • buffer – The buffer with the data (i.e. string with content of an mzML file)

  • exp – Is an MSExperiment

Raises

Exception: ParseError is thrown if an error occurs during parsing

nextProgress(self) None

Increment progress by 1 (according to range begin-end)

setLogType(self, in_0: int) None

Sets the progress log that should be used. The default type is NONE!

setOptions(self, in_0: PeakFileOptions) None

Set PeakFileOptions to perform filtering during loading. E.g., to load only MS1 spectra or meta data only

setProgress(self, value: int) None

Sets the current progress

startProgress(self, begin: int, end: int, label: Union[bytes, str, String]) None
store(self, filename: Union[bytes, str, String], in_1: MSExperiment) None

Stores a MSExperiment in an MzML file

storeBuffer(self, output: String, exp: MSExperiment) None

Stores a map in an output string

Parameters
  • output – An empty string to store the result

  • exp – Has to be an MSExperiment

transform()