OpenMS  2.7.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KDTreeFeatureMaps Class Reference

Stores a set of features, together with a 2D tree for fast search. More...

#include <OpenMS/ANALYSIS/QUANTITATION/KDTreeFeatureMaps.h>

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

Public Types

typedef KDTree::KDTree< 2, KDTreeFeatureNodeFeatureKDTree
 2D tree on features More...
 

Public Member Functions

 KDTreeFeatureMaps ()
 Default constructor. More...
 
template<typename MapType >
 KDTreeFeatureMaps (const std::vector< MapType > &maps, const Param &param)
 Constructor. More...
 
 ~KDTreeFeatureMaps () override
 Destructor. More...
 
template<typename MapType >
void addMaps (const std::vector< MapType > &maps)
 Add maps and balance kd-tree. More...
 
void addFeature (Size mt_map_index, const BaseFeature *feature)
 Add feature. More...
 
const BaseFeaturefeature (Size i) const
 Return pointer to feature i. More...
 
double rt (Size i) const
 RT. More...
 
double mz (Size i) const
 m/z More...
 
float intensity (Size i) const
 Intensity. More...
 
Int charge (Size i) const
 Charge. More...
 
Size mapIndex (Size i) const
 Map index. More...
 
Size size () const
 Number of features stored. More...
 
Size treeSize () const
 Number of points in the tree. More...
 
Size numMaps () const
 Number of maps. More...
 
void clear ()
 Clear all data. More...
 
void optimizeTree ()
 Optimize the kD tree. More...
 
void getNeighborhood (Size index, std::vector< Size > &result_indices, double rt_tol, double mz_tol, bool mz_ppm, bool include_features_from_same_map=false, double max_pairwise_log_fc=-1.0) const
 Fill result with indices of all features compatible (wrt. RT, m/z, map index) to the feature with index. More...
 
void queryRegion (double rt_low, double rt_high, double mz_low, double mz_high, std::vector< Size > &result_indices, Size ignored_map_index=std::numeric_limits< Size >::max()) const
 Fill result with indices of all features within the specified boundaries. More...
 
void applyTransformations (const std::vector< TransformationModelLowess * > &trafos)
 Apply RT transformations. 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...
 
virtual 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...
 

Protected Member Functions

void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

std::vector< const BaseFeature * > features_
 Feature data. More...
 
std::vector< Sizemap_index_
 Map indices. More...
 
std::vector< double > rt_
 (Potentially transformed) retention times More...
 
Size num_maps_
 Number of maps. More...
 
FeatureKDTree kd_tree_
 2D tree on features from all input maps. 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...
 

Additional Inherited Members

- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &prefix="")
 Writes all parameters to meta values. More...
 

Detailed Description

Stores a set of features, together with a 2D tree for fast search.

Member Typedef Documentation

◆ FeatureKDTree

2D tree on features

Constructor & Destructor Documentation

◆ KDTreeFeatureMaps() [1/2]

KDTreeFeatureMaps ( )
inline

Default constructor.

◆ KDTreeFeatureMaps() [2/2]

KDTreeFeatureMaps ( const std::vector< MapType > &  maps,
const Param param 
)
inline

Constructor.

◆ ~KDTreeFeatureMaps()

~KDTreeFeatureMaps ( )
inlineoverride

Destructor.

Member Function Documentation

◆ addFeature()

void addFeature ( Size  mt_map_index,
const BaseFeature feature 
)

Add feature.

◆ addMaps()

void addMaps ( const std::vector< MapType > &  maps)
inline

Add maps and balance kd-tree.

References MSExperiment::begin(), and MSExperiment::end().

◆ applyTransformations()

void applyTransformations ( const std::vector< TransformationModelLowess * > &  trafos)

Apply RT transformations.

◆ charge()

Int charge ( Size  i) const

Charge.

◆ clear()

void clear ( )

Clear all data.

◆ feature()

const BaseFeature* feature ( Size  i) const

Return pointer to feature i.

◆ getNeighborhood()

void getNeighborhood ( Size  index,
std::vector< Size > &  result_indices,
double  rt_tol,
double  mz_tol,
bool  mz_ppm,
bool  include_features_from_same_map = false,
double  max_pairwise_log_fc = -1.0 
) const

Fill result with indices of all features compatible (wrt. RT, m/z, map index) to the feature with index.

◆ intensity()

float intensity ( Size  i) const

Intensity.

◆ mapIndex()

Size mapIndex ( Size  i) const

Map index.

◆ mz()

double mz ( Size  i) const

m/z

◆ numMaps()

Size numMaps ( ) const

Number of maps.

◆ optimizeTree()

void optimizeTree ( )

Optimize the kD tree.

◆ queryRegion()

void queryRegion ( double  rt_low,
double  rt_high,
double  mz_low,
double  mz_high,
std::vector< Size > &  result_indices,
Size  ignored_map_index = std::numeric_limits< Size >::max() 
) const

Fill result with indices of all features within the specified boundaries.

◆ rt()

double rt ( Size  i) const

RT.

◆ size()

Size size ( ) const

Number of features stored.

◆ treeSize()

Size treeSize ( ) const

Number of points in the tree.

◆ updateMembers_()

void updateMembers_ ( )
overrideprotectedvirtual

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.

Member Data Documentation

◆ features_

std::vector<const BaseFeature*> features_
protected

Feature data.

◆ kd_tree_

FeatureKDTree kd_tree_
protected

2D tree on features from all input maps.

◆ map_index_

std::vector<Size> map_index_
protected

Map indices.

◆ num_maps_

Size num_maps_
protected

Number of maps.

◆ rt_

std::vector<double> rt_
protected

(Potentially transformed) retention times