![]() |
OpenMS
|
ILP-based decharging: pick the maximum-log-score subset of charge-pair edges that yields a consistent per-feature charge assignment. More...
#include <OpenMS/ANALYSIS/DECHARGING/ILPDCWrapper.h>
Public Types | |
| typedef std::vector< ChargePair > | PairsType |
| Container of putative charge-pair edges between features. | |
| typedef PairsType::size_type | PairsIndex |
| Index type into PairsType, used for slicing. | |
Public Member Functions | |
| ILPDCWrapper () | |
| Default constructor; the class is stateless and only exposes compute() | |
| virtual | ~ILPDCWrapper () |
| Destructor. | |
| 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. | |
Private Types | |
| typedef std::map< std::string, std::set< Size > > | FeatureType_ |
Internal lookup: feature id (as std::string) -> set of compatible charge-annotation variant indices encountered for that feature so far. | |
Private Member Functions | |
| 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 visible contract. | |
| 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_. | |
| 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 mass-shift probability. | |
| 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. | |
ILP-based decharging: pick the maximum-log-score subset of charge-pair edges that yields a consistent per-feature charge assignment.
Wraps the integer-linear-programming step shared by FeatureDeconvolution (peptides) and MetaboliteFeatureDeconvolution (metabolites). Given a FeatureMap and a pre-computed list of putative ChargePair edges between its features (each edge captures one consistent charge-state hypothesis for a pair of features that are also adduct/mass-shift compatible), the solver returns the maximum-log-score subset of edges that respects per-feature consistency constraints (at most one realised charge-assignment per feature). The realised edges are marked active in pairs.
The implementation first partitions the input edge set into connected components and solves one ILP per component (so a single big input doesn't translate into a single intractable LP) — this slicing is handled internally and is transparent to callers.
LP-solver choice (GLPK, COIN-OR, or HiGHS — selected at build time via the LP_SOLVER CMake variable) is hidden behind LPWrapper.
|
private |
Internal lookup: feature id (as std::string) -> set of compatible charge-annotation variant indices encountered for that feature so far.
| typedef PairsType::size_type PairsIndex |
| typedef std::vector<ChargePair> PairsType |
Container of putative charge-pair edges between features.
| ILPDCWrapper | ( | ) |
Default constructor; the class is stateless and only exposes compute()
|
virtual |
Destructor.
| 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.
Partitions the input edge graph into connected components, solves one ILP per component (per LPWrapper), accumulates the objective values, and marks every realised edge active in pairs. The FeatureMap is read-only here — features themselves are not modified; the caller is expected to apply the chosen charge assignments to fm separately.
| [in] | fm | Feature map providing per-feature mass / intensity for log-score evaluation. |
| [in,out] | pairs | Putative charge-pair edges to filter; realised edges are flagged active in place. |
| [in] | verbose_level | Verbosity for the LP solver (0 = silent; higher = more solver chatter). |
-1 if fm is empty (a warning is logged in that case).
|
private |
Solve one slice of the edge graph (the new clique-based solver) — see compute() for the externally visible contract.
|
private |
Legacy slice solver kept for comparison / regression testing — kept in lock-step with computeSlice_.
|
private |
Log-score of one putative charge-pair edge given the underlying feature intensities and the recorded mass-shift probability.
|
private |
Record one more charge-annotation variant v for the feature whose rotated id is rota_l in f_set.