OpenMS
MetaboliteFeatureDeconvolution.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Fabian Aicheler $
6 // $Authors: $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 // OpenMS
17 
19 
20 #include <map>
21 
22 namespace OpenMS
23 {
24 
25  class Compomer;
26 
35  class OPENMS_DLLAPI MetaboliteFeatureDeconvolution :
36  public DefaultParamHandler
37  {
38 public:
39 
40  enum CHARGEMODE {QFROMFEATURE = 1, QHEURISTIC, QALL};
41 
45 
51 
54 
57 
61 
72  void compute(const FeatureMap& fm_in, FeatureMap& fm_out, ConsensusMap& cons_map, ConsensusMap& cons_map_p);
73 
74 
75 protected:
76 
77 
78  void updateMembers_() override;
79 
85  struct CmpInfo_;
86 
87  /*
88  @brief test for obviously wrong parameter settings and warn
89 
90  Currently supports the following scenarios:
91  * 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)
92  When more than 5% of the cf's look like this, we report it.
93 
94  */
95  void checkSolution_(const ConsensusMap& cons_map) const;
96 
101  void inferMoreEdges_(PairsType& edges, std::map<Size, std::set<CmpInfo_>>& feature_adducts);
102 
103  void candidateEdges_(FeatureMap& fm_out, const Adduct& default_adduct, PairsType& feature_relation, std::map<Size, std::set<CmpInfo_>>& feature_adducts);
104 
105  void annotate_feature_(FeatureMap& fm_out, Adduct& default_adduct, Compomer& c, const Size f_idx, const UInt side, const Int new_q, const Int old_q);
106 
108  void printEdgesOfConnectedFeatures_(Size idx_1, Size idx_2, const PairsType& feature_relation);
109 
116  inline bool intensityFilterPassed_(const Int q1, const Int q2, const Compomer& cmp, const Feature& f1, const Feature& f2) const;
117 
124  bool chargeTestworthy_(const Int feature_charge, const Int putative_charge, const bool other_unchanged) const;
125 
129  std::map<Size, String> map_label_;
131  std::map<String, Size> map_label_inverse_;
140 
141  };
142 } // namespace OpenMS
Definition: Adduct.h:19
Holds information on an edge connecting two features from a (putative) charge ladder.
Definition: Compomer.h:33
A container for consensus elements.
Definition: ConsensusMap.h:66
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
A container for features.
Definition: FeatureMap.h:80
An LC-MS feature.
Definition: Feature.h:46
std::vector< ChargePair > PairsType
Definition: ILPDCWrapper.h:29
Adduct::AdductsType AdductsType
Definition: MassExplainer.h:33
An algorithm to decharge small molecule features (i.e. as found by FeatureFinder).
Definition: MetaboliteFeatureDeconvolution.h:37
void candidateEdges_(FeatureMap &fm_out, const Adduct &default_adduct, PairsType &feature_relation, std::map< Size, std::set< CmpInfo_ >> &feature_adducts)
MetaboliteFeatureDeconvolution()
default constructor
~MetaboliteFeatureDeconvolution() override
destructor
bool intensityFilterPassed_(const Int q1, const Int q2, const Compomer &cmp, const Feature &f1, const Feature &f2) const
returns true if the intensity filter was passed or switched off
bool chargeTestworthy_(const Int feature_charge, const Int putative_charge, const bool other_unchanged) const
determines if we should test a putative feature charge
DPosition< 2 > ClusterPointType
Definition: MetaboliteFeatureDeconvolution.h:42
void compute(const FeatureMap &fm_in, FeatureMap &fm_out, ConsensusMap &cons_map, ConsensusMap &cons_map_p)
Compute a zero-charge feature map from a set of charged features.
bool enable_intensity_filter_
status of intensity filter for edges
Definition: MetaboliteFeatureDeconvolution.h:133
void checkSolution_(const ConsensusMap &cons_map) const
CHARGEMODE
Definition: MetaboliteFeatureDeconvolution.h:40
CHARGEMODE q_try_
status of charge discovery
Definition: MetaboliteFeatureDeconvolution.h:137
std::map< Size, String > map_label_
labeling table
Definition: MetaboliteFeatureDeconvolution.h:129
Feature::CoordinateType CoordinateType
Definition: MetaboliteFeatureDeconvolution.h:43
void inferMoreEdges_(PairsType &edges, std::map< Size, std::set< CmpInfo_ >> &feature_adducts)
MetaboliteFeatureDeconvolution(const MetaboliteFeatureDeconvolution &source)
Copy constructor.
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
bool negative_mode_
status of ionization mode
Definition: MetaboliteFeatureDeconvolution.h:135
MassExplainer::AdductsType potential_adducts_
List of adducts used to explain mass differences.
Definition: MetaboliteFeatureDeconvolution.h:127
std::map< String, Size > map_label_inverse_
labeling table inverse
Definition: MetaboliteFeatureDeconvolution.h:131
MetaboliteFeatureDeconvolution & operator=(const MetaboliteFeatureDeconvolution &source)
Assignment operator.
Int verbose_level_
amount of debug information displayed
Definition: MetaboliteFeatureDeconvolution.h:139
void printEdgesOfConnectedFeatures_(Size idx_1, Size idx_2, const PairsType &feature_relation)
A function mostly for debugging.
ILPDCWrapper::PairsType PairsType
Definition: MetaboliteFeatureDeconvolution.h:44
void annotate_feature_(FeatureMap &fm_out, Adduct &default_adduct, Compomer &c, const Size f_idx, const UInt side, const Int new_q, const Int old_q)
double CoordinateType
Coordinate type (of the position)
Definition: Peak2D.h:38
int Int
Signed integer type.
Definition: Types.h:72
unsigned int UInt
Unsigned integer type.
Definition: Types.h:64
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
const double c
Definition: Constants.h:188
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19