11#include <OpenMS/config.h>
62 check_defaults_ =
false;
74 template <
typename MapType>
78 check_defaults_ =
false;
98 template <
typename MapType>
99 void addMaps(
const std::vector<MapType>& maps)
101 num_maps_ = maps.size();
103 for (
Size i = 0; i < num_maps_; ++i)
108 addFeature(i, &(*it));
179 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;
195 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;
A basic LC-MS feature.
Definition BaseFeature.h:34
A base class for all classes handling default parameters.
Definition DefaultParamHandler.h:66
Pools features from multiple maps into a single 2D kd-tree on (RT, m/z) for fast range queries.
Definition KDTreeFeatureMaps.h:51
std::vector< double > rt_
(Potentially transformed) retention times, parallel to features_
Definition KDTreeFeatureMaps.h:218
~KDTreeFeatureMaps() override
Destructor (does not delete the wrapped features)
Definition KDTreeFeatureMaps.h:84
KDTreeFeatureMaps(const std::vector< MapType > &maps, const Param ¶m)
Construct from a list of feature maps and a parameter set.
Definition KDTreeFeatureMaps.h:75
Size numMaps() const
Number of source maps recorded in the most recent addMaps() call.
Size mapIndex(Size i) const
Index of the source map that feature i was added with.
FeatureKDTree kd_tree_
2D kd-tree on features from all input maps (queried in (RT, m/z))
Definition KDTreeFeatureMaps.h:224
std::vector< Size > map_index_
Map of origin for each feature (parallel to features_)
Definition KDTreeFeatureMaps.h:215
std::vector< const BaseFeature * > features_
Feature data (pointers owned by the caller)
Definition KDTreeFeatureMaps.h:212
Int charge(Size i) const
Charge of feature i (read through the wrapped BaseFeature)
KDTreeFeatureMaps()
Default constructor; creates an empty container with no features and zero maps.
Definition KDTreeFeatureMaps.h:59
float intensity(Size i) const
Intensity of feature i (read through the wrapped BaseFeature)
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
Range query on the kd-tree: collect indices of features within the given (RT, m/z) rectangle.
void applyTransformations(const std::vector< TransformationModelLowess * > &trafos)
Apply a per-map RT transformation to the cached retention times.
double rt(Size i) const
(Possibly transformed) retention time of feature i
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
Collect indices of all features compatible with the feature at index.
KDTree::KDTree< 2, KDTreeFeatureNode > FeatureKDTree
2D kd-tree on (RT, m/z) holding KDTreeFeatureNode entries
Definition KDTreeFeatureMaps.h:56
void addFeature(Size mt_map_index, const BaseFeature *feature)
Insert a single feature into the kd-tree.
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
const BaseFeature * feature(Size i) const
Pointer to the feature with global index i.
void clear()
Discard all stored features and clear the kd-tree (does not delete the wrapped features)
Size size() const
Number of features stored (across all maps)
Size num_maps_
Number of source maps (set by addMaps())
Definition KDTreeFeatureMaps.h:221
void addMaps(const std::vector< MapType > &maps)
Insert all features from maps and balance the kd-tree.
Definition KDTreeFeatureMaps.h:99
double mz(Size i) const
m/z of feature i (read through the wrapped BaseFeature)
void optimizeTree()
Re-balance the kd-tree after incremental inserts.
Size treeSize() const
Number of points currently in the kd-tree.
In-Memory representation of a mass spectrometry run.
Definition MSExperiment.h:49
Iterator begin() noexcept
Base::const_iterator const_iterator
Definition MSExperiment.h:98
Management and storage of parameters / INI files.
Definition Param.h:46
int Int
Signed integer type.
Definition Types.h:72
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