| OpenMS 2.5.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-2020.
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
37 #include <OpenMS/ANALYSIS/OPENSWATH/MRMFeatureQC.h>
38 #include <OpenMS/ANALYSIS/TARGETED/TargetedExperiment.h>
39 #include <OpenMS/FORMAT/TraMLFile.h>
40
41 #include <OpenMS/KERNEL/MRMFeature.h>
42 #include <OpenMS/KERNEL/Feature.h>
43 #include <OpenMS/KERNEL/FeatureMap.h>
44 #include <OpenMS/FORMAT/QcMLFile.h>
45
46 #include <OpenMS/DATASTRUCTURES/DefaultParamHandler.h>
47 #include <OpenMS/DATASTRUCTURES/String.h>
48 #include <OpenMS/CONCEPT/LogStream.h>
49
50 namespace OpenMS
51 {
52
61 class OPENMS_DLLAPI MRMFeatureFilter :
62 public DefaultParamHandler
63 {
64
65 public:
66
68 MRMFeatureFilter();
70
72 ~MRMFeatureFilter() override;
74
80 void getDefaultParameters(Param& params) const;
81
83 void updateMembers_() override;
84
93 void FilterFeatureMap(FeatureMap& features, const MRMFeatureQC& filter_criteria,
94 const TargetedExperiment & transitions);
95
103 void FeatureMapToAttachment(FeatureMap& features, QcMLFile::Attachment& attachment);
104
115 double calculateIonRatio(const Feature & component_1, const Feature & component_2, const String & feature_name);
116
125 double calculateRTDifference(Feature & component_1, Feature & component_2);
126
135 double calculateResolution(Feature & component_1, Feature & component_2);
136
148 bool checkMetaValue(
149 const Feature & component,
150 const String & meta_value_key,
151 const double & meta_value_l,
152 const double & meta_value_u,
153 bool & key_exists
154 ) const;
155
164 std::map<String,int> countLabelsAndTransitionTypes(const Feature & component_group,
165 const TargetedExperiment & transitions);
166
174 StringList getUniqueSorted(const StringList& messages) const;
175
176 private:
177 template <typename T>
178 bool checkRange(const T& value, const T& value_l, const T& value_u) const;
179
180 // Members
181
183 String flag_or_filter_;
185 bool report_xic_;
187 bool report_tic_;
189 QcMLFile::Attachment attachment_;
191 FeatureMap features_;
193 std::map<String,std::vector<QcMLFile::QualityParameter>> component_group_qc_report_;
195 std::map<String,std::vector<QcMLFile::QualityParameter>> component_qc_report_;
197 std::map<std::vector<String>,std::vector<QcMLFile::QualityParameter>> multi_component_group_qc_report_;
198 };
199 }
200
OpenMS::Feature
An LC-MS feature.
Definition: Feature.h:70
MRMFeatureQC.h
QcMLFile.h
OpenMS::MRMFeatureFilter::report_tic_
bool report_tic_
include the data points for the total ion chromatogram (TIC) in the attachment
Definition: MRMFeatureFilter.h:187
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::MRMFeatureFilter::flag_or_filter_
String flag_or_filter_
flag or filter (i.e., remove) features that do not pass the QC
Definition: MRMFeatureFilter.h:183
OpenMS::DefaultParamHandler
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:91
TargetedExperiment.h
Feature.h
TraMLFile.h
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:95
OpenMS::MRMFeatureFilter::multi_component_group_qc_report_
std::map< std::vector< String >, std::vector< QcMLFile::QualityParameter > > multi_component_group_qc_report_
multi transition QCs
Definition: MRMFeatureFilter.h:197
OpenMS::MRMFeatureFilter::attachment_
QcMLFile::Attachment attachment_
qcMLFile Attachment
Definition: MRMFeatureFilter.h:189
OpenMS::MRMFeatureFilter::features_
FeatureMap features_
FeatureMap.
Definition: MRMFeatureFilter.h:191
FeatureMap.h
String.h
OpenMS::TargetedExperiment
A description of a targeted experiment containing precursor and production ions.
Definition: TargetedExperiment.h:64
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
OpenMS::MRMFeatureFilter::report_xic_
bool report_xic_
include the data points for the extracted ion chromatogram (XIC) in the attachment ...
Definition: MRMFeatureFilter.h:185
OpenMS::QcMLFile::Attachment
Representation of an attachment.
Definition: QcMLFile.h:90
LogStream.h
DefaultParamHandler.h
MRMFeature.h
OpenMS::Param
Management and storage of parameters / INI files.
Definition: Param.h:73
OpenMS::MRMFeatureFilter::component_qc_report_
std::map< String, std::vector< QcMLFile::QualityParameter > > component_qc_report_
component/transition QCs
Definition: MRMFeatureFilter.h:195
OpenMS::StringList
std::vector< String > StringList
Vector of String.
Definition: ListUtils.h:70
OpenMS::MRMFeatureFilter
The MRMFeatureFilter either flags components and/or transitions that do not pass the QC criteria or f...
Definition: MRMFeatureFilter.h:61
OpenMS::MRMFeatureQC
The MRMFeatureQC is a class to handle the parameters and options for MRMFeatureFilter.
Definition: MRMFeatureQC.h:60
OpenMS::MRMFeatureFilter::component_group_qc_report_
std::map< String, std::vector< QcMLFile::QualityParameter > > component_group_qc_report_
component group/peptide/compound QCs
Definition: MRMFeatureFilter.h:193