OnDiscMSExperiment#

class pyopenms.OnDiscMSExperiment#

Bases: object

Representation of a mass spectrometry experiment on disk.

__init__() → None#
__init__(arg: pyopenms.OnDiscMSExperiment, /) → None

Methods

__init__()

empty()

Returns whether the experiment contains no spectra

findFirstRT(rt)

Index of the first spectrum with RT >= rt (size() if there is none); needs spectra sorted by RT

getChromatogram(id)

Returns a single chromatogram

getChromatogramById(id)

Returns a single chromatogram by its native ID string.

getChromatogramByNativeId(id)

Returns a single chromatogram

getExperimentalSettings()

Returns the meta information of this experiment (as shared pointer to ExperimentalSettings).

getMetaData()

Returns the meta data as a shared pointer to a PeakMap (MSExperiment).

getNrChromatograms()

Returns the total number of chromatograms available

getNrSpectra()

Returns the total number of spectra available

getOptions()

Returns the options for loading/storing

getSpectrum(id)

Returns a single spectrum

getSpectrumById(id)

Returns a single spectrum by its native ID string.

getSpectrumByNativeId(id)

Returns a single spectrum

getSpectrumMSLevel(id)

MS level of a spectrum, from the meta data (raises if the file was opened with skipMetaData)

getSpectrumMetadata(id)

Returns a single spectrum without peaks and data arrays (needs the meta data: raises if the file was opened with skipMetaData)

getSpectrumRT(id)

Retention time of a spectrum, from the meta data (raises if the file was opened with skipMetaData)

isSortedByRT()

Checks if all spectra are sorted with respect to ascending RT

openFile(filename[, skipMetaData])

Open a specific file on disk

setOptions(options)

Sets the options for loading/storing

setSkipXMLChecks(skip)

Sets whether to skip some XML checks and be fast instead

size()

Returns the number of spectra available

empty() → bool#

Returns whether the experiment contains no spectra

findFirstRT(rt: float) → int#

Index of the first spectrum with RT >= rt (size() if there is none); needs spectra sorted by RT

getChromatogram(id: int) → pyopenms.MSChromatogram#

Returns a single chromatogram

Parameters:

id – The index of the chromatogram

getChromatogramById(id: str) → pyopenms.MSChromatogram#

Returns a single chromatogram by its native ID string. This is an alias for getChromatogramByNativeId().

Parameters:

id – The native identifier of the chromatogram

getChromatogramByNativeId(id: str) → pyopenms.MSChromatogram#

Returns a single chromatogram

Parameters:

id – The native identifier of the chromatogram

getExperimentalSettings() → pyopenms.ExperimentalSettings#

Returns the meta information of this experiment (as shared pointer to ExperimentalSettings).

getMetaData() → pyopenms.MSExperiment#

Returns the meta data as a shared pointer to a PeakMap (MSExperiment).

The returned MSExperiment contains the meta data (spectra headers, chromatogram headers, experimental settings) but no actual peak data.

Returns:

Shared pointer to the meta data MSExperiment

getNrChromatograms() → int#

Returns the total number of chromatograms available

getNrSpectra() → int#

Returns the total number of spectra available

getOptions() → pyopenms.PeakFileOptions#

Returns the options for loading/storing

getSpectrum(id: int) → pyopenms.MSSpectrum#

Returns a single spectrum

Parameters:

id – The index of the spectrum

getSpectrumById(id: str) → pyopenms.MSSpectrum#

Returns a single spectrum by its native ID string. This is an alias for getSpectrumByNativeId().

Parameters:

id – The native identifier of the spectrum

getSpectrumByNativeId(id: str) → pyopenms.MSSpectrum#

Returns a single spectrum

Parameters:

id – The native identifier of the spectrum

getSpectrumMSLevel(id: int) → int#

MS level of a spectrum, from the meta data (raises if the file was opened with skipMetaData)

getSpectrumMetadata(id: int) → pyopenms.MSSpectrum#

Returns a single spectrum without peaks and data arrays (needs the meta data: raises if the file was opened with skipMetaData)

getSpectrumRT(id: int) → float#

Retention time of a spectrum, from the meta data (raises if the file was opened with skipMetaData)

isSortedByRT() → bool#

Checks if all spectra are sorted with respect to ascending RT

openFile(filename: str, skipMetaData: bool = False) → bool#

Open a specific file on disk

This tries to read the indexed mzML by parsing the index and then reading the meta information into memory

returns: Whether the parsing of the file was successful (if false, the file most likely was not an indexed mzML file)

setOptions(options: pyopenms.PeakFileOptions) → None#

Sets the options for loading/storing

setSkipXMLChecks(skip: bool) → None#

Sets whether to skip some XML checks and be fast instead

size() → int#

Returns the number of spectra available