OpenMS
MapAlignmentAlgorithmKD.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: Johannes Veit $
6 // $Authors: Johannes Veit $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
13 
14 namespace OpenMS
15 {
16 
35 class OPENMS_DLLAPI MapAlignmentAlgorithmKD
36 {
37 public:
38 
40  MapAlignmentAlgorithmKD(Size num_maps, const Param& param);
41 
44 
46  void addRTFitData(const KDTreeFeatureMaps& kd_data);
47 
49  void fitLOWESS();
50 
52  void transform(KDTreeFeatureMaps& kd_data) const;
53 
54 protected:
55 
56  virtual void updateMembers_();
57 
59  Size computeCCs_(const KDTreeFeatureMaps& kd_data, std::vector<Size>& cc_index) const;
60 
62  void getCCs_(const KDTreeFeatureMaps& kd_data, std::map<Size, std::vector<Size> >& result) const;
63 
65  void filterCCs_(const KDTreeFeatureMaps& kd_data, const std::map<Size, std::vector<Size> >& ccs, std::map<Size, std::vector<Size> >& filtered_ccs) const;
66 
67 private:
68 
71 
73  std::vector<TransformationModel::DataPoints> fit_data_;
74 
76  std::vector<TransformationModelLowess*> transformations_;
77 
80 
83 
85  double rt_tol_secs_;
86 
88  double mz_tol_;
89 
91  bool mz_ppm_;
92 
93 };
94 
95 } // namespace OpenMS
96 
Stores a set of features, together with a 2D tree for fast search.
Definition: KDTreeFeatureMaps.h:24
An efficient reference-free feature map alignment algorithm for unlabeled data.
Definition: MapAlignmentAlgorithmKD.h:36
void transform(KDTreeFeatureMaps &kd_data) const
Transform RTs for kd_data.
double mz_tol_
m/z tolerance
Definition: MapAlignmentAlgorithmKD.h:88
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)
Param param_
Parameters.
Definition: MapAlignmentAlgorithmKD.h:79
void fitLOWESS()
Fit LOWESS to fit_data_, store final models in transformations_.
void addRTFitData(const KDTreeFeatureMaps &kd_data)
Compute data points needed for RT transformation in the current kd_data, add to fit_data_.
double rt_tol_secs_
RT tolerance.
Definition: MapAlignmentAlgorithmKD.h:85
MapAlignmentAlgorithmKD(Size num_maps, const Param &param)
Constructor.
std::vector< TransformationModel::DataPoints > fit_data_
RT data for fitting the LOWESS.
Definition: MapAlignmentAlgorithmKD.h:73
bool mz_ppm_
m/z unit ppm?
Definition: MapAlignmentAlgorithmKD.h:91
void getCCs_(const KDTreeFeatureMaps &kd_data, std::map< Size, std::vector< Size > > &result) const
Return connected components.
std::vector< TransformationModelLowess * > transformations_
LOWESS transformations.
Definition: MapAlignmentAlgorithmKD.h:76
double max_pairwise_log_fc_
Maximum absolute log10 fold change threshold between compatible features.
Definition: MapAlignmentAlgorithmKD.h:82
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.
virtual ~MapAlignmentAlgorithmKD()
Default destructor.
MapAlignmentAlgorithmKD()
Default constructor is not supposed to be used.
Management and storage of parameters / INI files.
Definition: Param.h:44
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22