OpenMS  3.0.0
FeatureDeconvolution.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: Chris Bielow $
32 // $Authors: $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
37 // OpenMS
43 
45 #include <map>
46 
47 namespace OpenMS
48 {
49 
50  class Compomer;
51 
60  class OPENMS_DLLAPI FeatureDeconvolution :
61  public DefaultParamHandler
62  {
63 public:
64 
65  enum CHARGEMODE {QFROMFEATURE = 1, QHEURISTIC, QALL};
66 
70 
76 
79 
81  FeatureDeconvolution& operator=(const FeatureDeconvolution& source);
82 
84  ~FeatureDeconvolution() override;
86 
97  void compute(const FeatureMap& fm_in, FeatureMap& fm_out, ConsensusMap& cons_map, ConsensusMap& cons_map_p);
98 
99 protected:
100 
101  void updateMembers_() override;
102 
108  struct CmpInfo_;
109 
110  /*
111  @brief test for obviously wrong parameter settings and warn
112 
113  Currently supports the following scenarios:
114  * If the lower charge bound is too high, consensus features with gapped, even charges will occur (e.g. 30,32,34), instead of the true (15,16,17)
115  When more than 5% of the cf's look like this, we report it.
116 
117  */
118  void checkSolution_(const ConsensusMap& cons_map) const;
119 
124  void inferMoreEdges_(PairsType& edges, std::map<Size, std::set<CmpInfo_> >& feature_adducts);
125 
127  void printEdgesOfConnectedFeatures_(Size idx_1, Size idx_2, const PairsType& feature_relation);
128 
135  inline bool intensityFilterPassed_(const Int q1, const Int q2, const Compomer& cmp, const Feature& f1, const Feature& f2) const;
136 
143  bool chargeTestworthy_(const Int feature_charge, const Int putative_charge, const bool other_unchanged) const;
144 
148  std::map<Size, String> map_label_;
150  std::map<String, Size> map_label_inverse_;
157 
158  };
159 } // namespace OpenMS
DefaultParamHandler.h
OpenMS::FeatureDeconvolution::PairsType
ILPDCWrapper::PairsType PairsType
Definition: FeatureDeconvolution.h:69
OpenMS::FeatureDeconvolution
An algorithm to decharge features (i.e. as found by FeatureFinder).
Definition: FeatureDeconvolution.h:60
double
DPosition.h
OpenMS::ILPDCWrapper::PairsType
std::vector< ChargePair > PairsType
Definition: ILPDCWrapper.h:55
ILPDCWrapper.h
ConsensusMap.h
OpenMS::Size
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
OpenMS::FeatureDeconvolution::CHARGEMODE
CHARGEMODE
Definition: FeatureDeconvolution.h:65
OpenMS::DefaultParamHandler
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:92
OpenMS::Compomer
Holds information on an edge connecting two features from a (putative) charge ladder.
Definition: Compomer.h:58
OpenMS::Int
int Int
Signed integer type.
Definition: Types.h:102
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::FeatureDeconvolution::ClusterPointType
DPosition< 2 > ClusterPointType
Definition: FeatureDeconvolution.h:67
FeatureMap.h
OpenMS::FeatureDeconvolution::q_try_
CHARGEMODE q_try_
status of charge discovery
Definition: FeatureDeconvolution.h:154
OpenMS::FeatureDeconvolution::QHEURISTIC
Definition: FeatureDeconvolution.h:65
OpenMS::FeatureDeconvolution::verbose_level_
Int verbose_level_
amount of debug information displayed
Definition: FeatureDeconvolution.h:156
OpenMS::MassExplainer::AdductsType
Adduct::AdductsType AdductsType
Definition: MassExplainer.h:59
OpenMS::FeatureDeconvolution::potential_adducts_
MassExplainer::AdductsType potential_adducts_
List of adducts used to explain mass differences.
Definition: FeatureDeconvolution.h:146
OpenMS::FeatureDeconvolution::CoordinateType
Feature::CoordinateType CoordinateType
Definition: FeatureDeconvolution.h:68
OpenMS::ConsensusMap
A container for consensus elements.
Definition: ConsensusMap.h:82
OpenMS::DPosition< 2 >
OpenMS::FeatureDeconvolution::enable_intensity_filter_
bool enable_intensity_filter_
status of intensity filter for edges
Definition: FeatureDeconvolution.h:152
OpenMS::FeatureDeconvolution::map_label_inverse_
std::map< String, Size > map_label_inverse_
labeling table inverse
Definition: FeatureDeconvolution.h:150
OpenMS::FeatureMap
A container for features.
Definition: FeatureMap.h:98
OpenMS::Feature
An LC-MS feature.
Definition: Feature.h:70
OpenMS::FeatureDeconvolution::map_label_
std::map< Size, String > map_label_
labeling table
Definition: FeatureDeconvolution.h:148
MassExplainer.h