OpenMS  2.4.0
MRMFeatureFilter.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-2018.
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, Pasquale Domenico Colaianni $
32 // $Authors: Douglas McCloskey, Pasquale Domenico Colaianni $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
40 
42 #include <OpenMS/KERNEL/Feature.h>
44 #include <OpenMS/FORMAT/QcMLFile.h>
45 
49 
50 namespace OpenMS
51 {
52 
61  class OPENMS_DLLAPI MRMFeatureFilter :
62  public DefaultParamHandler
63  {
64 
65 public:
66 
70 
72  ~MRMFeatureFilter() override;
74 
76  void updateMembers_() override;
77 
86  void FilterFeatureMap(FeatureMap& features, const MRMFeatureQC& filter_criteria,
87  const TargetedExperiment & transitions);
88 
96  void FeatureMapToAttachment(FeatureMap& features, QcMLFile::Attachment& attachment);
97 
108  double calculateIonRatio(const Feature & component_1, const Feature & component_2, const String & feature_name);
109 
118  double calculateRTDifference(Feature & component_1, Feature & component_2);
119 
128  double calculateResolution(Feature & component_1, Feature & component_2);
129 
141  bool checkMetaValue(
142  const Feature & component,
143  const String & meta_value_key,
144  const double & meta_value_l,
145  const double & meta_value_u,
146  bool & key_exists
147  ) const;
148 
157  std::map<String,int> countLabelsAndTransitionTypes(const Feature & component_group,
158  const TargetedExperiment & transitions);
159 
168  String uniqueJoin(std::vector<String>& str_vec, String& delim);
169 
170 private:
171  template <typename T>
172  bool checkRange(const T& value, const T& value_l, const T& value_u) const;
173 
174  // Members
175 
187  std::map<String,std::vector<QcMLFile::QualityParameter>> component_group_qc_report_;
189  std::map<String,std::vector<QcMLFile::QualityParameter>> component_qc_report_;
191  std::map<std::vector<String>,std::vector<QcMLFile::QualityParameter>> multi_component_group_qc_report_;
192  };
193 }
194 
A more convenient string class.
Definition: String.h:57
A container for features.
Definition: FeatureMap.h:93
bool report_xic_
include the data points for the extracted ion chromatogram (XIC) in the attachment ...
Definition: MRMFeatureFilter.h:179
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
FeatureMap features_
FeatureMap.
Definition: MRMFeatureFilter.h:185
Representation of an attachment.
Definition: QcMLFile.h:90
QcMLFile::Attachment attachment_
qcMLFile Attachment
Definition: MRMFeatureFilter.h:183
std::map< String, std::vector< QcMLFile::QualityParameter > > component_qc_report_
component/transition QCs
Definition: MRMFeatureFilter.h:189
The MRMFeatureQC is a class to handle the parameters and options for MRMFeatureFilter.
Definition: MRMFeatureQC.h:60
An LC-MS feature.
Definition: Feature.h:70
String flag_or_filter_
flag or filter (i.e., remove) features that do not pass the QC
Definition: MRMFeatureFilter.h:177
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:64
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
The MRMFeatureFilter either flags components and/or transitions that do not pass the QC criteria or f...
Definition: MRMFeatureFilter.h:61
bool report_tic_
include the data points for the total ion chromatogram (TIC) in the attachment
Definition: MRMFeatureFilter.h:181
std::map< std::vector< String >, std::vector< QcMLFile::QualityParameter > > multi_component_group_qc_report_
multi transition QCs
Definition: MRMFeatureFilter.h:191
std::map< String, std::vector< QcMLFile::QualityParameter > > component_group_qc_report_
component group/peptide/compound QCs
Definition: MRMFeatureFilter.h:187