OpenMS
Loading...
Searching...
No Matches
SwathQC.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: Chris Bielow $
6// $Authors: Chris Bielow $
7// --------------------------------------------------------------------------
8
9#pragma once
10
12#include <OpenMS/OpenMSConfig.h>
13
14#include <functional>
15#include <map>
16#include <vector>
17
18namespace OpenMS
19{
20 class MSSpectrum;
21 class ExperimentalSettings;
22
23}
24
25namespace OpenSwath
26{
27
36 class OPENMS_DLLAPI SwathQC
37 {
38 public:
39 typedef std::map<int,int> ChargeDistribution;
40
42 SwathQC() = delete;
43
50 SwathQC(const size_t cd_spectra, const double decon_ms1_mz_tol);
51
52
59 std::function<void(const OpenMS::ExperimentalSettings& es)> getExpSettingsFunc();
60
64 std::function<void (const OpenMS::MSSpectrum&)> getSpectraProcessingFunc();
65
66
85 static ChargeDistribution getChargeDistribution(const std::vector<SwathMap>& swath_maps, const size_t nr_samples, const double mz_tol);
86
87
91 void storeJSON(const std::string& filename);
92
97
105 void setNrMS1Spectra(size_t nr);
106
107
108 protected:
109
124 static bool isSubsampledSpectrum_(const size_t total_spec_count, const size_t subsample_count, const size_t idx);
125
126 private:
127
130
137
140 };
141
142}
143
Description of the experimental settings.
Definition ExperimentalSettings.h:36
The representation of a 1D spectrum.
Definition MSSpectrum.h:44
Quality Control function for OpenSwath.
Definition SwathQC.h:37
std::function< void(const OpenMS::MSSpectrum &)> getSpectraProcessingFunc()
size_t ms1_spectra_seen_
keeps track of number of spectra passed to getSpectraProcessingFunc()
Definition SwathQC.h:139
void storeJSON(const std::string &filename)
Save all internally collected data to a JSON file.
ChargeDistribution cd_
internal ChargeDistribution which is augmented upon calling the corresponding member functions
Definition SwathQC.h:129
size_t cd_spectra_
number of spectra to inspect for charge distribution
Definition SwathQC.h:134
void setNrMS1Spectra(size_t nr)
Explicitly set the number of expected MS1 spectra (for sampling charge distribution)
static ChargeDistribution getChargeDistribution(const std::vector< SwathMap > &swath_maps, const size_t nr_samples, const double mz_tol)
Sample the spectra in all MS1 Swath maps and determine all charge states.
std::function< void(const OpenMS::ExperimentalSettings &es)> getExpSettingsFunc()
Returns a lambda function, which captures internal members and can be used in MSDataTransformingConsu...
double decon_ms1_mz_tol_
m/z tolerance for isotope deconvolution
Definition SwathQC.h:136
size_t nr_ms1_spectra_
number of MS1 spectra expected
Definition SwathQC.h:132
const ChargeDistribution & getChargeDistribution() const
returns the charge distribution which was internally computed by applying getSpectraProcessingFunc() ...
SwathQC()=delete
default C'tor (forbidden)
std::map< int, int > ChargeDistribution
Definition SwathQC.h:39
SwathQC(const size_t cd_spectra, const double decon_ms1_mz_tol)
CTor with arguments.
static bool isSubsampledSpectrum_(const size_t total_spec_count, const size_t subsample_count, const size_t idx)
Given a total spectrum count and a number of spectra to inspect, is the current index a candidate?
Main OpenMS namespace.
Definition openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition Scoring.h:18