OpenMS
Loading...
Searching...
No Matches
MSDataSqlConsumer.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Hannes Roest $
6// $Authors: Hannes Roest $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12
14
15namespace OpenMS
16{
17
18 namespace Internal
19 {
20 class MzMLSqliteHandler;
21 }
22
34 class OPENMS_DLLAPI MSDataSqlConsumer :
36 {
40
41 public:
42
55 MSDataSqlConsumer(const String& sql_filename, UInt64 run_id, int buffer_size = 500, bool full_meta = true, bool lossy_compression=false, double linear_mass_acc=1e-4);
56
63
70 void flush();
71
73 void addRun(const String& filename, const UInt64 run_id);
75 void setRunId(const UInt64 run_id);
76
80 void consumeSpectrum(SpectrumType & s) override;
81
86
87 void setExpectedSize(Size /* expectedSpectra */, Size /* expectedChromatograms */) override;
88
89 void setExperimentalSettings(const ExperimentalSettings& /* exp */) override;
90
91 protected:
92
95
98 std::vector<SpectrumType> spectra_;
99 std::vector<ChromatogramType> chromatograms_;
100
102 bool wrote_any_run_ = false;
103 };
104
105} //end namespace OpenMS
106
107
Description of the experimental settings.
Definition ExperimentalSettings.h:36
The interface of a consumer of spectra and chromatograms.
Definition IMSDataConsumer.h:46
Sqlite handler for storing spectra and chromatograms in sqMass format.
Definition MzMLSqliteHandler.h:52
The representation of a chromatogram.
Definition MSChromatogram.h:30
A data consumer that inserts MS data into a SQLite database.
Definition MSDataSqlConsumer.h:36
std::vector< SpectrumType > spectra_
Definition MSDataSqlConsumer.h:98
String filename_
Definition MSDataSqlConsumer.h:93
std::vector< ChromatogramType > chromatograms_
Definition MSDataSqlConsumer.h:99
OpenMS::Internal::MzMLSqliteHandler * handler_
Definition MSDataSqlConsumer.h:94
~MSDataSqlConsumer() override
Destructor.
MapType::ChromatogramType ChromatogramType
Definition MSDataSqlConsumer.h:39
MSDataSqlConsumer(const String &sql_filename, UInt64 run_id, int buffer_size=500, bool full_meta=true, bool lossy_compression=false, double linear_mass_acc=1e-4)
Constructor.
void setExperimentalSettings(const ExperimentalSettings &) override
Set experimental settings (meta-data) of the data to be consumed.
size_t flush_after_
Definition MSDataSqlConsumer.h:96
void consumeChromatogram(ChromatogramType &c) override
Write a chromatogram to the output file.
void setRunId(const UInt64 run_id)
Change the current run id used for subsequent chromatogram/spectrum writes.
bool full_meta_
Definition MSDataSqlConsumer.h:97
void setExpectedSize(Size, Size) override
Set expected size of spectra and chromatograms to be consumed.
void addRun(const String &filename, const UInt64 run_id)
Add/insert a RUN entry into the sqMass file (ID and filename)
MSExperiment peak_meta_
Definition MSDataSqlConsumer.h:101
void consumeSpectrum(SpectrumType &s) override
Write a spectrum to the output file.
void flush()
Flushes the data for good.
MapType::SpectrumType SpectrumType
Definition MSDataSqlConsumer.h:38
MSExperiment MapType
Definition MSDataSqlConsumer.h:37
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
A more convenient string class.
Definition String.h:34
uint64_t UInt64
Unsigned integer type (64bit)
Definition Types.h:47
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition Types.h:97
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19