OpenMS
FeatureGroupingAlgorithmKD Class Reference

A feature grouping algorithm for unlabeled data. More...

#include <OpenMS/ANALYSIS/MAPMATCHING/FeatureGroupingAlgorithmKD.h>

Inheritance diagram for FeatureGroupingAlgorithmKD:
[legend]
Collaboration diagram for FeatureGroupingAlgorithmKD:
[legend]

Public Member Functions

 FeatureGroupingAlgorithmKD ()
 Default constructor. More...
 
 ~FeatureGroupingAlgorithmKD () override
 Destructor. More...
 
void group (const std::vector< FeatureMap > &maps, ConsensusMap &out) override
 Applies the algorithm to feature maps. More...
 
void group (const std::vector< ConsensusMap > &maps, ConsensusMap &out) override
 Applies the algorithm to consensus maps. More...
 
- Public Member Functions inherited from FeatureGroupingAlgorithm
 FeatureGroupingAlgorithm ()
 Default constructor. More...
 
 ~FeatureGroupingAlgorithm () override
 Destructor. More...
 
void transferSubelements (const std::vector< ConsensusMap > &maps, ConsensusMap &out) const
 Transfers subelements (grouped features) from input consensus maps to the result consensus map. More...
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 
- Public Member Functions inherited from ProgressLogger
 ProgressLogger ()
 Constructor. More...
 
virtual ~ProgressLogger ()
 Destructor. More...
 
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
 
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
 
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
 
LogType getLogType () const
 Returns the type of progress log being used. More...
 
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
 
void setProgress (SignedSize value) const
 Sets the current progress. More...
 
void endProgress () const
 Ends the progress display. More...
 
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...
 

Static Public Member Functions

static FeatureGroupingAlgorithmcreate ()
 Creates a new instance of this class (for Factory) More...
 
static String getProductName ()
 Returns the product name (for the Factory) More...
 
- Static Public Member Functions inherited from FeatureGroupingAlgorithm
static void registerChildren ()
 Register all derived classes in this method. More...
 
- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
 Writes all parameters to meta values. More...
 

Private Member Functions

 FeatureGroupingAlgorithmKD (const FeatureGroupingAlgorithmKD &)
 Copy constructor intentionally not implemented -> private. More...
 
FeatureGroupingAlgorithmKDoperator= (const FeatureGroupingAlgorithmKD &)
 Assignment operator intentionally not implemented -> private. More...
 
template<typename MapType >
void group_ (const std::vector< MapType > &input_maps, ConsensusMap &out)
 Applies the algorithm to feature or consensus maps. More...
 
void runClustering_ (const KDTreeFeatureMaps &kd_data, ConsensusMap &out)
 Run the actual clustering algorithm. More...
 
void updateClusterProxies_ (std::set< ClusterProxyKD > &potential_clusters, std::vector< ClusterProxyKD > &cluster_for_idx, const std::set< Size > &update_these, const std::vector< Int > &assigned, const KDTreeFeatureMaps &kd_data)
 Update maximum possible sizes of potential consensus features for indices specified in update_these. More...
 
ClusterProxyKD computeBestClusterForCenter_ (Size i, std::vector< Size > &cf_indices, const std::vector< Int > &assigned, const KDTreeFeatureMaps &kd_data) const
 Compute the current best cluster with center index i (mutates proxy and cf_indices) More...
 
void addConsensusFeature_ (const std::vector< Size > &indices, const KDTreeFeatureMaps &kd_data, ConsensusMap &out) const
 Construct consensus feature and add to out map. More...
 

Private Attributes

SignedSize progress_
 Current progress for logging. More...
 
double rt_tol_secs_
 RT tolerance. More...
 
double mz_tol_
 m/z tolerance More...
 
bool mz_ppm_
 m/z unit ppm? More...
 
FeatureDistance feature_distance_
 Feature distance functor. More...
 

Additional Inherited Members

- Public Types inherited from ProgressLogger
enum  LogType { CMD , GUI , NONE }
 Possible log types. More...
 
