OpenMS
2.8.0
|
#include <OpenMS/ANALYSIS/OPENSWATH/MRMFeatureSelector.h>
Classes | |
struct | SelectorParameters |
Public Types | |
enum class | VariableType { INTEGER = 1 , CONTINUOUS } |
enum class | LambdaScore { LINEAR = 1 , INVERSE , LOG , INVERSE_LOG , INVERSE_LOG10 } |
Public Member Functions | |
MRMFeatureSelector ()=default | |
virtual | ~MRMFeatureSelector ()=default |
virtual void | optimize (const std::vector< std::pair< double, String >> &time_to_name, const std::map< String, std::vector< Feature >> &feature_name_map, std::vector< String > &result, const SelectorParameters ¶meters) const =0 |
void | selectMRMFeature (const FeatureMap &features, FeatureMap &selected_filtered, const SelectorParameters ¶meters) const |
Protected Member Functions | |
Int | addVariable_ (LPWrapper &problem, const String &name, const bool bounded, const double obj, const VariableType variableType) const |
double | computeScore_ (const Feature &feature, const std::map< String, LambdaScore > &score_weights) const |
void | addConstraint_ (LPWrapper &problem, std::vector< Int > indices, std::vector< double > values, const String &name, const double lb, const double ub, const LPWrapper::Type param) const |
Private Member Functions | |
void | constructTargTransList_ (const FeatureMap &features, std::vector< std::pair< double, String >> &time_to_name, std::map< String, std::vector< Feature >> &feature_name_map, const bool select_transition_group) const |
double | weightScore_ (const double score, const LambdaScore lambda_score) const |
String | removeSpaces_ (String str) const |
Removes spaces from the given string, not-in-place. More... | |
Friends | |
class | MRMFeatureSelector_test |
To test private and protected methods. More... | |
A Base class (it contains a pure virtual function named `optimize()`) for selection of MRM Features through Linear Programming.
|
strong |
|
strong |
|
default |
|
virtualdefault |
|
protected |
Add constraint to the LP problem instantiated in `optimize()`
[in,out] | problem | LPWrapper object |
[in] | indices | LP matrix indices |
[in] | values | LP matrix values |
[in] | name | Row name |
[in] | lb | Lower bound |
[in] | ub | Upper bound |
[in] | param | Row type |
|
protected |
Add variable to the LP problem instantiated in `optimize()`
[in,out] | problem | LPWrapper object |
[in] | name | Column name |
[in] | bounded | Double bounded if true, otherwise Unbounded. |
[in] | obj | Objective value |
[in] | variableType | Either integer or continuous |
|
protected |
Scoring method used by the optimizer. Metavalues to use are decided by the `score_weights` argument. The returned value is used in the LP problems' variables and constraints.
[in] | feature | Input feature |
[in] | score_weights | Score weights |
Referenced by MRMFeatureSelector_test::computeScore_().
|
private |
Construct the target transition's or transition group's retention times that will be used to score candidate features based on their deviation from the relative distance between the target transition's or transition group's times
[in] | features | Input features |
[out] | time_to_name | Pairs representing a mapping of retention times to transition names |
[out] | feature_name_map | Transitions' names to their features objects |
[in] | select_transition_group | Transition group selection |
Referenced by MRMFeatureSelector_test::constructTargTransList_().
|
pure virtual |
Derived classes implement this pure virtual method.
It sets up the linear programming problem and solves it.
[in] | time_to_name | Pairs representing a mapping of retention times to transition names |
[in] | feature_name_map | Transitions' names to their features objects |
[out] | result | Transitions' names filtered out of the LP problem |
[in] | parameters | Parameters |
Implemented in MRMFeatureSelectorScore, and MRMFeatureSelectorQMIP.
Removes spaces from the given string, not-in-place.
Referenced by MRMFeatureSelector_test::removeSpaces_().
void selectMRMFeature | ( | const FeatureMap & | features, |
FeatureMap & | selected_filtered, | ||
const SelectorParameters & | parameters | ||
) | const |
The features are sorted by retention time and splitted into segments with the given step and window length. The features are then selected based on the results of `optimize()` method applied to each segment. The segments may overlap.
[in] | features | Input features |
[out] | selected_filtered | Output features |
[in] | parameters | Parameters |
|
private |
Transform the given score through the chosen lambda function
Possible values for `lambda_score` are:
Exception::IllegalArgument | When an invalid `lambda_score` is passed |
[in] | score | Value to transform |
[in] | lambda_score | A string representing the desired transformation |
Referenced by MRMFeatureSelector_test::weightScore_().
|
friend |
To test private and protected methods.