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;
67
68 bool load_ms1 = true;
71
102 uint32_t frame_id_min = 0;
103 uint32_t frame_id_max = std::numeric_limits<uint32_t>::max();
104
112 double rt_min_sec = 0.0;
113 double rt_max_sec = std::numeric_limits<double>::infinity();
114
126 enum class CentroidAlgo { OFF, GREEDY2D, HILL_BASED };
127
131 CentroidAlgo ms1_centroid_algo = CentroidAlgo::OFF;
132
149 CentroidAlgo ms2_centroid_algo = CentroidAlgo::OFF;
150
151 float ms1_centroid_mz_ppm = 10.0f;
152 float ms1_centroid_im_pct = 0.0f;
153 int ms1_centroid_max_peaks = 100000;
154
155 float ms2_centroid_mz_ppm = 20.0f;
156 double centroid_valley_factor = 1.3;
157 Size ms1_centroid_min_hill_length = 1;
158 Size ms2_centroid_min_hill_length = 2;
159 Size centroid_max_scan_gap = 0;
160 bool expose_hill_bounds = false;
161
171 bool isotopic_prefilter = false;
172 double isotopic_prefilter_tol_ppm = 50.0;
173
174 int dia_ms2_n_neighbors = 0;
175 int dia_ms2_min_support = 1;
176 bool dia_ms2_centroid = false;
177
178 int ms1_n_neighbors = 0;
181 int ms1_min_support = 0;
185 double ms1_max_rt_distance_sec = 0.0;
190
191 enum ExportMode { AUTO, SPECTRUM, FRAME };
192 ExportMode export_mode = AUTO;
193
213 enum class TimsCalibrationStrategy { AUTO, BRUKER_SDK, RATIONAL, LINEAR };
214 TimsCalibrationStrategy tims_calibration_strategy = TimsCalibrationStrategy::AUTO;
215
219 enum class PressureCompensation { NONE, GLOBAL, PER_FRAME };
220 PressureCompensation pressure_compensation = PressureCompensation::NONE;
221
224 std::string bruker_sdk_path;
225 };
226
228 struct DIAStreamingMetadata
229 {
230 std::vector<OpenSwath::SwathMap> boundaries;
231 int nr_ms1_spectra = 0;
232 std::vector<int> nr_ms2_spectra;
233 };
234
237 DIAStreamingMetadata readDIAMetadata(const std::string& path, ExperimentalSettings& exp_settings);
239 DIAStreamingMetadata readDIAMetadata(const std::string& path, ExperimentalSettings& exp_settings,
240 const Config& config);
241
245 void loadDIAStreaming(const std::string& path, FullSwathFileConsumer& consumer);
247 void loadDIAStreaming(const std::string& path, FullSwathFileConsumer& consumer,
248 const Config& config);
249
251 void load(const std::string& path, MSExperiment& exp);
253 void load(const std::string& path, MSExperiment& exp, const Config& config);
254
258 void transform(const std::string& path, Interfaces::IMSDataConsumer* consumer);
260 void transform(const std::string& path, Interfaces::IMSDataConsumer* consumer, const Config& config);
261
262 private:
264 void loadDDA_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
265
267 void loadDIA_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
268
270 void loadFrames_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
271
273 bool isDIA_(const std::string& tdf_path) const;
274
277 void loadExperimentalSettings_(const std::string& path, const std::string& d_path, ExperimentalSettings& settings);
278
280 struct UnpackedArchive;
281
283 static std::shared_ptr<UnpackedArchive> unpack_(const std::string& path);
284
287 std::shared_ptr<UnpackedArchive> takeUnpacked_(const std::string& path);
288
290 std::shared_ptr<UnpackedArchive> unpacked_;
291 };
292
293} // namespace OpenMS
294
295#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