OpenMS
MSDataSqlConsumer.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- 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 
15 namespace 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 
62  ~MSDataSqlConsumer() override;
63 
70  void flush();
71 
75  void consumeSpectrum(SpectrumType & s) override;
76 
81 
82  void setExpectedSize(Size /* expectedSpectra */, Size /* expectedChromatograms */) override;
83 
84  void setExperimentalSettings(const ExperimentalSettings& /* exp */) override;
85 
86  protected:
87 
90 
91  size_t flush_after_;
92  bool full_meta_;
93  std::vector<SpectrumType> spectra_;
94  std::vector<ChromatogramType> chromatograms_;
95 
97  };
98 
99 } //end namespace OpenMS
100 
101 
Description of the experimental settings.
Definition: ExperimentalSettings.h:36
The interface of a consumer of spectra and chromatograms.
Definition: IMSDataConsumer.h:44
Sqlite handler for storing spectra and chromatograms in sqMass format.
Definition: MzMLSqliteHandler.h:52
The representation of a chromatogram.
Definition: MSChromatogram.h:31
A data consumer that inserts MS data into a SQLite database.
Definition: MSDataSqlConsumer.h:36
std::vector< SpectrumType > spectra_
Definition: MSDataSqlConsumer.h:93
String filename_
Definition: MSDataSqlConsumer.h:88
std::vector< ChromatogramType > chromatograms_
Definition: MSDataSqlConsumer.h:94
OpenMS::Internal::MzMLSqliteHandler * handler_
Definition: MSDataSqlConsumer.h:89
~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:91
void consumeChromatogram(ChromatogramType &c) override
Write a chromatogram to the output file.
bool full_meta_
Definition: MSDataSqlConsumer.h:92
void setExpectedSize(Size, Size) override
Set expected size of spectra and chromatograms to be consumed.
MSExperiment peak_meta_
Definition: MSDataSqlConsumer.h:96
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:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
A more convenient string class.
Definition: String.h:34
OPENMS_UINT64_TYPE UInt64
Unsigned integer type (64bit)
Definition: Types.h:51
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
const double c
Definition: Constants.h:188
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22