OpenMS
Loading...
Searching...
No Matches
BrukerTimsFile.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#pragma once
5
6#include <OpenMS/config.h>
7
8#ifdef WITH_OPENTIMS
9
14#include <cstdint>
15#include <limits>
16#include <memory>
17#include <string>
18
19class TimsDataHandle;
20
21namespace OpenMS
22{
23 class FullSwathFileConsumer;
24
57 class OPENMS_DLLAPI BrukerTimsFile : public ProgressLogger
58 {
59 public:
61 struct Config
62 {
63 double calibration_tolerance = 0.0;
64 bool calibrate = false;
65
66 bool load_ms1 = true;
69
100 uint32_t frame_id_min = 0;
101 uint32_t frame_id_max = std::numeric_limits<uint32_t>::max();
102
110 double rt_min_sec = 0.0;
111 double rt_max_sec = std::numeric_limits<double>::infinity();
112
124 enum class CentroidAlgo { OFF, GREEDY2D, HILL_BASED };
125
129 CentroidAlgo ms1_centroid_algo = CentroidAlgo::OFF;
130
146 CentroidAlgo ms2_centroid_algo = CentroidAlgo::OFF;
147
148 float ms1_centroid_mz_ppm = 10.0f;
149 float ms1_centroid_im_pct = 0.0f;
150 int ms1_centroid_max_peaks = 100000;
151
152 float ms2_centroid_mz_ppm = 20.0f;
153 double centroid_valley_factor = 1.3;
154 Size ms1_centroid_min_hill_length = 1;
155 Size ms2_centroid_min_hill_length = 2;
156 Size centroid_max_scan_gap = 0;
157 bool expose_hill_bounds = false;
158
168 bool isotopic_prefilter = false;
169 double isotopic_prefilter_tol_ppm = 50.0;
170
171 int dia_ms2_n_neighbors = 0;
172 int dia_ms2_min_support = 1;
173 bool dia_ms2_centroid = false;
174
175 int ms1_n_neighbors = 0;
178 int ms1_min_support = 0;
182 double ms1_max_rt_distance_sec = 0.0;
187
188 enum ExportMode { AUTO, SPECTRUM, FRAME };
189 ExportMode export_mode = AUTO;
190
193 enum class TimsCalibrationStrategy { AUTO, BRUKER_SDK, RATIONAL, LINEAR };
194 TimsCalibrationStrategy tims_calibration_strategy = TimsCalibrationStrategy::AUTO;
195
199 enum class PressureCompensation { NONE, GLOBAL, PER_FRAME };
200 PressureCompensation pressure_compensation = PressureCompensation::NONE;
201
204 std::string bruker_sdk_path;
205 };
206
208 struct DIAStreamingMetadata
209 {
210 std::vector<OpenSwath::SwathMap> boundaries;
211 int nr_ms1_spectra = 0;
212 std::vector<int> nr_ms2_spectra;
213 };
214
217 DIAStreamingMetadata readDIAMetadata(const std::string& path, ExperimentalSettings& exp_settings);
219 DIAStreamingMetadata readDIAMetadata(const std::string& path, ExperimentalSettings& exp_settings,
220 const Config& config);
221
225 void loadDIAStreaming(const std::string& path, FullSwathFileConsumer& consumer);
227 void loadDIAStreaming(const std::string& path, FullSwathFileConsumer& consumer,
228 const Config& config);
229
231 void load(const std::string& path, MSExperiment& exp);
233 void load(const std::string& path, MSExperiment& exp, const Config& config);
234
238 void transform(const std::string& path, Interfaces::IMSDataConsumer* consumer);
240 void transform(const std::string& path, Interfaces::IMSDataConsumer* consumer, const Config& config);
241
242 private:
244 void loadDDA_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
245
247 void loadDIA_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
248
250 void loadFrames_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
251
253 bool isDIA_(const std::string& tdf_path) const;
254
257 void loadExperimentalSettings_(const std::string& path, const std::string& d_path, ExperimentalSettings& settings);
258
260 struct UnpackedArchive;
261
263 static std::shared_ptr<UnpackedArchive> unpack_(const std::string& path);
264
267 std::shared_ptr<UnpackedArchive> takeUnpacked_(const std::string& path);
268
270 std::shared_ptr<UnpackedArchive> unpacked_;
271 };
272
273} // namespace OpenMS
274
275#endif // WITH_OPENTIMS
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