OpenMS  3.0.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-2022.
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 
42 
43 namespace OpenMS
44 {
45 
58  class OPENMS_DLLAPI MRMFeatureQC
59  {
60 
61 public:
62 
64  MRMFeatureQC() = default;
66 
68  ~MRMFeatureQC() = default;
70 
71  // Members
72  //
79  struct ComponentQCs
80  {
81  bool operator==(const ComponentQCs& other) const {
82  bool members_eq =
83  std::tie(
84  component_name,
85  retention_time_l,
86  retention_time_u,
87  intensity_l,
88  intensity_u,
89  overall_quality_l,
90  overall_quality_u
91  ) == std::tie(
92  other.component_name,
93  other.retention_time_l,
94  other.retention_time_u,
95  other.intensity_l,
96  other.intensity_u,
97  other.overall_quality_l,
98  other.overall_quality_u
99  );
100  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); };
101  bool meta_values_eq = std::equal(meta_value_qc.begin(), meta_value_qc.end(), other.meta_value_qc.begin(), compare_maps);
102  return members_eq && meta_values_eq;
103  }
104  bool operator!=(const ComponentQCs& other) const
105  {
106  return !(*this == other);
107  }
108 
111 
112  // Feature members
114  double retention_time_l { 0.0 };
116  double retention_time_u { 1e12 };
118  double intensity_l { 0.0 };
120  double intensity_u { 1e12 };
122  double overall_quality_l { 0.0 };
124  double overall_quality_u { 1e12 };
125 
127  std::map<String,std::pair<double,double>> meta_value_qc;
128 
129  };
130 
138  {
139  bool operator==(const ComponentGroupQCs& other) const {
140  bool members_eq =
141  std::tie(
142  component_group_name,
143  retention_time_l,
144  retention_time_u,
145  intensity_l,
146  intensity_u,
147  overall_quality_l,
148  overall_quality_u,
149  n_heavy_l,
150  n_heavy_u,
151  n_light_l,
152  n_light_u,
153  n_detecting_l,
154  n_detecting_u,
155  n_quantifying_l,
156  n_quantifying_u,
157  n_identifying_l,
158  n_identifying_u,
159  n_transitions_l,
160  n_transitions_u,
161  ion_ratio_pair_name_1,
162  ion_ratio_pair_name_2,
163  ion_ratio_l,
164  ion_ratio_u,
165  ion_ratio_feature_name
166  ) == std::tie(
167  other.component_group_name,
168  other.retention_time_l,
169  other.retention_time_u,
170  other.intensity_l,
171  other.intensity_u,
172  other.overall_quality_l,
173  other.overall_quality_u,
174  other.n_heavy_l,
175  other.n_heavy_u,
176  other.n_light_l,
177  other.n_light_u,
178  other.n_detecting_l,
179  other.n_detecting_u,
180  other.n_quantifying_l,
181  other.n_quantifying_u,
182  other.n_identifying_l,
183  other.n_identifying_u,
184  other.n_transitions_l,
185  other.n_transitions_u,
186  other.ion_ratio_pair_name_1,
187  other.ion_ratio_pair_name_2,
188  other.ion_ratio_l,
189  other.ion_ratio_u,
191  );
192  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); };
193  bool meta_values_eq = std::equal(meta_value_qc.begin(), meta_value_qc.end(), other.meta_value_qc.begin(), compare_maps);
194  return members_eq && meta_values_eq;
195  }
196  bool operator!=(const ComponentGroupQCs& other) const
197  {
198  return !(*this == other);
199  }
202 
204  double retention_time_l { 0.0 };
206  double retention_time_u { 1e12 };
208  double intensity_l { 0.0 };
210  double intensity_u { 1e12 };
212  double overall_quality_l { 0.0 };
214  double overall_quality_u { 1e12 };
215 
216  // number of transitions and labels
218  Int n_heavy_l { 0 };
220  Int n_heavy_u { 100 };
221  Int n_light_l { 0 };
222  Int n_light_u { 100 };
223  Int n_detecting_l { 0 };
224  Int n_detecting_u { 100 };
225  Int n_quantifying_l { 0 };
226  Int n_quantifying_u { 100 };
227  Int n_identifying_l { 0 };
228  Int n_identifying_u { 100 };
229  Int n_transitions_l { 0 };
230  Int n_transitions_u { 100 };
231 
232  // Ion Ratio QCs
235  double ion_ratio_l { 0.0 };
236  double ion_ratio_u { 1e12 };
238  std::map<String,std::pair<double,double>> meta_value_qc;
239 
240  };
241 
250  {
251 
257  double resolution_l;
259  double resolution_u;
261  double rt_diff_l;
263  double rt_diff_u;
264  };
265 
266  //members
268  std::vector<ComponentQCs> component_qcs;
270  std::vector<ComponentGroupQCs> component_group_qcs;
272  std::vector<ComponentGroupPairQCs> component_group_pair_qcs;
273  };
274 }
275 
276 
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_light_l
Int n_light_l
Definition: MRMFeatureQC.h:221
OpenMS::MRMFeatureQC::ComponentGroupPairQCs::resolution_l
double resolution_l
resolution lower bound
Definition: MRMFeatureQC.h:257
OpenMS::MRMFeatureQC::ComponentGroupQCs::meta_value_qc
std::map< String, std::pair< double, double > > meta_value_qc
Definition: MRMFeatureQC.h:238
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_identifying_u
Int n_identifying_u
Definition: MRMFeatureQC.h:228
OpenMS::MRMFeatureQC::ComponentGroupPairQCs::resolution_u
double resolution_u
resolution upper bound
Definition: MRMFeatureQC.h:259
OpenMS::MRMFeatureQC::ComponentGroupPairQCs::rt_diff_u
double rt_diff_u
retention time upper bound
Definition: MRMFeatureQC.h:263
OpenMS::MRMFeatureQC::ComponentGroupQCs::intensity_l
double intensity_l
intensity lower bound
Definition: MRMFeatureQC.h:208
OpenMS::MRMFeatureQC::ComponentQCs::intensity_u
double intensity_u
intensity upper bound
Definition: MRMFeatureQC.h:120
OpenMS::MRMFeatureQC::ComponentGroupQCs::overall_quality_l
double overall_quality_l
overall quality lower bound
Definition: MRMFeatureQC.h:212
OpenMS::MRMFeatureQC::component_group_pair_qcs
std::vector< ComponentGroupPairQCs > component_group_pair_qcs
list of all component group pair QCs
Definition: MRMFeatureQC.h:272
OpenMS::MRMFeatureQC::ComponentGroupQCs::operator!=
bool operator!=(const ComponentGroupQCs &other) const
Definition: MRMFeatureQC.h:196
OpenMS::String
A more convenient string class.
Definition: String.h:58
Feature.h
OpenMS::MRMFeatureQC::component_group_qcs
std::vector< ComponentGroupQCs > component_group_qcs
list of all component group QCs
Definition: MRMFeatureQC.h:270
OpenMS::MRMFeatureQC::ComponentGroupQCs::ion_ratio_u
double ion_ratio_u
Definition: MRMFeatureQC.h:236
OpenMS::MRMFeatureQC::ComponentGroupPairQCs::rt_diff_l
double rt_diff_l
retention time lower bound
Definition: MRMFeatureQC.h:261
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_identifying_l
Int n_identifying_l
Definition: MRMFeatureQC.h:227
OpenMS::MRMFeatureQC::ComponentQCs::overall_quality_u
double overall_quality_u
overall quality upper bound
Definition: MRMFeatureQC.h:124
OpenMS::Int
int Int
Signed integer type.
Definition: Types.h:102
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::MRMFeatureQC
The MRMFeatureQC is a class to handle the parameters and options for MRMFeatureFilter.
Definition: MRMFeatureQC.h:58
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_detecting_u
Int n_detecting_u
Definition: MRMFeatureQC.h:224
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_detecting_l
Int n_detecting_l
Definition: MRMFeatureQC.h:223
OpenMS::MRMFeatureQC::ComponentGroupQCs::ion_ratio_feature_name
String ion_ratio_feature_name
Definition: MRMFeatureQC.h:237
OpenMS::MRMFeatureQC::ComponentQCs
Quality Controls (QCs) for individual components.
Definition: MRMFeatureQC.h:79
MRMFeature.h
OpenMS::MRMFeatureQC::ComponentGroupQCs::overall_quality_u
double overall_quality_u
overall quality upper bound
Definition: MRMFeatureQC.h:214
OpenMS::MRMFeatureQC::ComponentGroupQCs::component_group_name
String component_group_name
name of the component group
Definition: MRMFeatureQC.h:201
FeatureMap.h
OpenMS::MRMFeatureQC::ComponentGroupPairQCs::resolution_pair_name
String resolution_pair_name
name of the component to calculate the resolution or retention time
Definition: MRMFeatureQC.h:255
OpenMS::MRMFeatureQC::ComponentGroupQCs
Quality Controls (QCs) within a component group.
Definition: MRMFeatureQC.h:137
OpenMS::MRMFeatureQC::ComponentGroupQCs::operator==
bool operator==(const ComponentGroupQCs &other) const
Definition: MRMFeatureQC.h:139
OpenMS::MRMFeatureQC::ComponentGroupQCs::ion_ratio_pair_name_2
String ion_ratio_pair_name_2
Definition: MRMFeatureQC.h:234
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_quantifying_l
Int n_quantifying_l
Definition: MRMFeatureQC.h:225
OpenMS::MRMFeatureQC::ComponentGroupQCs::intensity_u
double intensity_u
intensity upper bound
Definition: MRMFeatureQC.h:210
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_transitions_l
Int n_transitions_l
Definition: MRMFeatureQC.h:229
OpenMS::MRMFeatureQC::ComponentQCs::operator==
bool operator==(const ComponentQCs &other) const
Definition: MRMFeatureQC.h:81
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_heavy_u
Int n_heavy_u
number of heavy ion upper bound
Definition: MRMFeatureQC.h:220
OpenMS::MRMFeatureQC::component_qcs
std::vector< ComponentQCs > component_qcs
list of all component QCs
Definition: MRMFeatureQC.h:268
OpenMS::MRMFeatureQC::ComponentQCs::overall_quality_l
double overall_quality_l
overall quality lower bound
Definition: MRMFeatureQC.h:122
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_quantifying_u
Int n_quantifying_u
Definition: MRMFeatureQC.h:226
OpenMS::MRMFeatureQC::ComponentQCs::intensity_l
double intensity_l
intensity lower bound
Definition: MRMFeatureQC.h:118
OpenMS::MRMFeatureQC::ComponentQCs::retention_time_u
double retention_time_u
retention time upper bound
Definition: MRMFeatureQC.h:116
OpenMS::MRMFeatureQC::ComponentGroupQCs::ion_ratio_pair_name_1
String ion_ratio_pair_name_1
Definition: MRMFeatureQC.h:233
String.h
OpenMS::MRMFeatureQC::ComponentGroupQCs::retention_time_u
double retention_time_u
retention time upper bound
Definition: MRMFeatureQC.h:206
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_light_u
Int n_light_u
Definition: MRMFeatureQC.h:222
OpenMS::MRMFeatureQC::ComponentQCs::component_name
String component_name
name of the component
Definition: MRMFeatureQC.h:110
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_transitions_u
Int n_transitions_u
Definition: MRMFeatureQC.h:230
OpenMS::MRMFeatureQC::ComponentQCs::retention_time_l
double retention_time_l
retention time lower bound
Definition: MRMFeatureQC.h:114
OpenMS::MRMFeatureQC::ComponentGroupPairQCs
Quality Controls (QCs) for multiple components (between or within component_groups)
Definition: MRMFeatureQC.h:249
OpenMS::MRMFeatureQC::ComponentGroupQCs::ion_ratio_l
double ion_ratio_l
Definition: MRMFeatureQC.h:235
OpenMS::MRMFeatureQC::ComponentQCs::operator!=
bool operator!=(const ComponentQCs &other) const
Definition: MRMFeatureQC.h:104
OpenMS::MRMFeatureQC::ComponentQCs::meta_value_qc
std::map< String, std::pair< double, double > > meta_value_qc
Feature MetaValues.
Definition: MRMFeatureQC.h:127
OpenMS::MRMFeatureQC::ComponentGroupPairQCs::component_group_name
String component_group_name
name of the component
Definition: MRMFeatureQC.h:253
OpenMS::MRMFeatureQC::ComponentGroupQCs::retention_time_l
double retention_time_l
retention time lower bound
Definition: MRMFeatureQC.h:204
OpenMS::MRMFeatureQC::ComponentGroupQCs::n_heavy_l
Int n_heavy_l
number of heavy ion lower bound
Definition: MRMFeatureQC.h:218