OpenMS  2.8.0
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
MapAlignmentAlgorithmKD Class Reference

An efficient reference-free feature map alignment algorithm for unlabeled data. More...

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

Collaboration diagram for MapAlignmentAlgorithmKD:
[legend]

Public Member Functions

 MapAlignmentAlgorithmKD (Size num_maps, const Param &param)
 Constructor. More...
 
virtual ~MapAlignmentAlgorithmKD ()
 Default destructor. More...
 
void addRTFitData (const KDTreeFeatureMaps &kd_data)
 Compute data points needed for RT transformation in the current kd_data, add to fit_data_. More...
 
void fitLOWESS ()
 Fit LOWESS to fit_data_, store final models in transformations_. More...
 
void transform (KDTreeFeatureMaps &kd_data) const
 Transform RTs for kd_data. More...
 

Protected Member Functions

virtual void updateMembers_ ()
 
Size computeCCs_ (const KDTreeFeatureMaps &kd_data, std::vector< Size > &cc_index) const
 Compute connected components, store CC indices in member cc_index. Return number of CCs. More...
 
void getCCs_ (const KDTreeFeatureMaps &kd_data, std::map< Size, std::vector< Size > > &result) const
 Return connected components. More...
 
void filterCCs_ (const KDTreeFeatureMaps &kd_data, const std::map< Size, std::vector< Size > > &ccs, std::map< Size, std::vector< Size > > &filtered_ccs) const
 Filter connected components (return conflict-free CCs of sufficiently large size and small diameter) More...
 

Private Member Functions

 MapAlignmentAlgorithmKD ()
 Default constructor is not supposed to be used. More...
 

Private Attributes

std::vector< TransformationModel::DataPointsfit_data_
 RT data for fitting the LOWESS. More...
 
std::vector< TransformationModelLowess * > transformations_
 LOWESS transformations. More...
 
Param param_
 Parameters. More...
 
double max_pairwise_log_fc_
 Maximum absolute log10 fold change threshold between compatible features. More...
 
double rt_tol_secs_
 RT tolerance. More...
 
double mz_tol_
 m/z tolerance More...
 
bool mz_ppm_
 m/z unit ppm? More...
 

Detailed Description

An efficient reference-free feature map alignment algorithm for unlabeled data.

This algorithm uses a kd-tree to efficiently compute conflict-free connected components (CCC) in a compatibility graph on feature data. This graph is comprised of nodes corresponding to features and edges connecting features f and f' iff both are within each other's tolerance windows (wrt. RT and m/z difference). CCCs are those CCs that do not contain multiple features from the same input map, and whose features all have the same charge state.

All CCCs above a user-specified minimum size are considered true sets of corresponding features and based on these, LOWESS transformations are computed for each input map such that the average deviation from the mean retention time within all CCCs is minimized.

Constructor & Destructor Documentation

◆ MapAlignmentAlgorithmKD() [1/2]

MapAlignmentAlgorithmKD ( Size  num_maps,
const Param param 
)

Constructor.

◆ ~MapAlignmentAlgorithmKD()

virtual ~MapAlignmentAlgorithmKD ( )
virtual

Default destructor.

◆ MapAlignmentAlgorithmKD() [2/2]

Default constructor is not supposed to be used.

Member Function Documentation

◆ addRTFitData()

void addRTFitData ( const KDTreeFeatureMaps kd_data)

Compute data points needed for RT transformation in the current kd_data, add to fit_data_.

◆ computeCCs_()

Size computeCCs_ ( const KDTreeFeatureMaps kd_data,
std::vector< Size > &  cc_index 
) const
protected

Compute connected components, store CC indices in member cc_index. Return number of CCs.

◆ filterCCs_()

void filterCCs_ ( const KDTreeFeatureMaps kd_data,
const std::map< Size, std::vector< Size > > &  ccs,
std::map< Size, std::vector< Size > > &  filtered_ccs 
) const
protected

Filter connected components (return conflict-free CCs of sufficiently large size and small diameter)

◆ fitLOWESS()

void fitLOWESS ( )

Fit LOWESS to fit_data_, store final models in transformations_.

◆ getCCs_()

void getCCs_ ( const KDTreeFeatureMaps kd_data,
std::map< Size, std::vector< Size > > &  result 
) const
protected

Return connected components.

◆ transform()

void transform ( KDTreeFeatureMaps kd_data) const

Transform RTs for kd_data.

◆ updateMembers_()

virtual void updateMembers_ ( )
protectedvirtual

Member Data Documentation

◆ fit_data_

std::vector<TransformationModel::DataPoints> fit_data_
private

RT data for fitting the LOWESS.

◆ max_pairwise_log_fc_

double max_pairwise_log_fc_
private

Maximum absolute log10 fold change threshold between compatible features.

◆ mz_ppm_

bool mz_ppm_
private

m/z unit ppm?

◆ mz_tol_

double mz_tol_
private

m/z tolerance

◆ param_

Param param_
private

Parameters.

◆ rt_tol_secs_

double rt_tol_secs_
private

RT tolerance.

◆ transformations_

std::vector<TransformationModelLowess*> transformations_
private

LOWESS transformations.