OpenMS
2.7.0
|
A data consumer that inserts MS data into a SQLite database. More...
#include <OpenMS/FORMAT/DATAACCESS/MSDataSqlConsumer.h>
Public Member Functions | |
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. More... | |
~MSDataSqlConsumer () override | |
Destructor. More... | |
void | flush () |
Flushes the data for good. More... | |
void | consumeSpectrum (SpectrumType &s) override |
Write a spectrum to the output file. More... | |
void | consumeChromatogram (ChromatogramType &c) override |
Write a chromatogram to the output file. More... | |
void | setExpectedSize (Size, Size) override |
Set expected size of spectra and chromatograms to be consumed. More... | |
void | setExperimentalSettings (const ExperimentalSettings &) override |
Set experimental settings (meta-data) of the data to be consumed. More... | |
Public Member Functions inherited from IMSDataConsumer | |
virtual | ~IMSDataConsumer () |
Protected Attributes | |
String | filename_ |
OpenMS::Internal::MzMLSqliteHandler * | handler_ |
size_t | flush_after_ |
bool | full_meta_ |
std::vector< SpectrumType > | spectra_ |
std::vector< ChromatogramType > | chromatograms_ |
MSExperiment | peak_meta_ |
Private Types | |
typedef MSExperiment | MapType |
typedef MapType::SpectrumType | SpectrumType |
typedef MapType::ChromatogramType | ChromatogramType |
Additional Inherited Members | |
Public Types inherited from IMSDataConsumer | |
typedef MSSpectrum | SpectrumType |
typedef MSChromatogram | ChromatogramType |
A data consumer that inserts MS data into a SQLite database.
Consumes spectra and chromatograms and inserts them into an file-based SQL database using SQLite. As SQLite is highly inefficient when inserting one spectrum/chromatogram at a time, the consumer collects the data in an internal buffer and then flushes them all together to disk.
It uses MzMLSqliteHandler internally to write batches of data to disk.
|
private |
|
private |
|
private |
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.
Opens the SQLite file and writes the tables.
filename | The filename of the SQLite database |
run_id | Unique identifier which links the sqMass and OSW file |
buffer_size | How large the internal buffer size should be (defaults to 500 spectra / chromatograms) |
full_meta | Whether to write the full meta-data in the SQLite header |
lossy_compression | Whether to use lossy compression (numpress) |
linear_mass_acc | Desired mass accuracy for RT or m/z space (absolute value) |
|
override |
Destructor.
Flushes the data for good.
|
overridevirtual |
Write a chromatogram to the output file.
Implements IMSDataConsumer.
|
overridevirtual |
Write a spectrum to the output file.
Implements IMSDataConsumer.
void flush | ( | ) |
Flushes the data for good.
After calling this function, no more data is held in the buffer but the class is still able to receive new data.
Set expected size of spectra and chromatograms to be consumed.
Some implementations might care about the number of spectra and chromatograms to be consumed and need to be informed about this (usually before consuming starts).
expectedSpectra | Number of spectra expected |
expectedChromatograms | Number of chromatograms expected |
Implements IMSDataConsumer.
|
overridevirtual |
Set experimental settings (meta-data) of the data to be consumed.
Some implementations might need to know about the meta-data (or the context) of the spectra and chromatograms to be consumed. This method allows them learn this.
exp | Experimental settings meta data for the data to be consumed |
Implements IMSDataConsumer.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |