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 <string>
17
18class TimsDataHandle;
19
20namespace OpenMS
21{
22 class FullSwathFileConsumer;
23
47 class OPENMS_DLLAPI BrukerTimsFile : public ProgressLogger
48 {
49 public:
51 struct Config
52 {
53 double calibration_tolerance = 0.0;
54 bool calibrate = false;
55
56 bool load_ms1 = true;
59
90 uint32_t frame_id_min = 0;
91 uint32_t frame_id_max = std::numeric_limits<uint32_t>::max();
92
100 double rt_min_sec = 0.0;
101 double rt_max_sec = std::numeric_limits<double>::infinity();
102
114 enum class CentroidAlgo { OFF, GREEDY2D, HILL_BASED };
115
119 CentroidAlgo ms1_centroid_algo = CentroidAlgo::OFF;
120
136 CentroidAlgo ms2_centroid_algo = CentroidAlgo::OFF;
137
138 float ms1_centroid_mz_ppm = 10.0f;
139 float ms1_centroid_im_pct = 0.0f;
140 int ms1_centroid_max_peaks = 100000;
141
142 float ms2_centroid_mz_ppm = 20.0f;
143 double centroid_valley_factor = 1.3;
144 Size ms1_centroid_min_hill_length = 1;
145 Size ms2_centroid_min_hill_length = 2;
146 Size centroid_max_scan_gap = 0;
147 bool expose_hill_bounds = false;
148
158 bool isotopic_prefilter = false;
159 double isotopic_prefilter_tol_ppm = 50.0;
160
161 int dia_ms2_n_neighbors = 0;
162 int dia_ms2_min_support = 1;
163 bool dia_ms2_centroid = false;
164
165 int ms1_n_neighbors = 0;
168 int ms1_min_support = 0;
172 double ms1_max_rt_distance_sec = 0.0;
177
178 enum ExportMode { AUTO, SPECTRUM, FRAME };
179 ExportMode export_mode = AUTO;
180
183 enum class TimsCalibrationStrategy { AUTO, BRUKER_SDK, RATIONAL, LINEAR };
184 TimsCalibrationStrategy tims_calibration_strategy = TimsCalibrationStrategy::AUTO;
185
189 enum class PressureCompensation { NONE, GLOBAL, PER_FRAME };
190 PressureCompensation pressure_compensation = PressureCompensation::NONE;
191
194 std::string bruker_sdk_path;
195 };
196
198 struct DIAStreamingMetadata
199 {
200 std::vector<OpenSwath::SwathMap> boundaries;
201 int nr_ms1_spectra = 0;
202 std::vector<int> nr_ms2_spectra;
203 };
204
207 DIAStreamingMetadata readDIAMetadata(const std::string& path, ExperimentalSettings& exp_settings);
209 DIAStreamingMetadata readDIAMetadata(const std::string& path, ExperimentalSettings& exp_settings,
210 const Config& config);
211
215 void loadDIAStreaming(const std::string& path, FullSwathFileConsumer& consumer);
217 void loadDIAStreaming(const std::string& path, FullSwathFileConsumer& consumer,
218 const Config& config);
219
221 void load(const std::string& path, MSExperiment& exp);
223 void load(const std::string& path, MSExperiment& exp, const Config& config);
224
228 void transform(const std::string& path, Interfaces::IMSDataConsumer* consumer);
230 void transform(const std::string& path, Interfaces::IMSDataConsumer* consumer, const Config& config);
231
232 private:
234 void loadDDA_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
235
237 void loadDIA_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
238
240 void loadFrames_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
241
243 bool isDIA_(const std::string& tdf_path) const;
244
246 void loadExperimentalSettings_(const std::string& path, ExperimentalSettings& settings);
247 };
248
249} // namespace OpenMS
250
251#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