15 namespace IdentificationDataInternal
29 const AppliedProcessingSteps::nth_index<1>::type&
53 for (
const auto& pair : step.
scores)
55 old_step.
scores[pair.first] = pair.second;
63 const std::map<ScoreTypeRef, double>& scores =
64 std::map<ScoreTypeRef, double>())
72 const std::optional<ProcessingStepRef>&
73 processing_step_opt = std::nullopt)
76 applied.
scores[score_type] = score;
103 std::tuple<double, std::optional<ProcessingStepRef>,
bool> result =
105 return std::make_pair(std::get<0>(result), std::get<2>(result));
114 std::optional<ProcessingStepRef>
115 processing_step_opt)
const
120 auto score_pos = step_pos->scores.find(score_ref);
121 if (score_pos != step_pos->scores.end())
123 return std::make_pair(score_pos->second,
true);
127 return std::make_pair(std::numeric_limits<double>::quiet_NaN(),
false);
137 std::tuple<double, std::optional<ProcessingStepRef>,
bool>
143 auto pos = step.scores.find(score_ref);
144 if (pos != step.scores.end())
146 return std::make_tuple(pos->second, step.processing_step_opt,
true);
150 return std::make_tuple(std::numeric_limits<double>::quiet_NaN(),
151 std::nullopt,
false);
161 std::tuple<double, std::optional<ScoreTypeRef>,
bool>
167 auto top_score = step.getScoresInOrder(
true);
168 if (!top_score.empty())
170 return std::make_tuple(top_score[0].second, top_score[0].first,
174 return std::make_tuple(std::numeric_limits<double>::quiet_NaN(),
175 std::nullopt,
false);
184 counter += step.scores.size();
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
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:107
static String & reverse(String &this_s)
Definition: StringUtilsSimple.h:330
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19
Definition: AppliedProcessingStep.h:30
std::map< ScoreTypeRef, double > scores
Map of scores and their types.
Definition: AppliedProcessingStep.h:39
std::optional< ProcessingStepRef > processing_step_opt
(Optional) reference to the processing step
Definition: AppliedProcessingStep.h:36
Wrapper that adds operator< to iterators, so they can be used as (part of) keys in maps/sets or multi...
Definition: MetaData.h:20
Base class for ID data with scores and processing steps (and meta info)
Definition: ScoredProcessingResult.h:19
void addProcessingStep(const AppliedProcessingStep &step)
Add an applied processing step.
Definition: ScoredProcessingResult.h:40
AppliedProcessingSteps steps_and_scores
Definition: ScoredProcessingResult.h:20
std::pair< double, bool > getScore(ScoreTypeRef score_ref) const
Look up a score by score type.
Definition: ScoredProcessingResult.h:101
Size getNumberOfScores() const
Return the number of scores associated with this result.
Definition: ScoredProcessingResult.h:179
ScoredProcessingResult(const AppliedProcessingSteps &steps_and_scores=AppliedProcessingSteps())
Constructor.
Definition: ScoredProcessingResult.h:191
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:71
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:30
std::tuple< double, std::optional< ScoreTypeRef >, bool > getMostRecentScore() const
Get the (primary) score from the most recent processing step.
Definition: ScoredProcessingResult.h:162
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:23
ScoredProcessingResult & merge(const ScoredProcessingResult &other)
Merge in data from another object.
Definition: ScoredProcessingResult.h:81
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:113
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:62
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:138