OpenMS  2.8.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 
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 
The MRMFeatureQC is a class to handle the parameters and options for MRMFeatureFilter.
Definition: MRMFeatureQC.h:59
~MRMFeatureQC()=default
Destructor.
String component_group_name
name of the component
Definition: MRMFeatureQC.h:253
std::vector< ComponentQCs > component_qcs
list of all component QCs
Definition: MRMFeatureQC.h:268
double rt_diff_l
retention time lower bound
Definition: MRMFeatureQC.h:261
double resolution_l
resolution lower bound
Definition: MRMFeatureQC.h:257
std::vector< ComponentGroupPairQCs > component_group_pair_qcs
list of all component group pair QCs
Definition: MRMFeatureQC.h:272
std::vector< ComponentGroupQCs > component_group_qcs
list of all component group QCs
Definition: MRMFeatureQC.h:270
double resolution_u
resolution upper bound
Definition: MRMFeatureQC.h:259
double rt_diff_u
retention time upper bound
Definition: MRMFeatureQC.h:263
String resolution_pair_name
name of the component to calculate the resolution or retention time
Definition: MRMFeatureQC.h:255
Quality Controls (QCs) for multiple components (between or within component_groups)
Definition: MRMFeatureQC.h:250
A more convenient string class.
Definition: String.h:60
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:138
double ion_ratio_u
Definition: MRMFeatureQC.h:236
bool operator==(const ComponentGroupQCs &other) const
Definition: MRMFeatureQC.h:139
Int n_light_u
Definition: MRMFeatureQC.h:222
String component_group_name
name of the component group
Definition: MRMFeatureQC.h:201
Int n_light_l
Definition: MRMFeatureQC.h:221
bool operator!=(const ComponentGroupQCs &other) const
Definition: MRMFeatureQC.h:196
double intensity_u
intensity upper bound
Definition: MRMFeatureQC.h:210
Int n_transitions_l
Definition: MRMFeatureQC.h:229
Int n_heavy_l
number of heavy ion lower bound
Definition: MRMFeatureQC.h:218
double ion_ratio_l
Definition: MRMFeatureQC.h:235
Int n_identifying_l
Definition: MRMFeatureQC.h:227
double retention_time_l
retention time lower bound
Definition: MRMFeatureQC.h:204
double overall_quality_l
overall quality lower bound
Definition: MRMFeatureQC.h:212
Int n_identifying_u
Definition: MRMFeatureQC.h:228
Int n_quantifying_l
Definition: MRMFeatureQC.h:225
String ion_ratio_pair_name_2
Definition: MRMFeatureQC.h:234
Int n_quantifying_u
Definition: MRMFeatureQC.h:226
Int n_detecting_u
Definition: MRMFeatureQC.h:224
double retention_time_u
retention time upper bound
Definition: MRMFeatureQC.h:206
double overall_quality_u
overall quality upper bound
Definition: MRMFeatureQC.h:214
String ion_ratio_feature_name
Definition: MRMFeatureQC.h:237
std::map< String, std::pair< double, double > > meta_value_qc
Definition: MRMFeatureQC.h:238
Int n_heavy_u
number of heavy ion upper bound
Definition: MRMFeatureQC.h:220
double intensity_l
intensity lower bound
Definition: MRMFeatureQC.h:208
Int n_detecting_l
Definition: MRMFeatureQC.h:223
Int n_transitions_u
Definition: MRMFeatureQC.h:230
String ion_ratio_pair_name_1
Definition: MRMFeatureQC.h:233
Quality Controls (QCs) for individual components.
Definition: MRMFeatureQC.h:80
String component_name
name of the component
Definition: MRMFeatureQC.h:110
double intensity_u
intensity upper bound
Definition: MRMFeatureQC.h:120
bool operator==(const ComponentQCs &other) const
Definition: MRMFeatureQC.h:81
double retention_time_l
retention time lower bound
Definition: MRMFeatureQC.h:114
double overall_quality_l
overall quality lower bound
Definition: MRMFeatureQC.h:122
double retention_time_u
retention time upper bound
Definition: MRMFeatureQC.h:116
double overall_quality_u
overall quality upper bound
Definition: MRMFeatureQC.h:124
bool operator!=(const ComponentQCs &other) const
Definition: MRMFeatureQC.h:104
std::map< String, std::pair< double, double > > meta_value_qc
Feature MetaValues.
Definition: MRMFeatureQC.h:127
double intensity_l
intensity lower bound
Definition: MRMFeatureQC.h:118