41 namespace IdentificationDataInternal
55 const AppliedProcessingSteps::nth_index<1>::type&
79 for (
const auto& pair : step.
scores)
81 old_step.
scores[pair.first] = pair.second;
89 const std::map<ScoreTypeRef, double>& scores =
90 std::map<ScoreTypeRef, double>())
98 const std::optional<ProcessingStepRef>&
99 processing_step_opt = std::nullopt)
102 applied.
scores[score_type] = score;
129 std::tuple<double, std::optional<ProcessingStepRef>,
bool> result =
131 return std::make_pair(std::get<0>(result), std::get<2>(result));
140 std::optional<ProcessingStepRef>
141 processing_step_opt)
const
146 auto score_pos = step_pos->scores.find(score_ref);
147 if (score_pos != step_pos->scores.end())
149 return std::make_pair(score_pos->second,
true);
153 return std::make_pair(std::numeric_limits<double>::quiet_NaN(),
false);
163 std::tuple<double, std::optional<ProcessingStepRef>,
bool>
169 auto pos = step.scores.find(score_ref);
170 if (pos != step.scores.end())
172 return std::make_tuple(pos->second, step.processing_step_opt,
true);
176 return std::make_tuple(std::numeric_limits<double>::quiet_NaN(),
177 std::nullopt,
false);
187 std::tuple<double, std::optional<ScoreTypeRef>,
bool>
193 auto top_score = step.getScoresInOrder(
true);
194 if (!top_score.empty())
196 return std::make_tuple(top_score[0].second, top_score[0].first,
200 return std::make_tuple(std::numeric_limits<double>::quiet_NaN(),
201 std::nullopt,
false);
210 counter += step.scores.size();
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
boost::multi_index_container< AppliedProcessingStep, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::ordered_unique< boost::multi_index::member< AppliedProcessingStep, std::optional< ProcessingStepRef >, &AppliedProcessingStep::processing_step_opt > > > > AppliedProcessingSteps
Definition: AppliedProcessingStep.h:133
static String & reverse(String &this_s)
Definition: StringUtilsSimple.h:355
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
Definition: AppliedProcessingStep.h:56
std::map< ScoreTypeRef, double > scores
Map of scores and their types.
Definition: AppliedProcessingStep.h:65
std::optional< ProcessingStepRef > processing_step_opt
(Optional) reference to the processing step
Definition: AppliedProcessingStep.h:62
Wrapper that adds operator< to iterators, so they can be used as (part of) keys in maps/sets or multi...
Definition: MetaData.h:46
Base class for ID data with scores and processing steps (and meta info)
Definition: ScoredProcessingResult.h:45
void addProcessingStep(const AppliedProcessingStep &step)
Add an applied processing step.
Definition: ScoredProcessingResult.h:66
AppliedProcessingSteps steps_and_scores
Definition: ScoredProcessingResult.h:46
std::pair< double, bool > getScore(ScoreTypeRef score_ref) const
Look up a score by score type.
Definition: ScoredProcessingResult.h:127
Size getNumberOfScores() const
Return the number of scores associated with this result.
Definition: ScoredProcessingResult.h:205
ScoredProcessingResult(const AppliedProcessingSteps &steps_and_scores=AppliedProcessingSteps())
Constructor.
Definition: ScoredProcessingResult.h:217
void addScore(ScoreTypeRef score_type, double score, const std::optional< ProcessingStepRef > &processing_step_opt=std::nullopt)
Add a score (possibly connected to a processing step)
Definition: ScoredProcessingResult.h:97
const AppliedProcessingSteps::nth_index< 1 >::type & getStepsAndScoresByStep() const
Return the applied processing steps (incl. scores) as a set ordered by processing step reference (opt...
Definition: ScoredProcessingResult.h:56
std::tuple< double, std::optional< ScoreTypeRef >, bool > getMostRecentScore() const
Get the (primary) score from the most recent processing step.
Definition: ScoredProcessingResult.h:188
AppliedProcessingSteps::nth_index< 1 >::type & getStepsAndScoresByStep()
Return the applied processing steps (incl. scores) as a set ordered by processing step reference (opt...
Definition: ScoredProcessingResult.h:49
ScoredProcessingResult & merge(const ScoredProcessingResult &other)
Merge in data from another object.
Definition: ScoredProcessingResult.h:107
std::pair< double, bool > getScore(ScoreTypeRef score_ref, std::optional< ProcessingStepRef > processing_step_opt) const
Look up a score by score type and processing step.
Definition: ScoredProcessingResult.h:139
void addProcessingStep(ProcessingStepRef step_ref, const std::map< ScoreTypeRef, double > &scores=std::map< ScoreTypeRef, double >())
Add a processing step (and associated scores, if any)
Definition: ScoredProcessingResult.h:88
ScoredProcessingResult(const ScoredProcessingResult &)=default
Copy c'tor.
std::tuple< double, std::optional< ProcessingStepRef >, bool > getScoreAndStep(ScoreTypeRef score_ref) const
Look up a score and associated processing step by score type.
Definition: ScoredProcessingResult.h:164