OpenMS
MRMFeatureQC.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Douglas McCloskey $
6 // $Authors: Douglas McCloskey $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 #include <OpenMS/KERNEL/Feature.h>
14 
16 
17 namespace OpenMS
18 {
19 
32  class OPENMS_DLLAPI MRMFeatureQC
33  {
34 
35 public:
36 
38  MRMFeatureQC() = default;
40 
42  ~MRMFeatureQC() = default;
44 
45  // Members
46  //
53  struct ComponentQCs
54  {
55  bool operator==(const ComponentQCs& other) const {
56  bool members_eq =
57  std::tie(
58  component_name,
59  retention_time_l,
60  retention_time_u,
61  intensity_l,
62  intensity_u,
63  overall_quality_l,
64  overall_quality_u
65  ) == std::tie(
66  other.component_name,
67  other.retention_time_l,
68  other.retention_time_u,
69  other.intensity_l,
70  other.intensity_u,
71  other.overall_quality_l,
72  other.overall_quality_u
73  );
74  auto compare_maps = [](std::pair<String, std::pair<double, double>> lhs, std::pair<String, std::pair<double, double>> rhs) {return (lhs.first == rhs.first && lhs.second.first == rhs.second.first && lhs.second.second == rhs.second.second); };
75  bool meta_values_eq = std::equal(meta_value_qc.begin(), meta_value_qc.end(), other.meta_value_qc.begin(), compare_maps);
76  return members_eq && meta_values_eq;
77  }
78  bool operator!=(const ComponentQCs& other) const
79  {
80  return !(*this == other);
81  }
82 
85 
86  // Feature members
88  double retention_time_l { 0.0 };
90  double retention_time_u { 1e12 };
92  double intensity_l { 0.0 };
94  double intensity_u { 1e12 };
96  double overall_quality_l { 0.0 };
98  double overall_quality_u { 1e12 };
99 
101  std::map<String,std::pair<double,double>> meta_value_qc;
102 
103  };
104 
112  {
113  bool operator==(const ComponentGroupQCs& other) const {
114  bool members_eq =
115  std::tie(
116  component_group_name,
117  retention_time_l,
118  retention_time_u,
119  intensity_l,
120  intensity_u,
121  overall_quality_l,
122  overall_quality_u,
123  n_heavy_l,
124  n_heavy_u,
125  n_light_l,
126  n_light_u,
127  n_detecting_l,
128  n_detecting_u,
129  n_quantifying_l,
130  n_quantifying_u,
131  n_identifying_l,
132  n_identifying_u,
133  n_transitions_l,
134  n_transitions_u,
135  ion_ratio_pair_name_1,
136  ion_ratio_pair_name_2,
137  ion_ratio_l,
138  ion_ratio_u,
139  ion_ratio_feature_name
140  ) == std::tie(
141  other.component_group_name,
142  other.retention_time_l,
143  other.retention_time_u,
144  other.intensity_l,
145  other.intensity_u,
146  other.overall_quality_l,
147  other.overall_quality_u,
148  other.n_heavy_l,
149  other.n_heavy_u,
150  other.n_light_l,
151  other.n_light_u,
152  other.n_detecting_l,
153  other.n_detecting_u,
154  other.n_quantifying_l,
155  other.n_quantifying_u,
156  other.n_identifying_l,
157  other.n_identifying_u,
158  other.n_transitions_l,
159  other.n_transitions_u,
160  other.ion_ratio_pair_name_1,
161  other.ion_ratio_pair_name_2,
162  other.ion_ratio_l,
163  other.ion_ratio_u,
165  );
166  auto compare_maps = [](std::pair<String, std::pair<double, double>> lhs, std::pair<String, std::pair<double, double>> rhs) {return (lhs.first == rhs.first && lhs.second.first == rhs.second.first && lhs.second.second == rhs.second.second); };
167  bool meta_values_eq = std::equal(meta_value_qc.begin(), meta_value_qc.end(), other.meta_value_qc.begin(), compare_maps);
168  return members_eq && meta_values_eq;
169  }
170  bool operator!=(const ComponentGroupQCs& other) const
171  {
172  return !(*this == other);
173  }
176 
178  double retention_time_l { 0.0 };
180  double retention_time_u { 1e12 };
182  double intensity_l { 0.0 };
184  double intensity_u { 1e12 };
186  double overall_quality_l { 0.0 };
188  double overall_quality_u { 1e12 };
189 
190  // number of transitions and labels
192  Int n_heavy_l { 0 };
194  Int n_heavy_u { 100 };
195  Int n_light_l { 0 };
196  Int n_light_u { 100 };
197  Int n_detecting_l { 0 };
198  Int n_detecting_u { 100 };
199  Int n_quantifying_l { 0 };
200  Int n_quantifying_u { 100 };
201  Int n_identifying_l { 0 };
202  Int n_identifying_u { 100 };
203  Int n_transitions_l { 0 };
204  Int n_transitions_u { 100 };
205 
206  // Ion Ratio QCs
209  double ion_ratio_l { 0.0 };
210  double ion_ratio_u { 1e12 };
212  std::map<String,std::pair<double,double>> meta_value_qc;
213 
214  };
215 
224  {
225 
231  double resolution_l;
233  double resolution_u;
235  double rt_diff_l;
237  double rt_diff_u;
238  };
239 
240  //members
242  std::vector<ComponentQCs> component_qcs;
244  std::vector<ComponentGroupQCs> component_group_qcs;
246  std::vector<ComponentGroupPairQCs> component_group_pair_qcs;
247  };
248 }
249 
250 
The MRMFeatureQC is a class to handle the parameters and options for MRMFeatureFilter.
Definition: MRMFeatureQC.h:33
~MRMFeatureQC()=default
Destructor.
String component_group_name
name of the component
Definition: MRMFeatureQC.h:227
std::vector< ComponentQCs > component_qcs
list of all component QCs
Definition: MRMFeatureQC.h:242
double rt_diff_l
retention time lower bound
Definition: MRMFeatureQC.h:235
double resolution_l
resolution lower bound
Definition: MRMFeatureQC.h:231
std::vector< ComponentGroupPairQCs > component_group_pair_qcs
list of all component group pair QCs
Definition: MRMFeatureQC.h:246
std::vector< ComponentGroupQCs > component_group_qcs
list of all component group QCs
Definition: MRMFeatureQC.h:244
double resolution_u
resolution upper bound
Definition: MRMFeatureQC.h:233
double rt_diff_u
retention time upper bound
Definition: MRMFeatureQC.h:237
String resolution_pair_name
name of the component to calculate the resolution or retention time
Definition: MRMFeatureQC.h:229
Quality Controls (QCs) for multiple components (between or within component_groups)
Definition: MRMFeatureQC.h:224
A more convenient string class.
Definition: String.h:34
int Int
Signed integer type.
Definition: Types.h:72
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Quality Controls (QCs) within a component group.
Definition: MRMFeatureQC.h:112
double ion_ratio_u
Definition: MRMFeatureQC.h:210
bool operator==(const ComponentGroupQCs &other) const
Definition: MRMFeatureQC.h:113
Int n_light_u
Definition: MRMFeatureQC.h:196
String component_group_name
name of the component group
Definition: MRMFeatureQC.h:175
Int n_light_l
Definition: MRMFeatureQC.h:195
bool operator!=(const ComponentGroupQCs &other) const
Definition: MRMFeatureQC.h:170
double intensity_u
intensity upper bound
Definition: MRMFeatureQC.h:184
Int n_transitions_l
Definition: MRMFeatureQC.h:203
Int n_heavy_l
number of heavy ion lower bound
Definition: MRMFeatureQC.h:192
double ion_ratio_l
Definition: MRMFeatureQC.h:209
Int n_identifying_l
Definition: MRMFeatureQC.h:201
double retention_time_l
retention time lower bound
Definition: MRMFeatureQC.h:178
double overall_quality_l
overall quality lower bound
Definition: MRMFeatureQC.h:186
Int n_identifying_u
Definition: MRMFeatureQC.h:202
Int n_quantifying_l
Definition: MRMFeatureQC.h:199
String ion_ratio_pair_name_2
Definition: MRMFeatureQC.h:208
Int n_quantifying_u
Definition: MRMFeatureQC.h:200
Int n_detecting_u
Definition: MRMFeatureQC.h:198
double retention_time_u
retention time upper bound
Definition: MRMFeatureQC.h:180
double overall_quality_u
overall quality upper bound
Definition: MRMFeatureQC.h:188
String ion_ratio_feature_name
Definition: MRMFeatureQC.h:211
std::map< String, std::pair< double, double > > meta_value_qc
Definition: MRMFeatureQC.h:212
Int n_heavy_u
number of heavy ion upper bound
Definition: MRMFeatureQC.h:194
double intensity_l
intensity lower bound
Definition: MRMFeatureQC.h:182
Int n_detecting_l
Definition: MRMFeatureQC.h:197
Int n_transitions_u
Definition: MRMFeatureQC.h:204
String ion_ratio_pair_name_1
Definition: MRMFeatureQC.h:207
Quality Controls (QCs) for individual components.
Definition: MRMFeatureQC.h:54
String component_name
name of the component
Definition: MRMFeatureQC.h:84
double intensity_u
intensity upper bound
Definition: MRMFeatureQC.h:94
bool operator==(const ComponentQCs &other) const
Definition: MRMFeatureQC.h:55
double retention_time_l
retention time lower bound
Definition: MRMFeatureQC.h:88
double overall_quality_l
overall quality lower bound
Definition: MRMFeatureQC.h:96
double retention_time_u
retention time upper bound
Definition: MRMFeatureQC.h:90
double overall_quality_u
overall quality upper bound
Definition: MRMFeatureQC.h:98
bool operator!=(const ComponentQCs &other) const
Definition: MRMFeatureQC.h:78
std::map< String, std::pair< double, double > > meta_value_qc
Feature MetaValues.
Definition: MRMFeatureQC.h:101
double intensity_l
intensity lower bound
Definition: MRMFeatureQC.h:92