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
147 CentroidAlgo ms2_centroid_algo = CentroidAlgo::OFF;
148
149 float ms1_centroid_mz_ppm = 10.0f;
150 float ms1_centroid_im_pct = 0.0f;
151 int ms1_centroid_max_peaks = 100000;
152
153 float ms2_centroid_mz_ppm = 20.0f;
154 double centroid_valley_factor = 1.3;
155 Size ms1_centroid_min_hill_length = 1;
156 Size ms2_centroid_min_hill_length = 2;
157 Size centroid_max_scan_gap = 0;
158 bool expose_hill_bounds = false;
159
169 bool isotopic_prefilter = false;
170 double isotopic_prefilter_tol_ppm = 50.0;
171
172 int dia_ms2_n_neighbors = 0;
173 int dia_ms2_min_support = 1;
174 bool dia_ms2_centroid = false;
175
176 int ms1_n_neighbors = 0;
179 int ms1_min_support = 0;
183 double ms1_max_rt_distance_sec = 0.0;
188
189 enum ExportMode { AUTO, SPECTRUM, FRAME };
190 ExportMode export_mode = AUTO;
191
194 enum class TimsCalibrationStrategy { AUTO, BRUKER_SDK, RATIONAL, LINEAR };
195 TimsCalibrationStrategy tims_calibration_strategy = TimsCalibrationStrategy::AUTO;
196
200 enum class PressureCompensation { NONE, GLOBAL, PER_FRAME };
201 PressureCompensation pressure_compensation = PressureCompensation::NONE;
202
205 std::string bruker_sdk_path;
206 };
207
209 struct DIAStreamingMetadata
210 {
211 std::vector<OpenSwath::SwathMap> boundaries;
212 int nr_ms1_spectra = 0;
213 std::vector<int> nr_ms2_spectra;
214 };
215
218 DIAStreamingMetadata readDIAMetadata(const std::string& path, ExperimentalSettings& exp_settings);
220 DIAStreamingMetadata readDIAMetadata(const std::string& path, ExperimentalSettings& exp_settings,
221 const Config& config);
222
226 void loadDIAStreaming(const std::string& path, FullSwathFileConsumer& consumer);
228 void loadDIAStreaming(const std::string& path, FullSwathFileConsumer& consumer,
229 const Config& config);
230
232 void load(const std::string& path, MSExperiment& exp);
234 void load(const std::string& path, MSExperiment& exp, const Config& config);
235
239 void transform(const std::string& path, Interfaces::IMSDataConsumer* consumer);
241 void transform(const std::string& path, Interfaces::IMSDataConsumer* consumer, const Config& config);
242
243 private:
245 void loadDDA_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
246
248 void loadDIA_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
249
251 void loadFrames_(TimsDataHandle& handle, MSExperiment& exp, const Config& config);
252
254 bool isDIA_(const std::string& tdf_path) const;
255
258 void loadExperimentalSettings_(const std::string& path, const std::string& d_path, ExperimentalSettings& settings);
259
261 struct UnpackedArchive;
262
264 static std::shared_ptr<UnpackedArchive> unpack_(const std::string& path);
265
268 std::shared_ptr<UnpackedArchive> takeUnpacked_(const std::string& path);
269
271 std::shared_ptr<UnpackedArchive> unpacked_;
272 };
273
274} // namespace OpenMS
275
276#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