OpenMS
MapAlignmentAlgorithmKD.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, 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 
33 class OPENMS_DLLAPI MapAlignmentAlgorithmKD
34 {
35 public:
36 
38  MapAlignmentAlgorithmKD(Size num_maps, const Param& param);
39 
42 
44  void addRTFitData(const KDTreeFeatureMaps& kd_data);
45 
47  void fitLOWESS();
48 
50  void transform(KDTreeFeatureMaps& kd_data) const;
51 
52 protected:
53 
54  virtual void updateMembers_();
55 
57  Size computeCCs_(const KDTreeFeatureMaps& kd_data, std::vector<Size>& cc_index) const;
58 
60  void getCCs_(const KDTreeFeatureMaps& kd_data, std::map<Size, std::vector<Size> >& result) const;
61 
63  void filterCCs_(const KDTreeFeatureMaps& kd_data, const std::map<Size, std::vector<Size> >& ccs, std::map<Size, std::vector<Size> >& filtered_ccs) const;
64 
65 private:
66 
69 
71  std::vector<TransformationModel::DataPoints> fit_data_;
72 
74  std::vector<TransformationModelLowess*> transformations_;
75 
78 
81 
83  double rt_tol_secs_;
84 
86  double mz_tol_;
87 
89  bool mz_ppm_;
90 
91 };
92 
93 } // namespace OpenMS
94 
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:34
void transform(KDTreeFeatureMaps &kd_data) const
Transform RTs for kd_data.
double mz_tol_
m/z tolerance
Definition: MapAlignmentAlgorithmKD.h:86
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:77
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:83
MapAlignmentAlgorithmKD(Size num_maps, const Param &param)
Constructor.
std::vector< TransformationModel::DataPoints > fit_data_
RT data for fitting the LOWESS.
Definition: MapAlignmentAlgorithmKD.h:71
bool mz_ppm_
m/z unit ppm?
Definition: MapAlignmentAlgorithmKD.h:89
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:74
double max_pairwise_log_fc_
Maximum absolute log10 fold change threshold between compatible features.
Definition: MapAlignmentAlgorithmKD.h:80
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:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19