- Protected Member Functions inherited from FeatureGroupingAlgorithm
template<class MapType >
void postprocess_ (const std::vector< MapType > &maps, ConsensusMap &out)
 
- Protected Member Functions inherited from DefaultParamHandler
virtual void updateMembers_ ()
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 
- Static Protected Member Functions inherited from ProgressLogger
static String logTypeToFactoryName_ (LogType type)
 Return the name of the factory product used for this log type. More...
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 
- Protected Attributes inherited from ProgressLogger
LogType type_
 
time_t last_invoke_
 
ProgressLoggerImplcurrent_logger_
 
- Static Protected Attributes inherited from ProgressLogger
static int recursion_depth_
 

Detailed Description

A feature grouping algorithm for unlabeled data.

The algorithm takes a number of feature or consensus maps and searches for corresponding (consensus) features across different maps.

Constructor & Destructor Documentation

◆ FeatureGroupingAlgorithmKD() [1/2]

Default constructor.

◆ ~FeatureGroupingAlgorithmKD()

Destructor.

◆ FeatureGroupingAlgorithmKD() [2/2]

Copy constructor intentionally not implemented -> private.

Member Function Documentation

◆ addConsensusFeature_()

void addConsensusFeature_ ( const std::vector< Size > &  indices,
const KDTreeFeatureMaps kd_data,
ConsensusMap out 
) const
private

Construct consensus feature and add to out map.

◆ computeBestClusterForCenter_()

ClusterProxyKD computeBestClusterForCenter_ ( Size  i,
std::vector< Size > &  cf_indices,
const std::vector< Int > &  assigned,
const KDTreeFeatureMaps kd_data 
) const
private

Compute the current best cluster with center index i (mutates proxy and cf_indices)

◆ create()

static FeatureGroupingAlgorithm* create ( )
inlinestatic

Creates a new instance of this class (for Factory)

◆ getProductName()

static String getProductName ( )
inlinestatic

Returns the product name (for the Factory)

◆ group() [1/2]

void group ( const std::vector< ConsensusMap > &  maps,
ConsensusMap out 
)
overridevirtual

Applies the algorithm to consensus maps.

Exceptions
IllegalArgumentis thrown if less than two input maps are given.

Reimplemented from FeatureGroupingAlgorithm.

◆ group() [2/2]

void group ( const std::vector< FeatureMap > &  maps,
ConsensusMap out 
)
overridevirtual

Applies the algorithm to feature maps.

Exceptions
IllegalArgumentis thrown if less than two input maps are given.

Implements FeatureGroupingAlgorithm.

◆ group_()

void group_ ( const std::vector< MapType > &  input_maps,
ConsensusMap out 
)
private

Applies the algorithm to feature or consensus maps.

Exceptions
IllegalArgumentis thrown if less than two input maps are given.

◆ operator=()

FeatureGroupingAlgorithmKD& operator= ( const FeatureGroupingAlgorithmKD )
private

Assignment operator intentionally not implemented -> private.

◆ runClustering_()

void runClustering_ ( const KDTreeFeatureMaps kd_data,
ConsensusMap out 
)
private

Run the actual clustering algorithm.

◆ updateClusterProxies_()

void updateClusterProxies_ ( std::set< ClusterProxyKD > &  potential_clusters,
std::vector< ClusterProxyKD > &  cluster_for_idx,
const std::set< Size > &  update_these,
const std::vector< Int > &  assigned,
const KDTreeFeatureMaps kd_data 
)
private

Update maximum possible sizes of potential consensus features for indices specified in update_these.

Member Data Documentation

◆ feature_distance_

FeatureDistance feature_distance_
private

Feature distance functor.

◆ mz_ppm_

bool mz_ppm_
private

m/z unit ppm?

◆ mz_tol_

double mz_tol_
private

m/z tolerance

◆ progress_

SignedSize progress_
private

Current progress for logging.

◆ rt_tol_secs_

double rt_tol_secs_
private

RT tolerance.