OpenMS
FeatureGroupingAlgorithmUnlabeled.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Timo Sachsenberg $
6 // $Authors: $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
12 
14 
15 namespace OpenMS
16 {
35  class OPENMS_DLLAPI FeatureGroupingAlgorithmUnlabeled :
37  {
38 public:
41 
44 
52  template <typename MapType>
53  void setReference(int map_id, const MapType & map)
54  {
55  MapConversion::convert(map_id, map, pairfinder_input_[0]);
56  }
57 
62  {
63  return pairfinder_input_[0];
64  }
65 
71  void group(const std::vector<FeatureMap > & maps, ConsensusMap & out) override;
72 
83  void addToGroup(int map_id, const FeatureMap & feature_map);
84 
87  {
89  }
90 
93  {
94  return "unlabeled";
95  }
96 
97 private:
98 
99  // This vector should always have 2 elements
100  // - the first element is the currently computed consensus map.
101  // After initialization of the algorithm, it will consist of the reference
102  // map alone, after adding all maps through addToGroup it will contain the
103  // final result (e.g. the consensus result of all maps).
104  // - the second element is the map which was last added to the consensus map
105  std::vector<ConsensusMap> pairfinder_input_;
106 
111 
112  };
113 
114 } // namespace OpenMS
115 
A container for consensus elements.
Definition: ConsensusMap.h:66
A map feature grouping algorithm for unlabeled data.
Definition: FeatureGroupingAlgorithmUnlabeled.h:37
ConsensusMap & getResultMap()
Returns the computed consensus map (after calling addToGroup with all maps)
Definition: FeatureGroupingAlgorithmUnlabeled.h:61
FeatureGroupingAlgorithmUnlabeled(const FeatureGroupingAlgorithmUnlabeled &)
Copy constructor intentionally not implemented -> private.
FeatureGroupingAlgorithmUnlabeled & operator=(const FeatureGroupingAlgorithmUnlabeled &)
Assignment operator intentionally not implemented -> private.
~FeatureGroupingAlgorithmUnlabeled() override
Destructor.
static String getProductName()
Returns the product name (for the Factory)
Definition: FeatureGroupingAlgorithmUnlabeled.h:92
std::vector< ConsensusMap > pairfinder_input_
Definition: FeatureGroupingAlgorithmUnlabeled.h:105
static FeatureGroupingAlgorithm * create()
Creates a new instance of this class (for Factory)
Definition: FeatureGroupingAlgorithmUnlabeled.h:86
void setReference(int map_id, const MapType &map)
Sets the reference map for the algorithm.
Definition: FeatureGroupingAlgorithmUnlabeled.h:53
FeatureGroupingAlgorithmUnlabeled()
Default constructor.
void addToGroup(int map_id, const FeatureMap &feature_map)
Adds one map to the group.
void group(const std::vector< FeatureMap > &maps, ConsensusMap &out) override
Applies the algorithm.
Base class for all feature grouping algorithms.
Definition: FeatureGroupingAlgorithm.h:25
A container for features.
Definition: FeatureMap.h:80
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:46
static void convert(UInt64 const input_map_index, PeakMap &input_map, ConsensusMap &output_map, Size n=-1)
Similar to convert for FeatureMaps.
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22