Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
QTClusterFinder.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-2015.
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: Hendrik Weisser $
32 // $Authors: Steffen Sass, Hendrik Weisser $
33 // --------------------------------------------------------------------------
34 
35 
36 #ifndef OPENMS_ANALYSIS_MAPMATCHING_QTCLUSTERFINDER_H
37 #define OPENMS_ANALYSIS_MAPMATCHING_QTCLUSTERFINDER_H
38 
45 
46 #include <boost/unordered_map.hpp>
47 
48 namespace OpenMS
49 {
50 
83  class OPENMS_DLLAPI QTClusterFinder :
84  public BaseGroupFinder
85  {
86 private:
87 
89  typedef OpenMSBoost::unordered_map<std::pair<GridFeature*, GridFeature*>,
90  double> PairDistances;
91 
93  typedef OpenMSBoost::unordered_map<GridFeature*,
94  std::vector<QTCluster*> > ElementMapping;
95 
97 
100 
102  bool use_IDs_;
103 
105  double max_diff_rt_;
106 
108  double max_diff_mz_;
109 
112 
118  PairDistances distances_;
119 
125  double getDistance_(GridFeature* left, GridFeature* right);
126 
132  bool compatibleIDs_(QTCluster& cluster, const GridFeature* neighbor);
133 
135  void setParameters_(double max_intensity, double max_mz);
136 
138  void makeConsensusFeature_(std::list<QTCluster>& clustering,
139  ConsensusFeature& feature,
140  ElementMapping& element_mapping);
141 
143  void computeClustering_(Grid& grid, std::list<QTCluster>& clustering);
144 
146  template <typename MapType>
147  void run_(const std::vector<MapType>& input_maps, ConsensusMap& result_map);
148 
149 protected:
150  enum
151  {
154  };
155 
156 public:
158  QTClusterFinder();
159 
161  virtual ~QTClusterFinder();
162 
164  static const String getProductName()
165  {
166  return "qt";
167  }
168 
176  void run(const std::vector<ConsensusMap>& input_maps,
177  ConsensusMap& result_map);
178 
186  void run(const std::vector<FeatureMap>& input_maps,
187  ConsensusMap& result_map);
188 
191  {
192  return new QTClusterFinder();
193  }
194 
195  };
196 
197 }
198 
199 #endif /* OPENMS_ANALYSIS_MAPMATCHING_QTCLUSTERFINDER_H */
Container for (2-dimensional coordinate, value) pairs.
Definition: HashGrid.h:62
FeatureDistance feature_distance_
Feature distance functor.
Definition: QTClusterFinder.h:111
A functor class for the calculation of distances between features or consensus features.
Definition: FeatureDistance.h:76
A more convenient string class.
Definition: String.h:57
static BaseGroupFinder * create()
Returns an instance of this class.
Definition: QTClusterFinder.h:190
PairDistances distances_
Distance map.
Definition: QTClusterFinder.h:118
A representation of a QT cluster used for feature grouping.
Definition: QTCluster.h:82
bool use_IDs_
Consider peptide identifications for grouping?
Definition: QTClusterFinder.h:102
A container for consensus elements.
Definition: ConsensusMap.h:72
double max_diff_mz_
Maximum m/z difference.
Definition: QTClusterFinder.h:108
static const String getProductName()
Returns the name of the product.
Definition: QTClusterFinder.h:164
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Size num_maps_
Number of input maps.
Definition: QTClusterFinder.h:99
double max_diff_rt_
Maximum RT difference.
Definition: QTClusterFinder.h:105
The base class of all element group finding algorithms.
Definition: BaseGroupFinder.h:59
Mass-to-charge dimension id (1 if used as a const int)
Definition: Peak2D.h:77
HashGrid< GridFeature * > Grid
Definition: QTClusterFinder.h:96
Representation of a feature in a hash grid.
Definition: GridFeature.h:53
OpenMSBoost::unordered_map< std::pair< GridFeature *, GridFeature * >, double > PairDistances
Distances between pairs of grid features.
Definition: QTClusterFinder.h:90
Retention time dimension id (0 if used as a const int)
Definition: Peak2D.h:76
OpenMSBoost::unordered_map< GridFeature *, std::vector< QTCluster * > > ElementMapping
Map to store which grid features are next to which clusters.
Definition: QTClusterFinder.h:94
A variant of QT clustering for the detection of feature groups.
Definition: QTClusterFinder.h:83
A 2-dimensional consensus feature.
Definition: ConsensusFeature.h:65

OpenMS / TOPP release 2.0.0 Documentation generated on Thu Aug 20 2015 01:44:28 using doxygen 1.8.9.1