OpenMS  2.7.0
MRMFeatureQC.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2021.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Douglas McCloskey $
32 // $Authors: Douglas McCloskey $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
38 #include <OpenMS/KERNEL/Feature.h>
40 #include <OpenMS/FORMAT/QcMLFile.h>
41 
44 
45 namespace OpenMS
46 {
47 
60  class OPENMS_DLLAPI MRMFeatureQC
61  {
62 
63 public:
64 
66  MRMFeatureQC() = default;
68 
70  ~MRMFeatureQC() = default;
72 
73  // Members
74  //
81  struct ComponentQCs
82  {
83  bool operator==(const ComponentQCs& other) const {
84  bool members_eq =
85  std::tie(
86  component_name,
87  retention_time_l,
88  retention_time_u,
89  intensity_l,
90  intensity_u,
91  overall_quality_l,
92  overall_quality_u
93  ) == std::tie(
94  other.component_name,
95  other.retention_time_l,
96  other.retention_time_u,
97  other.intensity_l,
98  other.intensity_u,
99  other.overall_quality_l,
100  other.overall_quality_u
101  );
102  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); };
103  bool meta_values_eq = std::equal(meta_value_qc.begin(), meta_value_qc.end(), other.meta_value_qc.begin(), compare_maps);
104  return members_eq && meta_values_eq;
105  }
106  bool operator!=(const ComponentQCs& other) const
107  {
108  return !(*this == other);
109  }
110 
113 
114  // Feature members
116  double retention_time_l { 0.0 };
118  double retention_time_u { 1e12 };
120  double intensity_l { 0.0 };
122  double intensity_u { 1e12 };
124  double overall_quality_l { 0.0 };
126  double overall_quality_u { 1e12 };
127 
129  std::map<String,std::pair<double,double>> meta_value_qc;
130 
131  };
132 
140  {
141  bool operator==(const ComponentGroupQCs& other) const {
142  bool members_eq =
143  std::tie(
144  component_group_name,
145  retention_time_l,
146  retention_time_u,
147  intensity_l,
148  intensity_u,
149  overall_quality_l,
150  overall_quality_u,
151  n_heavy_l,
152  n_heavy_u,
153  n_light_l,
154  n_light_u,
155  n_detecting_l,
156  n_detecting_u,
157  n_quantifying_l,
158  n_quantifying_u,
159  n_identifying_l,
160  n_identifying_u,
161  n_transitions_l,
162  n_transitions_u,
163  ion_ratio_pair_name_1,
164  ion_ratio_pair_name_2,
165  ion_ratio_l,
166  ion_ratio_u,
167  ion_ratio_feature_name
168  ) == std::tie(
169  other.component_group_name,
170  other.retention_time_l,
171  other.retention_time_u,
172  other.intensity_l,
173  other.intensity_u,
174  other.overall_quality_l,
175  other.overall_quality_u,
176  other.n_heavy_l,
177  other.n_heavy_u,
178  other.n_light_l,
179  other.n_light_u,
180  other.n_detecting_l,
181  other.n_detecting_u,
182  other.n_quantifying_l,
183  other.n_quantifying_u,
184  other.n_identifying_l,
185  other.n_identifying_u,
186  other.n_transitions_l,
187  other.n_transitions_u,
188  other.ion_ratio_pair_name_1,
189  other.ion_ratio_pair_name_2,
190  other.ion_ratio_l,
191  other.ion_ratio_u,
193  );
194  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); };
195  bool meta_values_eq = std::equal(meta_value_qc.begin(), meta_value_qc.end(), other.meta_value_qc.begin(), compare_maps);
196  return members_eq && meta_values_eq;
197  }
198  bool operator!=(const ComponentGroupQCs& other) const
199  {
200  return !(*this == other);
201  }
204 
206  double retention_time_l { 0.0 };
208  double retention_time_u { 1e12 };
210  double intensity_l { 0.0 };
212  double intensity_u { 1e12 };
214  double overall_quality_l { 0.0 };
216  double overall_quality_u { 1e12 };
217 
218  // number of transitions and labels
220  Int n_heavy_l { 0 };
222  Int n_heavy_u { 100 };
223  Int n_light_l { 0 };
224  Int n_light_u { 100 };
225  Int n_detecting_l { 0 };
226  Int n_detecting_u { 100 };
227  Int n_quantifying_l { 0 };
228  Int n_quantifying_u { 100 };
229  Int n_identifying_l { 0 };
230  Int n_identifying_u { 100 };
231  Int n_transitions_l { 0 };
232  Int n_transitions_u { 100 };
233 
234  // Ion Ratio QCs
237  double ion_ratio_l { 0.0 };
238  double ion_ratio_u { 1e12 };
240  std::map<String,std::pair<double,double>> meta_value_qc;
241 
242  };
243 
252  {
253 
259  double resolution_l;
261  double resolution_u;
263  double rt_diff_l;
265  double rt_diff_u;
266  };
267 
268  //members
270  std::vector<ComponentQCs> component_qcs;
272  std::vector<ComponentGroupQCs> component_group_qcs;
274  std::vector<ComponentGroupPairQCs> component_group_pair_qcs;
275  };
276 }
277 
278 
The MRMFeatureQC is a class to handle the parameters and options for MRMFeatureFilter.
Definition: MRMFeatureQC.h:61
~MRMFeatureQC()=default
Destructor.
String component_group_name
name of the component
Definition: MRMFeatureQC.h:255
std::vector< ComponentQCs > component_qcs
list of all component QCs
Definition: MRMFeatureQC.h:270
double rt_diff_l
retention time lower bound
Definition: MRMFeatureQC.h:263
double resolution_l
resolution lower bound
Definition: MRMFeatureQC.h:259
std::vector< ComponentGroupPairQCs > component_group_pair_qcs
list of all component group pair QCs
Definition: MRMFeatureQC.h:274
std::vector< ComponentGroupQCs > component_group_qcs
list of all component group QCs
Definition: MRMFeatureQC.h:272
double resolution_u
resolution upper bound
Definition: MRMFeatureQC.h:261
double rt_diff_u
retention time upper bound
Definition: MRMFeatureQC.h:265
String resolution_pair_name
name of the component to calculate the resolution or retention time
Definition: MRMFeatureQC.h:257
Quality Controls (QCs) for multiple components (between or within component_groups)
Definition: MRMFeatureQC.h:252
A more convenient string class.
Definition: String.h:61
int Int
Signed integer type.
Definition: Types.h:102
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Quality Controls (QCs) within a component group.
Definition: MRMFeatureQC.h:140
double ion_ratio_u
Definition: MRMFeatureQC.h:238
bool operator==(const ComponentGroupQCs &other) const
Definition: MRMFeatureQC.h:141
Int n_light_u
Definition: MRMFeatureQC.h:224
String component_group_name
name of the component group
Definition: MRMFeatureQC.h:203
Int n_light_l
Definition: MRMFeatureQC.h:223
bool operator!=(const ComponentGroupQCs &other) const
Definition: MRMFeatureQC.h:198
double intensity_u
intensity upper bound
Definition: MRMFeatureQC.h:212
Int n_transitions_l
Definition: MRMFeatureQC.h:231
Int n_heavy_l
number of heavy ion lower bound
Definition: MRMFeatureQC.h:220
double ion_ratio_l
Definition: MRMFeatureQC.h:237
Int n_identifying_l
Definition: MRMFeatureQC.h:229
double retention_time_l
retention time lower bound
Definition: MRMFeatureQC.h:206
double overall_quality_l
overall quality lower bound
Definition: MRMFeatureQC.h:214
Int n_identifying_u
Definition: MRMFeatureQC.h:230
Int n_quantifying_l
Definition: MRMFeatureQC.h:227
String ion_ratio_pair_name_2
Definition: MRMFeatureQC.h:236
Int n_quantifying_u
Definition: MRMFeatureQC.h:228
Int n_detecting_u
Definition: MRMFeatureQC.h:226
double retention_time_u
retention time upper bound
Definition: MRMFeatureQC.h:208
double overall_quality_u
overall quality upper bound
Definition: MRMFeatureQC.h:216
String ion_ratio_feature_name
Definition: MRMFeatureQC.h:239
std::map< String, std::pair< double, double > > meta_value_qc
Definition: MRMFeatureQC.h:240
Int n_heavy_u
number of heavy ion upper bound
Definition: MRMFeatureQC.h:222
double intensity_l
intensity lower bound
Definition: MRMFeatureQC.h:210
Int n_detecting_l
Definition: MRMFeatureQC.h:225
Int n_transitions_u
Definition: MRMFeatureQC.h:232
String ion_ratio_pair_name_1
Definition: MRMFeatureQC.h:235
Quality Controls (QCs) for individual components.
Definition: MRMFeatureQC.h:82
String component_name
name of the component
Definition: MRMFeatureQC.h:112
double intensity_u
intensity upper bound
Definition: MRMFeatureQC.h:122
bool operator==(const ComponentQCs &other) const
Definition: MRMFeatureQC.h:83
double retention_time_l
retention time lower bound
Definition: MRMFeatureQC.h:116
double overall_quality_l
overall quality lower bound
Definition: MRMFeatureQC.h:124
double retention_time_u
retention time upper bound
Definition: MRMFeatureQC.h:118
double overall_quality_u
overall quality upper bound
Definition: MRMFeatureQC.h:126
bool operator!=(const ComponentQCs &other) const
Definition: MRMFeatureQC.h:106
std::map< String, std::pair< double, double > > meta_value_qc
Feature MetaValues.
Definition: MRMFeatureQC.h:129
double intensity_l
intensity lower bound
Definition: MRMFeatureQC.h:120