OpenMS
Loading...
Searching...
No Matches
SqMassFile.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
15
16namespace OpenMS
17{
18
35 class OPENMS_DLLAPI SqMassFile
36 {
37public:
38
42 struct OPENMS_DLLAPI SqMassConfig
43 {
44 bool write_full_meta{true};
45 bool use_lossy_numpress{false};
46 double linear_fp_mass_acc{-1};
47 };
48
51
57
61
65
90 void load(const std::string& filename, MapType& map) const;
91
114 void store(const std::string& filename, const MapType& map) const;
115
150 void transform(const std::string& filename_in, Interfaces::IMSDataConsumer* consumer, bool skip_full_count = false, bool skip_first_pass = false) const;
151
182 void convertToXICParquet(const std::string& filename_in,
183 const std::string& xic_filename,
184 UInt64 run_id = 0,
185 const std::string& source_file = "",
187
193 void setConfig(const SqMassConfig& config)
194 {
195 config_ = config;
196 }
197
198 // maybe later ...
199 // static inline void readSpectrumFast(OpenSwath::BinaryDataArrayPtr data1,
200 // OpenSwath::BinaryDataArrayPtr data2, std::ifstream& ifs, int& ms_level,
201 // double& rt)
202
203 // static inline void readChromatogramFast(OpenSwath::BinaryDataArrayPtr data1,
204 // OpenSwath::BinaryDataArrayPtr data2, std::ifstream& ifs)
205
206protected:
208 };
209}
210
211
The interface of a consumer of spectra and chromatograms.
Definition IMSDataConsumer.h:46
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
Read and write mass-spectrometry data in the on-disk sqMass (SQLite) format.
Definition SqMassFile.h:36
void store(const std::string &filename, const MapType &map) const
Store an MSExperiment in sqMass format.
SqMassConfig config_
Definition SqMassFile.h:207
void setConfig(const SqMassConfig &config)
Replace the compression / metadata configuration used by subsequent load, store and transform calls.
Definition SqMassFile.h:193
void load(const std::string &filename, MapType &map) const
Read the contents of an sqMass file into an MSExperiment.
void transform(const std::string &filename_in, Interfaces::IMSDataConsumer *consumer, bool skip_full_count=false, bool skip_first_pass=false) const
Stream the spectra and chromatograms of an sqMass file through consumer.
SqMassFile()
Default constructor.
void convertToXICParquet(const std::string &filename_in, const std::string &xic_filename, UInt64 run_id=0, const std::string &source_file="", const OpenSwath::LightTargetedExperiment &transition_exp=OpenSwath::LightTargetedExperiment()) const
Convert an sqMass file containing chromatogram data to an XIC Parquet file.
MSExperiment MapType
Convenience alias used by load / store.
Definition SqMassFile.h:50
~SqMassFile()
Destructor.
Compression / metadata options used when reading or writing an sqMass file.
Definition SqMassFile.h:43
uint64_t UInt64
Unsigned integer type (64bit)
Definition Types.h:47
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition TransitionExperiment.h:369