MzMLSqliteHandler

class pyopenms.MzMLSqliteHandler

Bases: object

Cython implementation of _MzMLSqliteHandler

Original C++ documentation is available here

__init__()

Overload:

__init__(self, filename: Union[bytes, str, String], run_id: int) None

Overload:

__init__(self, in_0: MzMLSqliteHandler) None

Methods

__init__

Overload:

createTables(self)

Create data tables for a new file

getNrChromatograms(self)

Returns the number of chromatograms in the file

getNrSpectra(self)

Returns number of spectra in the file, reutrns the number of spectra

getRunID(self)

Extract the RUN ID from the sqMass file

getSpectraIndicesbyRT(self, RT, deltaRT, indices)

Returns spectral indices around a specific retention time

readChromatograms(self, exp, indices, meta_only)

Read a set of chromatograms (potentially restricted to a subset)

readExperiment(self, exp, meta_only)

Read an experiment into an MSExperiment structure

readSpectra(self, exp, indices, meta_only)

Read a set of spectra (potentially restricted to a subset)

setConfig(self, write_full_meta, ...)

Sets file configuration

writeChromatograms(self, chroms)

Writes a set of chromatograms to disk

writeExperiment(self, exp)

Write an MSExperiment to disk

writeRunLevelInformation(self, exp, ...)

Write the run-level information for an experiment into tables

writeSpectra(self, spectra)

Writes a set of spectra to disk

createTables(self) None

Create data tables for a new file

getNrChromatograms(self) int

Returns the number of chromatograms in the file

getNrSpectra(self) int

Returns number of spectra in the file, reutrns the number of spectra

getRunID(self) int

Extract the RUN ID from the sqMass file

getSpectraIndicesbyRT(self, RT: float, deltaRT: float, indices: List[int]) List[int]

Returns spectral indices around a specific retention time

Parameters
  • RT – The retention time

  • deltaRT – Tolerance window around RT (if less or equal than zero, only the first spectrum after RT is returned)

  • indices – Spectra to consider (if empty, all spectra are considered)

Returns

The indices of the spectra within RT +/- deltaRT

readChromatograms(self, exp: List[MSChromatogram], indices: List[int], meta_only: bool) None

Read a set of chromatograms (potentially restricted to a subset)

Parameters
  • exp – The result data structure

  • indices – A list of indices restricting the resulting spectra only to those specified here

  • meta_only – Only read the meta data

readExperiment(self, exp: MSExperiment, meta_only: bool) None

Read an experiment into an MSExperiment structure

Parameters
  • exp – The result data structure

  • meta_only – Only read the meta data

readSpectra(self, exp: List[MSSpectrum], indices: List[int], meta_only: bool) None

Read a set of spectra (potentially restricted to a subset)

Parameters
  • exp – The result data structure

  • indices – A list of indices restricting the resulting spectra only to those specified here

  • meta_only – Only read the meta data

setConfig(self, write_full_meta: bool, use_lossy_compression: bool, linear_abs_mass_acc: float) None

Sets file configuration

Parameters
  • write_full_meta – Whether to write a complete mzML meta data structure into the RUN_EXTRA field (allows complete recovery of the input file)

  • use_lossy_compression – Whether to use lossy compression (ms numpress)

  • linear_abs_mass_acc – Accepted loss in mass accuracy (absolute m/z, in Th)

writeChromatograms(self, chroms: List[MSChromatogram]) None

Writes a set of chromatograms to disk

writeExperiment(self, exp: MSExperiment) None

Write an MSExperiment to disk

writeRunLevelInformation(self, exp: MSExperiment, write_full_meta: bool) None

Write the run-level information for an experiment into tables

This is a low level function, do not call this function unless you know what you are doing

Parameters
  • exp – The result data structure

  • meta_only – Only read the meta data

writeSpectra(self, spectra: List[MSSpectrum]) None

Writes a set of spectra to disk