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 *>, double> PairDistances;
90 
92 
95 
97  bool use_IDs_;
98 
100  double max_diff_rt_;
101 
103  double max_diff_mz_;
104 
107 
114 
120  double getDistance_(GridFeature * left, GridFeature * right);
121 
127  bool compatibleIDs_(QTCluster & cluster, const GridFeature * neighbor);
128 
130  void setParameters_(double max_intensity, double max_mz);
131 
133  void makeConsensusFeature_(std::list<QTCluster> & clustering,
134  ConsensusFeature & feature, OpenMSBoost::unordered_map<GridFeature *,
135  std::vector< QTCluster * > > & element_mapping);
136 
138  void computeClustering_(Grid & grid, std::list<QTCluster> & clustering);
139 
141  template <typename MapType>
142  void run_(const std::vector<MapType> &
143  input_maps, ConsensusMap & result_map);
144 
145 protected:
146  enum
147  {
150  };
151 
152 public:
154  QTClusterFinder();
155 
157  virtual ~QTClusterFinder();
158 
160  static const String getProductName()
161  {
162  return "qt";
163  }
164 
170  void run(const std::vector<ConsensusMap> & input_maps,
171  ConsensusMap & result_map);
172 
178  void run(const std::vector<FeatureMap > & input_maps,
179  ConsensusMap & result_map);
180 
183  {
184  return new QTClusterFinder();
185  }
186 
187  };
188 
189 }
190 
191 #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:106
A functor class for the calculation of distances between features or consensus features.
Definition: FeatureDistance.h:76
HashGrid< GridFeature * > Grid
Definition: QTClusterFinder.h:91
A more convenient string class.
Definition: String.h:57
static BaseGroupFinder * create()
Returns an instance of this class.
Definition: QTClusterFinder.h:182
PairDistances distances_
Distance map.
Definition: QTClusterFinder.h:113
A representation of a QT cluster used for feature grouping.
Definition: QTCluster.h:82
Retention time dimension id (0 if used as a const int)
Definition: Peak2D.h:76
bool use_IDs_
Consider peptide identifications for grouping?
Definition: QTClusterFinder.h:97
A container for consensus elements.
Definition: ConsensusMap.h:72
double max_diff_mz_
Maximum m/z difference.
Definition: QTClusterFinder.h:103
static const String getProductName()
Returns the name of the product.
Definition: QTClusterFinder.h:160
Mass-to-charge dimension id (1 if used as a const int)
Definition: Peak2D.h:77
Size num_maps_
Number of input maps.
Definition: QTClusterFinder.h:94
double max_diff_rt_
Maximum RT difference.
Definition: QTClusterFinder.h:100
The base class of all element group finding algorithms.
Definition: BaseGroupFinder.h:59
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:89
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 Wed Mar 30 2016 16:18:41 using doxygen 1.8.5