OpenMS
Loading...
Searching...
No Matches
SwathFileConsumer.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
11// Datastructures
15
16// Consumers
21
22
23// Helpers
27
31
32#ifdef _OPENMP
33#include <omp.h>
34#endif
35
36namespace OpenMS
37{
38
76 class OPENMS_DLLAPI FullSwathFileConsumer :
78 {
79
80public:
84
86 ms1_map_(), // initialize to null
87 consuming_possible_(true),
88 use_external_boundaries_(false),
89 correct_window_counter_(0)
90 {
91 use_external_boundaries_ = !swath_map_boundaries_.empty();
92 }
93
101 FullSwathFileConsumer(std::vector<OpenSwath::SwathMap> swath_boundaries) :
102 swath_map_boundaries_(swath_boundaries),
103 ms1_map_(), // initialize to null
104 consuming_possible_(true),
105 use_external_boundaries_(false),
106 correct_window_counter_(0)
107 {
108 use_external_boundaries_ = !swath_map_boundaries_.empty();
109 }
110
112
113 void setExpectedSize(Size, Size) override {}
114 void setExperimentalSettings(const ExperimentalSettings& exp) override {settings_ = exp; }
115
127 void retrieveSwathMaps(std::vector<OpenSwath::SwathMap>& maps)
128 {
129 consuming_possible_ = false; // make consumption of further spectra / chromatograms impossible
130 ensureMapsAreFilled_();
131 if (ms1_map_)
132 {
134 map.sptr = SimpleOpenMSSpectraFactory::getSpectrumAccessOpenMSPtr(ms1_map_);
135 map.lower = -1;
136 map.upper = -1;
137 map.center = -1;
138 map.imLower = -1;
139 map.imUpper = -1;
140 map.ms1 = true;
141 maps.push_back(map);
142 }
143
144 // Print warning if the lower/upper window could not be determined and we
145 // required manual determination of the boundaries.
146 if (!use_external_boundaries_ && correct_window_counter_ != swath_maps_.size())
147 {
148 std::cout << "WARNING: Could not correctly read the upper/lower limits of the SWATH windows from your input file. Read " <<
149 correct_window_counter_ << " correct (non-zero) window limits (expected " << swath_maps_.size() << " windows)." << std::endl;
150 }
151
152 size_t nonempty_maps = 0;
153 for (Size i = 0; i < swath_maps_.size(); i++)
154 {
156 map.sptr = SimpleOpenMSSpectraFactory::getSpectrumAccessOpenMSPtr(swath_maps_[i]);
157 map.lower = swath_map_boundaries_[i].lower;
158 map.upper = swath_map_boundaries_[i].upper;
159 map.center = swath_map_boundaries_[i].center;
160 map.imLower = swath_map_boundaries_[i].imLower;
161 map.imUpper = swath_map_boundaries_[i].imUpper;
162 map.ms1 = false;
163 maps.push_back(map);
164 if (map.sptr->getNrSpectra() > 0) {nonempty_maps++;}
165 }
166
167 if (nonempty_maps != swath_map_boundaries_.size())
168 {
169 std::cout << "WARNING: The number nonempty maps found in the input file (" << nonempty_maps << ") is not equal to the number of provided swath window boundaries (" <<
170 swath_map_boundaries_.size() << "). Please check your input." << std::endl;
171 }
172
173 }
174
177 {
178 std::cerr << "Read chromatogram while reading SWATH files, did not expect that!" << std::endl;
179 }
180
187 {
188
189 if (!consuming_possible_)
190 {
191 throw Exception::IllegalArgument(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
192 "FullSwathFileConsumer cannot consume any more spectra after retrieveSwathMaps has been called already");
193 }
194
195 if (s.getMSLevel() == 1)
196 {
197 consumeMS1Spectrum_(s);
198 }
199 else
200 {
201 if (s.getPrecursors().empty())
202 {
203 throw Exception::InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
204 "Swath scan does not provide a precursor.");
205 }
206
207 const std::vector<Precursor>& prec = s.getPrecursors();
208 double center = prec[0].getMZ();
209 double lower = prec[0].getMZ() - prec[0].getIsolationWindowLowerOffset();
210 double upper = prec[0].getMZ() + prec[0].getIsolationWindowUpperOffset();
211
212 double lowerIm = -1; // these initial values assume IM is not present
213 double upperIm = -1;
214
215 // add IM if present
216 if (s.metaValueExists("ion mobility lower limit"))
217 {
218 lowerIm = (double)s.getMetaValue("ion mobility lower limit"); // want this to be -1 if no ion mobility
219 upperIm = (double)s.getMetaValue("ion mobility upper limit");
220 }
221
222 bool found = false;
223
224 // Check if enough information is present to infer the swath
225 if (center <= 0.0)
226 {
227 throw Exception::InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
228 "Swath scan does not provide any precursor isolation information.");
229 }
230
231 // try to match the current scan to one of the already known windows
232 for (Size i = 0; i < swath_map_boundaries_.size(); i++)
233 {
234 // We group by the precursor mz (center of the window) since this
235 // should be present in all SWATH scans.
236 // also specify ion mobility, if ion mobility not present will just be -1
237 if ( (std::fabs(center - swath_map_boundaries_[i].center) < 1e-6) && (std::fabs(lowerIm - swath_map_boundaries_[i].imLower) < 1e-6) && ( std::fabs(upperIm - swath_map_boundaries_[i].imUpper) < 1e-6))
238 {
239 found = true;
240 consumeSwathSpectrum_(s, i);
241 break;
242 }
243 }
244 if (!found)
245 {
246 if (use_external_boundaries_)
247 {
248 throw Exception::InvalidParameter(__FILE__, __LINE__, OPENMS_PRETTY_FUNCTION,
249 std::string("Encountered SWATH scan with boundary ") + center + " m/z which was not present in the provided windows.");
250 }
251 else
252 {
253 consumeSwathSpectrum_(s, swath_map_boundaries_.size());
254
255 // we found a new SWATH window
256 if (lower > 0.0 && upper > 0.0)
257 {correct_window_counter_++;}
258
259 OpenSwath::SwathMap boundary;
260 boundary.lower = lower;
261 boundary.upper = upper;
262 boundary.center = center;
263 boundary.imLower = lowerIm;
264 boundary.imUpper = upperIm;
265 swath_map_boundaries_.push_back(boundary);
266
267 OPENMS_LOG_DEBUG << "Adding Swath centered at " << center
268 << " m/z with an isolation window of " << lower << " to " << upper
269 << " m/z and IM lower limit of " << lowerIm << " and upper limit of " << upperIm << std::endl;
270 }
271 }
272 }
273 }
274
275protected:
276
284 virtual void consumeSwathSpectrum_(MapType::SpectrumType& s, size_t swath_nr) = 0;
285
293
299 virtual void ensureMapsAreFilled_() = 0;
300
302 std::vector<OpenSwath::SwathMap> swath_map_boundaries_;
303
305 std::vector<std::shared_ptr<PeakMap > > swath_maps_;
306 std::shared_ptr<PeakMap > ms1_map_;
307
309 // (MSExperiment has no constructor using ExperimentalSettings)
311
314
317
320
321 };
322
329 class OPENMS_DLLAPI RegularSwathFileConsumer :
331 {
332
333public:
337
339
340 RegularSwathFileConsumer(std::vector<OpenSwath::SwathMap> known_window_boundaries) :
341 FullSwathFileConsumer(known_window_boundaries) {}
342
343protected:
345 {
346 std::shared_ptr<PeakMap > exp(new PeakMap(settings_));
347 swath_maps_.push_back(exp);
348 }
349
350 void consumeSwathSpectrum_(MapType::SpectrumType& s, size_t swath_nr) override
351 {
352 while (swath_maps_.size() <= swath_nr)
353 {
354 addNewSwathMap_();
355 }
356
357 swath_maps_[swath_nr]->addSpectrum(s);
358 }
359
361 {
362 std::shared_ptr<PeakMap > exp(new PeakMap(settings_));
363 ms1_map_ = exp;
364 }
365
367 {
368 if (!ms1_map_)
369 {
370 addMS1Map_();
371 }
372 ms1_map_->addSpectrum(s);
373 }
374
375 void ensureMapsAreFilled_() override {}
376 };
377
387 class OPENMS_DLLAPI CachedSwathFileConsumer :
389 {
390
391public:
395
396 CachedSwathFileConsumer(std::string cachedir, std::string basename, Size nr_ms1_spectra, std::vector<int> nr_ms2_spectra) :
397 ms1_consumer_(nullptr),
398 swath_consumers_(),
399 cachedir_(cachedir),
400 basename_(basename),
401 nr_ms1_spectra_(nr_ms1_spectra),
402 nr_ms2_spectra_(nr_ms2_spectra)
403 {}
404
405 CachedSwathFileConsumer(std::vector<OpenSwath::SwathMap> known_window_boundaries,
406 std::string cachedir, std::string basename, Size nr_ms1_spectra, std::vector<int> nr_ms2_spectra) :
407 FullSwathFileConsumer(known_window_boundaries),
408 ms1_consumer_(nullptr),
409 swath_consumers_(),
410 cachedir_(cachedir),
411 basename_(basename),
412 nr_ms1_spectra_(nr_ms1_spectra),
413 nr_ms2_spectra_(nr_ms2_spectra)
414 {}
415
417 {
418 // Properly delete the MSDataCachedConsumer -> free memory and _close_ file stream
419 while (!swath_consumers_.empty())
420 {
421 delete swath_consumers_.back();
422 swath_consumers_.pop_back();
423 }
424 if (ms1_consumer_ != nullptr)
425 {
426 delete ms1_consumer_;
427 ms1_consumer_ = nullptr;
428 }
429 }
430
431protected:
433 {
434 std::string meta_file = cachedir_ + basename_ + "_" + StringUtils::toStr(swath_consumers_.size()) + ".mzML";
435 std::string cached_file = meta_file + ".cached";
436 MSDataCachedConsumer* consumer = new MSDataCachedConsumer(cached_file, true);
437 consumer->setExpectedSize(nr_ms2_spectra_[swath_consumers_.size()], 0);
438 swath_consumers_.push_back(consumer);
439
440 // maps for meta data
441 std::shared_ptr<PeakMap > exp(new PeakMap(settings_));
442 swath_maps_.push_back(exp);
443 }
444
445 void consumeSwathSpectrum_(MapType::SpectrumType& s, size_t swath_nr) override
446 {
447 while (swath_maps_.size() <= swath_nr)
448 {
449 addNewSwathMap_();
450 }
451 swath_consumers_[swath_nr]->consumeSpectrum(s); // write data to cached file; clear data from spectrum s
452 swath_maps_[swath_nr]->addSpectrum(s); // append for the metadata (actual data was deleted)
453 }
454
456 {
457 std::string meta_file = cachedir_ + basename_ + "_ms1.mzML";
458 std::string cached_file = meta_file + ".cached";
459 ms1_consumer_ = new MSDataCachedConsumer(cached_file, true);
460 ms1_consumer_->setExpectedSize(nr_ms1_spectra_, 0);
461 std::shared_ptr<PeakMap > exp(new PeakMap(settings_));
462 ms1_map_ = exp;
463 }
464
466 {
467 if (ms1_consumer_ == nullptr)
468 {
469 addMS1Map_();
470 }
471 ms1_consumer_->consumeSpectrum(s);
472 ms1_map_->addSpectrum(s); // append for the metadata (actual data is deleted)
473 }
474
475 void ensureMapsAreFilled_() override
476 {
477 size_t swath_consumers_size = swath_consumers_.size();
478 bool have_ms1 = (ms1_consumer_ != nullptr);
479
480 // Properly delete the MSDataCachedConsumer -> free memory and _close_ file stream
481 // The file streams to the cached data on disc can and should be closed
482 // here safely. Since ensureMapsAreFilled_ is called after consuming all
483 // the spectra, there will be no more spectra to append but the client
484 // might already want to read after this call, so all data needs to be
485 // present on disc and the file streams closed.
486 //
487 // TODO merge with destructor code into own function!
488 while (!swath_consumers_.empty())
489 {
490 delete swath_consumers_.back();
491 swath_consumers_.pop_back();
492 }
493 if (ms1_consumer_ != nullptr)
494 {
495 delete ms1_consumer_;
496 ms1_consumer_ = nullptr;
497 }
498
499 if (have_ms1)
500 {
501 std::shared_ptr<PeakMap > exp(new PeakMap);
502 std::string meta_file = cachedir_ + basename_ + "_ms1.mzML";
503 // write metadata to disk and store the correct data processing tag
504 Internal::CachedMzMLHandler().writeMetadata(*ms1_map_, meta_file, true);
505 FileHandler().loadExperiment(meta_file, *exp.get(), {FileTypes::MZML});
506 ms1_map_ = exp;
507 }
508
509#ifdef _OPENMP
510#pragma omp parallel for
511#endif
512 for (SignedSize i = 0; i < OpenMS::checkedCast<SignedSize>(swath_consumers_size); i++)
513 {
514 std::shared_ptr<PeakMap > exp(new PeakMap);
515 std::string meta_file = cachedir_ + basename_ + "_" + StringUtils::toStr(i) + ".mzML";
516 // write metadata to disk and store the correct data processing tag
517 Internal::CachedMzMLHandler().writeMetadata(*swath_maps_[i], meta_file, true);
518 FileHandler().loadExperiment(meta_file, *exp.get(), {FileTypes::MZML});
519 swath_maps_[i] = exp;
520 }
521 }
522
524 std::vector<MSDataCachedConsumer*> swath_consumers_;
525
526 std::string cachedir_;
527 std::string basename_;
529 std::vector<int> nr_ms2_spectra_;
530 };
531
544 class OPENMS_DLLAPI MzMLSwathFileConsumer :
546 {
547
548public:
552
553 MzMLSwathFileConsumer(const std::string& cachedir, const std::string& basename, Size nr_ms1_spectra, const std::vector<int>& nr_ms2_spectra) :
554 ms1_consumer_(nullptr),
555 swath_consumers_(),
556 cachedir_(cachedir),
557 basename_(basename),
558 nr_ms1_spectra_(nr_ms1_spectra),
559 nr_ms2_spectra_(nr_ms2_spectra)
560 {}
561
562 MzMLSwathFileConsumer(std::vector<OpenSwath::SwathMap> known_window_boundaries,
563 const std::string& cachedir, const std::string& basename, Size nr_ms1_spectra, const std::vector<int>& nr_ms2_spectra) :
564 FullSwathFileConsumer(known_window_boundaries),
565 ms1_consumer_(nullptr),
566 swath_consumers_(),
567 cachedir_(cachedir),
568 basename_(basename),
569 nr_ms1_spectra_(nr_ms1_spectra),
570 nr_ms2_spectra_(nr_ms2_spectra)
571 {}
572
574 {
575 deleteSetNull_();
576 }
577
578protected:
579
581 {
582 // Properly delete the MSDataCachedConsumer -> free memory and _close_ file stream
583 while (!swath_consumers_.empty())
584 {
585 delete swath_consumers_.back();
586 swath_consumers_.pop_back();
587 }
588 if (ms1_consumer_ != nullptr)
589 {
590 delete ms1_consumer_;
591 ms1_consumer_ = nullptr;
592 }
593 }
594
596 {
597 std::string mzml_file = cachedir_ + basename_ + "_" + StringUtils::toStr(swath_consumers_.size()) + ".mzML";
599 consumer->getOptions().setCompression(true);
600 consumer->setExpectedSize(nr_ms2_spectra_[swath_consumers_.size()], 0);
601 swath_consumers_.push_back(consumer);
602 }
603
604 void consumeSwathSpectrum_(MapType::SpectrumType& s, size_t swath_nr) override
605 {
606 // only use swath_consumers_ to count how many we have already added
607 while (swath_consumers_.size() <= swath_nr)
608 {
609 addNewSwathMap_();
610 }
611 swath_consumers_[swath_nr]->consumeSpectrum(s);
612 s.clear(false);
613 }
614
616 {
617 std::string mzml_file = cachedir_ + basename_ + "_ms1.mzML";
618 ms1_consumer_ = new PlainMSDataWritingConsumer(mzml_file);
619 ms1_consumer_->setExpectedSize(nr_ms1_spectra_, 0);
620 ms1_consumer_->getOptions().setCompression(true);
621 }
622
624 {
625 if (ms1_consumer_ == nullptr)
626 {
627 addMS1Map_();
628 }
629 ms1_consumer_->consumeSpectrum(s);
630 }
631
632 void ensureMapsAreFilled_() override
633 {
634 deleteSetNull_();
635 }
636
638 std::vector<PlainMSDataWritingConsumer*> swath_consumers_;
639
640 std::string cachedir_;
641 std::string basename_;
643 std::vector<int> nr_ms2_spectra_;
644 };
645
646}
647
#define OPENMS_LOG_DEBUG
Definition LogStream.h:714
On-disk cached implementation of FullSwathFileConsumer.
Definition SwathFileConsumer.h:389
void consumeMS1Spectrum_(MapType::SpectrumType &s) override
Consume an MS1 spectrum.
Definition SwathFileConsumer.h:465
std::vector< MSDataCachedConsumer * > swath_consumers_
Definition SwathFileConsumer.h:524
CachedSwathFileConsumer(std::vector< OpenSwath::SwathMap > known_window_boundaries, std::string cachedir, std::string basename, Size nr_ms1_spectra, std::vector< int > nr_ms2_spectra)
Definition SwathFileConsumer.h:405
void addMS1Map_()
Definition SwathFileConsumer.h:455
void ensureMapsAreFilled_() override
Callback function after the reading is complete.
Definition SwathFileConsumer.h:475
CachedSwathFileConsumer(std::string cachedir, std::string basename, Size nr_ms1_spectra, std::vector< int > nr_ms2_spectra)
Definition SwathFileConsumer.h:396
MapType::ChromatogramType ChromatogramType
Definition SwathFileConsumer.h:394
std::string cachedir_
Definition SwathFileConsumer.h:526
std::string basename_
Definition SwathFileConsumer.h:527
std::vector< int > nr_ms2_spectra_
Definition SwathFileConsumer.h:529
~CachedSwathFileConsumer() override
Definition SwathFileConsumer.h:416
MSDataCachedConsumer * ms1_consumer_
Definition SwathFileConsumer.h:523
PeakMap MapType
Definition SwathFileConsumer.h:392
void consumeSwathSpectrum_(MapType::SpectrumType &s, size_t swath_nr) override
Consume an MS2 spectrum belonging to SWATH "swath_nr".
Definition SwathFileConsumer.h:445
MapType::SpectrumType SpectrumType
Definition SwathFileConsumer.h:393
void addNewSwathMap_()
Definition SwathFileConsumer.h:432
int nr_ms1_spectra_
Definition SwathFileConsumer.h:528
A method or algorithm argument contains illegal values.
Definition Exception.h:633
Exception indicating that an invalid parameter was handed over to an algorithm.
Definition Exception.h:317
Description of the experimental settings.
Definition ExperimentalSettings.h:37
Facilitates file handling by file type recognition.
Definition FileHandler.h:52
void loadExperiment(const std::string &filename, PeakMap &exp, const std::vector< FileTypes::Type > allowed_types=std::vector< FileTypes::Type >(), ProgressLogger::LogType log=ProgressLogger::NONE, const bool rewrite_source_file=false, const bool compute_hash=false)
Loads a file into an MSExperiment.
Abstract base class which can consume spectra coming from SWATH experiment stored in a single file.
Definition SwathFileConsumer.h:78
size_t correct_window_counter_
How many windows were correctly annotated (non-zero window limits)
Definition SwathFileConsumer.h:319
std::vector< std::shared_ptr< PeakMap > > swath_maps_
A list of SWATH maps and the MS1 map.
Definition SwathFileConsumer.h:305
FullSwathFileConsumer(std::vector< OpenSwath::SwathMap > swath_boundaries)
Constructor.
Definition SwathFileConsumer.h:101
~FullSwathFileConsumer() override
Definition SwathFileConsumer.h:111
bool consuming_possible_
Whether further spectra can still be consumed.
Definition SwathFileConsumer.h:313
std::shared_ptr< PeakMap > ms1_map_
Definition SwathFileConsumer.h:306
FullSwathFileConsumer()
Definition SwathFileConsumer.h:85
MapType::ChromatogramType ChromatogramType
Definition SwathFileConsumer.h:83
PeakMap settings_
The Experimental settings.
Definition SwathFileConsumer.h:310
void setExpectedSize(Size, Size) override
Set expected size of spectra and chromatograms to be consumed.
Definition SwathFileConsumer.h:113
virtual void consumeMS1Spectrum_(MapType::SpectrumType &s)=0
Consume an MS1 spectrum.
virtual void consumeSwathSpectrum_(MapType::SpectrumType &s, size_t swath_nr)=0
Consume an MS2 spectrum belonging to SWATH "swath_nr".
PeakMap MapType
Definition SwathFileConsumer.h:81
void consumeChromatogram(MapType::ChromatogramType &) override
Consume a chromatogram -> should not happen when dealing with SWATH maps.
Definition SwathFileConsumer.h:176
std::vector< OpenSwath::SwathMap > swath_map_boundaries_
A list of Swath map identifiers (lower/upper boundary and center)
Definition SwathFileConsumer.h:302
void retrieveSwathMaps(std::vector< OpenSwath::SwathMap > &maps)
Populate the vector of swath maps after consuming all spectra.
Definition SwathFileConsumer.h:127
void setExperimentalSettings(const ExperimentalSettings &exp) override
Set experimental settings (meta-data) of the data to be consumed.
Definition SwathFileConsumer.h:114
void consumeSpectrum(MapType::SpectrumType &s) override
Consume a spectrum which may belong either to an MS1 scan or one of n MS2 (SWATH) scans
Definition SwathFileConsumer.h:186
bool use_external_boundaries_
Whether to use external input for SWATH boundaries.
Definition SwathFileConsumer.h:316
MapType::SpectrumType SpectrumType
Definition SwathFileConsumer.h:82
virtual void ensureMapsAreFilled_()=0
Callback function after the reading is complete.
The interface of a consumer of spectra and chromatograms.
Definition IMSDataConsumer.h:46
An class that uses on-disk caching to read and write spectra and chromatograms.
Definition CachedMzMLHandler.h:41
void writeMetadata(MapType exp, const std::string &out_meta, bool addCacheMetaValue=false)
Write only the meta data of an MSExperiment.
PeakFileOptions & getOptions()
Get the peak file options.
The representation of a chromatogram.
Definition MSChromatogram.h:33
Transforming and cached writing consumer of MS data.
Definition MSDataCachedConsumer.h:31
void setExpectedSize(Size, Size) override
Set expected size of spectra and chromatograms to be consumed.
Definition MSDataCachedConsumer.h:74
void setExpectedSize(Size expectedSpectra, Size expectedChromatograms) override
Set expected size of spectra and chromatograms to be written.
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
UInt getMSLevel() const
Returns the MS level.
void clear(bool clear_meta_data)
Clears all data and meta data.
const DataValue & getMetaValue(const std::string &name) const
Returns the value corresponding to a string, or DataValue::EMPTY if not found.
bool metaValueExists(const std::string &name) const
Returns whether an entry with the given name exists.
On-disk mzML implementation of FullSwathFileConsumer.
Definition SwathFileConsumer.h:546
std::vector< PlainMSDataWritingConsumer * > swath_consumers_
Definition SwathFileConsumer.h:638
void consumeMS1Spectrum_(MapType::SpectrumType &s) override
Consume an MS1 spectrum.
Definition SwathFileConsumer.h:623
PlainMSDataWritingConsumer * ms1_consumer_
Definition SwathFileConsumer.h:637
void addMS1Map_()
Definition SwathFileConsumer.h:615
~MzMLSwathFileConsumer() override
Definition SwathFileConsumer.h:573
void ensureMapsAreFilled_() override
Callback function after the reading is complete.
Definition SwathFileConsumer.h:632
MzMLSwathFileConsumer(const std::string &cachedir, const std::string &basename, Size nr_ms1_spectra, const std::vector< int > &nr_ms2_spectra)
Definition SwathFileConsumer.h:553
MapType::ChromatogramType ChromatogramType
Definition SwathFileConsumer.h:551
MzMLSwathFileConsumer(std::vector< OpenSwath::SwathMap > known_window_boundaries, const std::string &cachedir, const std::string &basename, Size nr_ms1_spectra, const std::vector< int > &nr_ms2_spectra)
Definition SwathFileConsumer.h:562
std::string cachedir_
Definition SwathFileConsumer.h:640
std::string basename_
Definition SwathFileConsumer.h:641
std::vector< int > nr_ms2_spectra_
Definition SwathFileConsumer.h:643
PeakMap MapType
Definition SwathFileConsumer.h:549
void consumeSwathSpectrum_(MapType::SpectrumType &s, size_t swath_nr) override
Consume an MS2 spectrum belonging to SWATH "swath_nr".
Definition SwathFileConsumer.h:604
MapType::SpectrumType SpectrumType
Definition SwathFileConsumer.h:550
void addNewSwathMap_()
Definition SwathFileConsumer.h:595
int nr_ms1_spectra_
Definition SwathFileConsumer.h:642
void deleteSetNull_()
Definition SwathFileConsumer.h:580
void setCompression(bool compress)
Consumer class that writes MS data to disk using the mzML format.
Definition MSDataWritingConsumer.h:219
In-memory implementation of FullSwathFileConsumer.
Definition SwathFileConsumer.h:331
void consumeMS1Spectrum_(MapType::SpectrumType &s) override
Consume an MS1 spectrum.
Definition SwathFileConsumer.h:366
RegularSwathFileConsumer()
Definition SwathFileConsumer.h:338
void addMS1Map_()
Definition SwathFileConsumer.h:360
void ensureMapsAreFilled_() override
Callback function after the reading is complete.
Definition SwathFileConsumer.h:375
MapType::ChromatogramType ChromatogramType
Definition SwathFileConsumer.h:336
PeakMap MapType
Definition SwathFileConsumer.h:334
void consumeSwathSpectrum_(MapType::SpectrumType &s, size_t swath_nr) override
Consume an MS2 spectrum belonging to SWATH "swath_nr".
Definition SwathFileConsumer.h:350
MapType::SpectrumType SpectrumType
Definition SwathFileConsumer.h:335
void addNewSwathMap_()
Definition SwathFileConsumer.h:344
RegularSwathFileConsumer(std::vector< OpenSwath::SwathMap > known_window_boundaries)
Definition SwathFileConsumer.h:340
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
if none is found
Definition common-cmake-parameters.doxygen:88
ptrdiff_t SignedSize
Signed Size type e.g. used as pointer difference.
Definition Types.h:104
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
Data structure to hold one SWATH map with information about upper / lower isolation window and whethe...
Definition SwathMap.h:21
bool ms1
Definition SwathMap.h:28
double imUpper
Definition SwathMap.h:27
OpenSwath::SpectrumAccessPtr sptr
Definition SwathMap.h:22
double center
Definition SwathMap.h:25
double lower
Definition SwathMap.h:23
double imLower
Definition SwathMap.h:26
double upper
Definition SwathMap.h:24