OpenMS
Loading...
Searching...
No Matches
ILPDCWrapper.h
Go to the documentation of this file.
1// Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2// SPDX-License-Identifier: BSD-3-Clause
3//
4// --------------------------------------------------------------------------
5// $Maintainer: Chris Bielow $
6// $Authors: Chris Bielow $
7// --------------------------------------------------------------------------
8
9#pragma once
10
11
13
14#include <vector>
15#include <set>
16#include <map>
17
18namespace OpenMS
19{
20
21 class MassExplainer;
22 class FeatureMap;
23 class ChargePair;
24
45 class OPENMS_DLLAPI ILPDCWrapper
46 {
47
48public:
50 typedef std::vector<ChargePair> PairsType;
52 typedef PairsType::size_type PairsIndex;
53
56
58 virtual ~ILPDCWrapper();
59
74 double compute(const FeatureMap& fm, PairsType& pairs, Size verbose_level) const;
75
76private:
77
79 double computeSlice_(const FeatureMap& fm,
80 PairsType& pairs,
81 const PairsIndex margin_left,
82 const PairsIndex margin_right,
83 const Size verbose_level) const;
84
86 double computeSliceOld_(const FeatureMap& fm,
87 PairsType& pairs,
88 const PairsIndex margin_left,
89 const PairsIndex margin_right,
90 const Size verbose_level) const;
91
93 double getLogScore_(const PairsType::value_type& pair, const FeatureMap& fm) const;
94
96 typedef std::map<std::string, std::set<Size> > FeatureType_;
97
99 void updateFeatureVariant_(FeatureType_& f_set, const std::string& rota_l, const Size& v) const;
100
101
102
103 }; // !class
104
105} // !namespace
106
A container for features.
Definition FeatureMap.h:78
ILP-based decharging: pick the maximum-log-score subset of charge-pair edges that yields a consistent...
Definition ILPDCWrapper.h:46
double computeSliceOld_(const FeatureMap &fm, PairsType &pairs, const PairsIndex margin_left, const PairsIndex margin_right, const Size verbose_level) const
Legacy slice solver kept for comparison / regression testing — kept in lock-step with computeSlice_.
std::vector< ChargePair > PairsType
Container of putative charge-pair edges between features.
Definition ILPDCWrapper.h:50
double getLogScore_(const PairsType::value_type &pair, const FeatureMap &fm) const
Log-score of one putative charge-pair edge given the underlying feature intensities and the recorded ...
ILPDCWrapper()
Default constructor; the class is stateless and only exposes compute()
double computeSlice_(const FeatureMap &fm, PairsType &pairs, const PairsIndex margin_left, const PairsIndex margin_right, const Size verbose_level) const
Solve one slice of the edge graph (the new clique-based solver) — see compute() for the externally vi...
std::map< std::string, std::set< Size > > FeatureType_
Internal lookup: feature id (as std::string) -> set of compatible charge-annotation variant indices e...
Definition ILPDCWrapper.h:96
virtual ~ILPDCWrapper()
Destructor.
void updateFeatureVariant_(FeatureType_ &f_set, const std::string &rota_l, const Size &v) const
Record one more charge-annotation variant v for the feature whose rotated id is rota_l in f_set.
double compute(const FeatureMap &fm, PairsType &pairs, Size verbose_level) const
Solve the ILP on pairs to find the max-log-score subset of consistent charge-pair edges.
PairsType::size_type PairsIndex
Index type into PairsType, used for slicing.
Definition ILPDCWrapper.h:52
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