1
// -*- mode: C++; tab-width: 2; -*-
4
// --------------------------------------------------------------------------
5
// OpenMS Mass Spectrometry Framework
6
// --------------------------------------------------------------------------
7
// Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
9
// This library is free software; you can redistribute it and/or
10
// modify it under the terms of the GNU Lesser General Public
11
// License as published by the Free Software Foundation; either
12
// version 2.1 of the License, or (at your option) any later version.
14
// This library is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
// Lesser General Public License for more details.
19
// You should have received a copy of the GNU Lesser General Public
20
// License along with this library; if not, write to the Free Software
21
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
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-2013.
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.
23
30
// --------------------------------------------------------------------------
24
31
// $Maintainer: Chris Bielow $
44
51
@brief An algorithm to decharge features (i.e. as found by FeatureFinder).
46
@htmlinclude OpenMS_FeatureDeconvolution.parameters
53
@htmlinclude OpenMS_FeatureDeconvolution.parameters
51
class OPENMS_DLLAPI FeatureDeconvolution : public DefaultParamHandler
58
class OPENMS_DLLAPI FeatureDeconvolution :
59
public DefaultParamHandler
55
enum CHARGEMODE {QFROMFEATURE=1,QHEURISTIC,QALL};
57
typedef FeatureMap<> FeatureMapType;
58
typedef Feature FeatureType;
59
typedef DPosition<2> ClusterPointType;
60
typedef FeatureMapType::FeatureType::CoordinateType CoordinateType;
61
typedef ILPDCWrapper::PairsType PairsType;
63
/** @name Constructors and Destructor s
66
/// default constructor
67
FeatureDeconvolution();
70
FeatureDeconvolution(const FeatureDeconvolution& source);
72
/// Assignment operator
73
FeatureDeconvolution& operator=(const FeatureDeconvolution& source);
76
virtual ~FeatureDeconvolution();
80
@brief Compute a zero-charge feature map from a set of charged features
82
Find putative ChargePairs, then score them and hand over to ILP.
84
@param fm_in Input feature-map
85
@param fm_out Output feature-map (sorted by position and augmented with user params)
86
@param cons_map [out] Output of grouped features belonging to a charge group
87
@param cons_map_p [out] Output of paired features connected by an edge
89
void compute(const FeatureMapType &fm_in, FeatureMapType &fm_out, ConsensusMap &cons_map, ConsensusMap &cons_map_p);
93
void updateMembers_();
96
@brief 1-sided Compomer for a feature
98
Holds information on an explicit (with H+) 1-sided Compomer of a feature.
103
@brief test for obviously wrong parameter settings and warn
105
Currently supports the following scenarios:
106
* 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)
107
When more than 5% of the cf's look like this, we report it.
110
void checkSolution_(const ConsensusMap &cons_map) const;
112
/// test if "simple" edges have alternative
113
/// (more difficult explanation) supported by neighboring edges
114
/// e.g. (.) -> (H+) might be augmented to
116
void inferMoreEdges_(PairsType& edges, Map<Size, std::set<CmpInfo_> >& feature_adducts);
118
/// A function mostly for debugging
119
void printEdgesOfConnectedFeatures_(Size idx_1, Size idx_2, const PairsType& feature_relation);
122
@brief returns true if the intensity filter was passed or switched off
124
Filter for adding an edge only when the two features connected by it, fulfill the
128
inline bool intensityFilterPassed_(const Int q1, const Int q2, const Compomer& cmp,const FeatureType& f1,const FeatureType& f2);
131
@brief determines if we should test a putative feature charge
133
Answer query given the internal status of @em q_try.
134
Features with q<=0 always return true.
137
bool chargeTestworthy_(const Int feature_charge, const Int putative_charge, const bool other_unchanged) const;
139
/// List of adducts used to explain mass differences
140
MassExplainer::AdductsType potential_adducts_;
142
Map<Size, String> map_label_;
143
/// labeling table inverse
144
Map<String, Size> map_label_inverse_;
145
/// status of intensity filter for edges
146
bool enable_intensity_filter_;
147
/// status of charge discovery
149
/// amount of debug information displayed
63
enum CHARGEMODE {QFROMFEATURE = 1, QHEURISTIC, QALL};
65
typedef FeatureMap<> FeatureMapType;
66
typedef Feature FeatureType;
67
typedef DPosition<2> ClusterPointType;
68
typedef FeatureMapType::FeatureType::CoordinateType CoordinateType;
69
typedef ILPDCWrapper::PairsType PairsType;
71
/** @name Constructors and Destructor s
74
/// default constructor
75
FeatureDeconvolution();
78
FeatureDeconvolution(const FeatureDeconvolution & source);
80
/// Assignment operator
81
FeatureDeconvolution & operator=(const FeatureDeconvolution & source);
84
virtual ~FeatureDeconvolution();
88
@brief Compute a zero-charge feature map from a set of charged features
90
Find putative ChargePairs, then score them and hand over to ILP.
92
@param fm_in Input feature-map
93
@param fm_out Output feature-map (sorted by position and augmented with user params)
94
@param cons_map [out] Output of grouped features belonging to a charge group
95
@param cons_map_p [out] Output of paired features connected by an edge
97
void compute(const FeatureMapType & fm_in, FeatureMapType & fm_out, ConsensusMap & cons_map, ConsensusMap & cons_map_p);
101
void updateMembers_();
104
@brief 1-sided Compomer for a feature
106
Holds information on an explicit (with H+) 1-sided Compomer of a feature.
111
@brief test for obviously wrong parameter settings and warn
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.
118
void checkSolution_(const ConsensusMap & cons_map) const;
120
/// test if "simple" edges have alternative
121
/// (more difficult explanation) supported by neighboring edges
122
/// e.g. (.) -> (H+) might be augmented to
124
void inferMoreEdges_(PairsType & edges, Map<Size, std::set<CmpInfo_> > & feature_adducts);
126
/// A function mostly for debugging
127
void printEdgesOfConnectedFeatures_(Size idx_1, Size idx_2, const PairsType & feature_relation);
130
@brief returns true if the intensity filter was passed or switched off
132
Filter for adding an edge only when the two features connected by it, fulfill the
136
inline bool intensityFilterPassed_(const Int q1, const Int q2, const Compomer & cmp, const FeatureType & f1, const FeatureType & f2);
139
@brief determines if we should test a putative feature charge
141
Answer query given the internal status of @em q_try.
142
Features with q<=0 always return true.
145
bool chargeTestworthy_(const Int feature_charge, const Int putative_charge, const bool other_unchanged) const;
147
/// List of adducts used to explain mass differences
148
MassExplainer::AdductsType potential_adducts_;
150
Map<Size, String> map_label_;
151
/// labeling table inverse
152
Map<String, Size> map_label_inverse_;
153
/// status of intensity filter for edges
154
bool enable_intensity_filter_;
155
/// status of charge discovery
157
/// amount of debug information displayed
153
161
} // namespace OpenMS
155
163
#endif // OPENMS_ANALYSIS_DECHARGING_FEATUREDECONVOLUTION_H