OpenMS
IDScoreGetterSetter.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // OpenMS -- Open-Source Mass Spectrometry
3 // --------------------------------------------------------------------------
4 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
5 // ETH Zurich, and Freie Universitaet Berlin 2002-2023.
6 //
7 // This software is released under a three-clause BSD license:
8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of any author or any participating institution
14 // may be used to endorse or promote products derived from this software
15 // without specific prior written permission.
16 // For a full list of authors, refer to the file AUTHORS.
17 // --------------------------------------------------------------------------
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
22 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
25 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
26 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
28 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // --------------------------------------------------------------------------
31 // $Maintainer: Julianus Pfeuffer $
32 // $Authors: Julianus Pfeuffer $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
42 
43 #include <vector>
44 #include <unordered_set>
45 #include <unordered_map>
46 
47 namespace OpenMS
48 {
53  typedef std::pair<double, double> ScoreToTgtDecLabelPair;
54 
55  struct ScoreToTgtDecLabelPairs // Not a typedef to allow forward declaration.
56  : public std::vector<ScoreToTgtDecLabelPair>
57  {
58  typedef std::vector<ScoreToTgtDecLabelPair> Base;
59  using Base::Base;
60  };
61 
66  {
67 
68  private:
69 
70  template<typename T>
71  struct IsIDType
72  {
73  static bool const value =
74  std::is_same<T, PeptideIdentification>::value || std::is_same<T, ProteinIdentification>::value;
75  };
76 
77  template<typename T>
78  struct IsHitType
79  {
80  static bool const value = std::is_same<T, PeptideHit>::value || std::is_same<T, ProteinHit>::value;
81  };
82 
83  public:
93  std::unordered_map<String, ScoreToTgtDecLabelPair>& picked_scores,
94  const ProteinIdentification& id,
95  const String& decoy_string,
96  bool decoy_prefix);
97 
107  const std::unordered_map<String, ScoreToTgtDecLabelPair>& picked_scores,
108  ScoreToTgtDecLabelPairs& scores_labels,
109  const std::vector<ProteinIdentification::ProteinGroup>& grps,
110  const String& decoy_string,
111  bool decoy_prefix);
112 
114  static std::pair<bool,String> removeDecoyStringIfPresent_(const String& acc, const String& decoy_string, bool decoy_prefix);
115 
116  static void fillPeptideScoreMap_(
117  std::unordered_map<String, ScoreToTgtDecLabelPair>& seq_to_score_labels,
118  std::vector<PeptideIdentification> const& ids);
119 
120  static void fillPeptideScoreMap_(
121  std::unordered_map<String, ScoreToTgtDecLabelPair>& seq_to_score_labels,
122  ConsensusMap const& map,
123  bool include_unassigned);
124 
125 
135  //TODO could be done with set of target accessions, too
136  //TODO even better: store nr targets and nr decoys when creating the groups!
137  //TODO alternative scoring is possible, too (e.g. ratio of tgts vs decoys)
138  static void getScores_(
139  ScoreToTgtDecLabelPairs &scores_labels,
140  const std::vector<ProteinIdentification::ProteinGroup> &grps,
141  const std::unordered_set<std::string> &decoy_accs);
142 
143 
144  template<class ...Args>
145  static void getScores_(
146  ScoreToTgtDecLabelPairs &scores_labels,
147  const std::vector<PeptideIdentification> &ids,
148  Args &&... args)
149  {
150  for (const PeptideIdentification &id : ids)
151  {
152  getScores_(scores_labels, id, std::forward<Args>(args)...);
153  }
154  }
155 
156  static void getScores_(
157  ScoreToTgtDecLabelPairs &scores_labels,
158  const ProteinIdentification &id)
159  {
160  scores_labels.reserve(scores_labels.size() + id.getHits().size());
161  std::transform(id.getHits().begin(), id.getHits().end(),
162  std::back_inserter(scores_labels),
163  [](const ProteinHit &hit)
164  {
165  checkTDAnnotation_(hit);
166  return std::make_pair<double, bool>(hit.getScore(), getTDLabel_(hit));
167  }
168  );
169  }
170 
171  template<class ...Args>
172  static void getScores_(
173  ScoreToTgtDecLabelPairs &scores_labels,
174  const PeptideIdentification &id,
175  bool all_hits,
176  Args &&... args
177  )
178  {
179  if (all_hits)
180  {
181  for (const PeptideHit &hit : id.getHits())
182  {
183  getScores_(scores_labels, hit, std::forward<Args>(args)...);
184  }
185  }
186  else
187  {
188  //TODO for speed and constness I assume that they are sorted and first = best.
189  //id.sort();
190  const PeptideHit &hit = id.getHits()[0];
191  getScores_(scores_labels, hit, std::forward<Args>(args)...);
192  }
193  }
194 
195  template<typename IDPredicate, class ...Args>
196  static void getScores_(
197  ScoreToTgtDecLabelPairs &scores_labels,
198  const PeptideIdentification &id,
199  IDPredicate &&fun,
200  bool all_hits,
201  Args &&... args
202  )
203  {
204  if (fun(id))
205  {
206  if (all_hits)
207  {
208  for (const PeptideHit &hit : id.getHits())
209  {
210  getScores_(scores_labels, hit, std::forward<Args>(args)...);
211  }
212  }
213  else
214  {
215  //TODO for speed I assume that they are sorted and first = best.
216  //id.sort();
217  const PeptideHit &hit = id.getHits()[0];
218  getScores_(scores_labels, hit, std::forward<Args>(args)...);
219  }
220  }
221  }
222 
223  template<typename HitPredicate>
224  static void getScores_(
225  ScoreToTgtDecLabelPairs &scores_labels,
226  const PeptideHit &hit,
227  HitPredicate &&fun)
228  {
229  if (fun(hit))
230  {
231  getScores_(scores_labels, hit);
232  }
233  }
234 
235  template<typename HitType, typename std::enable_if<IsHitType<HitType>::value>::type * = nullptr>
236  static void getScores_(
237  ScoreToTgtDecLabelPairs &scores_labels,
238  const HitType &hit)
239  {
240  checkTDAnnotation_(hit);
241  scores_labels.emplace_back(hit.getScore(), getTDLabel_(hit));
242  }
251  template<class ...Args>
253  ScoreToTgtDecLabelPairs &scores_labels,
254  const ConsensusMap &cmap, bool include_unassigned_peptides, Args &&... args)
255  {
256  auto f =
257  [&](const PeptideIdentification &id) -> void
258  { getScores_(scores_labels, id, std::forward<Args>(args)...); };
259  cmap.applyFunctionOnPeptideIDs(f, include_unassigned_peptides);
260  }
261 
267  static bool getTDLabel_(const MetaInfoInterface &idOrHit)
268  {
269  return std::string(idOrHit.getMetaValue("target_decoy"))[0] == 't';
270  }
271 
283  template<typename IDType, class ...Args>
284  static void setScores_(const std::map<double, double> &scores_to_FDR,
285  std::vector<IDType> &ids,
286  const std::string &score_type,
287  bool higher_better,
288  Args &&... args)
289  {
290  for (auto &id : ids)
291  {
292  setScores_(scores_to_FDR, id, score_type, higher_better, std::forward<Args>(args)...);
293  }
294  }
295 
296  template<typename IDType>
297  static String setScoreType_(IDType &id, const std::string &score_type,
298  bool higher_better)
299  {
300  String old_score_type = id.getScoreType() + "_score";
301  id.setScoreType(score_type);
302  id.setHigherScoreBetter(higher_better);
303  return old_score_type;
304  }
305 
306  template<typename IDType>
307  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id, const std::string &score_type,
308  bool higher_better, bool keep_decoy)
309  {
310  bool old_higher_better = id.isHigherScoreBetter();
311  String old_score_type = setScoreType_(id, score_type, higher_better);
312 
313  if (keep_decoy) //in-place set scores
314  {
315  if (old_higher_better)
316  {
317  setScores_(scores_to_FDR, id, old_score_type);
318  }
319  else
320  {
321  setScoresHigherWorse_(scores_to_FDR, id, old_score_type);
322  }
323  }
324  else
325  {
326  if (old_higher_better)
327  {
328  setScoresAndRemoveDecoys_(scores_to_FDR, id, old_score_type);
329  }
330  else
331  {
332  setScoresHigherWorseAndRemoveDecoys_(scores_to_FDR, id, old_score_type);
333  }
334  }
335  }
336 
337  template<typename IDType>
338  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id,
339  const String &old_score_type)
340  {
341  std::vector<typename IDType::HitType> &hits = id.getHits();
342  for (auto &hit : hits)
343  {
344  setScore_(scores_to_FDR, hit, old_score_type);
345  }
346  }
347 
348  template<typename IDType>
349  static void setScoresHigherWorse_(const std::map<double, double> &scores_to_FDR, IDType &id,
350  const String &old_score_type)
351  {
352  std::vector<typename IDType::HitType> &hits = id.getHits();
353  for (auto &hit : hits)
354  {
355  setScoreHigherWorse_(scores_to_FDR, hit, old_score_type);
356  }
357  }
358 
359  template<typename IDType, class ...Args>
360  static void setScoresAndRemoveDecoys_(const std::map<double, double> &scores_to_FDR, IDType &id,
361  const String &old_score_type, Args&& ... args)
362  {
363  std::vector<typename IDType::HitType> &hits = id.getHits();
364  std::vector<typename IDType::HitType> new_hits;
365  new_hits.reserve(hits.size());
366  for (auto &hit : hits)
367  {
368  setScoreAndMoveIfTarget_(scores_to_FDR, hit, old_score_type, new_hits, std::forward<Args>(args)...);
369  }
370  hits.swap(new_hits);
371  }
372 
373  template<typename IDType, class ...Args>
374  static void setScoresHigherWorseAndRemoveDecoys_(const std::map<double, double> &scores_to_FDR, IDType &id,
375  const String &old_score_type, Args&& ... args)
376  {
377  std::vector<typename IDType::HitType> &hits = id.getHits();
378  std::vector<typename IDType::HitType> new_hits;
379  new_hits.reserve(hits.size());
380  for (auto &hit : hits)
381  {
382  setScoreHigherWorseAndMoveIfTarget_(scores_to_FDR, hit, old_score_type, new_hits, std::forward<Args>(args)...);
383  }
384  hits.swap(new_hits);
385  }
386 
387  template<typename HitType>
388  static void setScore_(const std::map<double, double> &scores_to_FDR, HitType &hit, const std::string &old_score_type)
389  {
390  hit.setMetaValue(old_score_type, hit.getScore());
391  hit.setScore(scores_to_FDR.lower_bound(hit.getScore())->second);
392  }
393 
394  template<typename HitType>
395  static void setScoreHigherWorse_(const std::map<double, double> &scores_to_FDR, HitType &hit, const std::string &old_score_type)
396  {
397  hit.setMetaValue(old_score_type, hit.getScore());
398  auto ub = scores_to_FDR.upper_bound(hit.getScore());
399  if (ub != scores_to_FDR.begin()) ub--;
400  hit.setScore(ub->second);
401  }
402 
403  /*template<typename IDType>
404  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id, const std::string &score_type,
405  bool higher_better)
406  {
407  bool old_higher_better = id.isHigherScoreBetter();
408  String old_score_type = setScoreType_(id, score_type, higher_better);
409  setScores_(scores_to_FDR, id, old_score_type, old_higher_better);
410  }*/
411 
412  static void setScores_(const std::map<double, double> &scores_to_FDR,
414  const std::string &score_type,
415  bool higher_better,
416  bool keep_decoy,
417  int charge)
418  {
419  String old_score_type = setScoreType_(id, score_type, higher_better);
420  if (keep_decoy) //in-place set scores
421  {
422  setScores_(scores_to_FDR, id, old_score_type, higher_better, charge);
423  }
424  else
425  {
426  setScoresAndRemoveDecoys_<PeptideIdentification>(scores_to_FDR, id, old_score_type, charge);
427  }
428  }
429 
430  static void setScores_(const std::map<double, double> &scores_to_FDR,
432  const std::string &score_type,
433  bool higher_better,
434  bool keep_decoy,
435  int charge,
436  const String &identifier)
437  {
438  if (id.getIdentifier() == identifier)
439  {
440  setScores_(scores_to_FDR, id, score_type, higher_better, keep_decoy, charge);
441  }
442  }
443 
444  template<typename IDType>
445  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id, const std::string &score_type,
446  bool higher_better, bool keep_decoy, const String &identifier)
447  {
448  if (id.getIdentifier() == identifier)
449  {
450  setScores_(scores_to_FDR, id, score_type, higher_better, keep_decoy);
451  }
452  }
453 
454  static void setScores_(const std::map<double, double> &scores_to_FDR,
456  const std::string &score_type,
457  bool higher_better,
458  int charge,
459  const String &identifier)
460  {
461  if (id.getIdentifier() == identifier)
462  {
463  setScores_(scores_to_FDR, id, score_type, higher_better, charge);
464  }
465  }
466 
467  template<typename IDType>
468  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id, const std::string &score_type,
469  bool higher_better, const String &identifier)
470  {
471  if (id.getIdentifier() == identifier)
472  {
473  setScores_(scores_to_FDR, id, score_type, higher_better);
474  }
475  }
476 
477  template<typename IDType>
478  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id, const std::string &score_type,
479  bool higher_better, int charge)
480  {
481  for (auto& hit : id.getHits())
482  {
483  if (hit.getCharge() == charge)
484  {
485  if (higher_better)
486  {
487  setScore_(scores_to_FDR, hit, score_type);
488  }
489  else
490  {
491  setScoreHigherWorse_(scores_to_FDR, hit, score_type);
492  }
493  }
494  }
495  }
496 
497  //TODO could also get a keep_decoy flag when we define what a "decoy group" is -> keep all always for now
498  static void setScores_(
499  const std::map<double, double> &scores_to_FDR,
500  std::vector<ProteinIdentification::ProteinGroup> &grps,
501  const std::string &score_type,
502  bool higher_better);
503 
514  template<typename HitType>
515  static void setScoreAndMoveIfTarget_(const std::map<double, double> &scores_to_FDR,
516  HitType &hit,
517  const std::string &old_score_type,
518  std::vector<HitType> &new_hits)
519  {
520  const String &target_decoy(hit.getMetaValue("target_decoy"));
521  if (target_decoy[0] == 't')
522  {
523  hit.setMetaValue(old_score_type, hit.getScore());
524  hit.setScore(scores_to_FDR.lower_bound(hit.getScore())->second);
525  new_hits.push_back(std::move(hit));
526  } // else do not move over
527  }
528 
529  template<typename HitType>
530  static void setScoreHigherWorseAndMoveIfTarget_(const std::map<double, double> &scores_to_FDR,
531  HitType &hit,
532  const std::string &old_score_type,
533  std::vector<HitType> &new_hits)
534  {
535  const String &target_decoy(hit.getMetaValue("target_decoy"));
536  if (target_decoy[0] == 't')
537  {
538  hit.setMetaValue(old_score_type, hit.getScore());
539  auto ub = scores_to_FDR.upper_bound(hit.getScore());
540  if (ub != scores_to_FDR.begin()) ub--;
541  hit.setScore(ub->second);
542  new_hits.push_back(std::move(hit));
543  } // else do not move over
544  }
545 
546 
555  static void setScoreAndMoveIfTarget_(const std::map<double, double> &scores_to_FDR,
556  PeptideHit &hit,
557  const std::string &old_score_type,
558  std::vector<PeptideHit> &new_hits,
559  int charge)
560  {
561  if (charge == hit.getCharge())
562  {
563  const String &target_decoy(hit.getMetaValue("target_decoy"));
564  if (target_decoy[0] == 't')
565  {
566  hit.setMetaValue(old_score_type, hit.getScore());
567  hit.setScore(scores_to_FDR.lower_bound(hit.getScore())->second);
568  new_hits.push_back(std::move(hit));
569  } // else do not move over
570  }
571  else // different charge, move over unchanged to process later at correct charge.
572  {
573  new_hits.push_back(std::move(hit));
574  }
575  }
576 
587  template<class ...Args>
588  static void setPeptideScoresForMap_(const std::map<double, double> &scores_to_FDR,
589  ConsensusMap &cmap,
590  bool include_unassigned_peptides,
591  const std::string &score_type,
592  bool higher_better,
593  bool keep_decoy,
594  Args&&... args)
595  {
596  //Note: Gcc4.8 cannot handle variadic templates in lambdas
597  auto f =
598  [&](PeptideIdentification &id) -> void
599  { setScores_(scores_to_FDR, id, score_type,
600  higher_better, keep_decoy, std::forward<Args>(args)...); };
601  cmap.applyFunctionOnPeptideIDs(f, include_unassigned_peptides);
602  }
603 
609  static void checkTDAnnotation_(const MetaInfoInterface &id_or_hit)
610  {
611  if (!id_or_hit.metaValueExists("target_decoy"))
612  {
613  throw Exception::MissingInformation(__FILE__,
614  __LINE__,
615  OPENMS_PRETTY_FUNCTION,
616  "Meta value 'target_decoy' does not exist in all ProteinHits! Reindex the idXML file with 'PeptideIndexer'");
617  }
618  }
619 
620  static void setPeptideScoresFromMap_(std::unordered_map<String, ScoreToTgtDecLabelPair> const& seq_to_fdr,
621  std::vector<PeptideIdentification>& ids,
622  std::string const& score_type,
623  bool keep_decoys);
624 
625  static void setPeptideScoresFromMap_(std::unordered_map<String, ScoreToTgtDecLabelPair> const& seq_to_fdr,
626  ConsensusMap& map,
627  std::string const& score_type,
628  bool keep_decoys,
629  bool include_unassigned);
630  };
631 } // namespace OpenMS
A container for consensus elements.
Definition: ConsensusMap.h:92
Not all required information provided.
Definition: Exception.h:188
A class for extracting and reinserting IDScores from Peptide/ProteinIdentifications and from Consensu...
Definition: IDScoreGetterSetter.h:66
static void fillPeptideScoreMap_(std::unordered_map< String, ScoreToTgtDecLabelPair > &seq_to_score_labels, ConsensusMap const &map, bool include_unassigned)
static void setPeptideScoresFromMap_(std::unordered_map< String, ScoreToTgtDecLabelPair > const &seq_to_fdr, std::vector< PeptideIdentification > &ids, std::string const &score_type, bool keep_decoys)
static std::pair< bool, String > removeDecoyStringIfPresent_(const String &acc, const String &decoy_string, bool decoy_prefix)
removes the decoy_string from acc if present. Returns if string was removed and the new string.
static void setScoreHigherWorseAndMoveIfTarget_(const std::map< double, double > &scores_to_FDR, HitType &hit, const std::string &old_score_type, std::vector< HitType > &new_hits)
Definition: IDScoreGetterSetter.h:530
static void setScoreAndMoveIfTarget_(const std::map< double, double > &scores_to_FDR, HitType &hit, const std::string &old_score_type, std::vector< HitType > &new_hits)
Used when keep_decoy_peptides or proteins is false.
Definition: IDScoreGetterSetter.h:515
static void setPeptideScoresForMap_(const std::map< double, double > &scores_to_FDR, ConsensusMap &cmap, bool include_unassigned_peptides, const std::string &score_type, bool higher_better, bool keep_decoy, Args &&... args)
Helper for applying set Scores on ConsensusMaps.
Definition: IDScoreGetterSetter.h:588
static void fillPeptideScoreMap_(std::unordered_map< String, ScoreToTgtDecLabelPair > &seq_to_score_labels, std::vector< PeptideIdentification > const &ids)
static void setPeptideScoresFromMap_(std::unordered_map< String, ScoreToTgtDecLabelPair > const &seq_to_fdr, ConsensusMap &map, std::string const &score_type, bool keep_decoys, bool include_unassigned)
static bool getTDLabel_(const MetaInfoInterface &idOrHit)
For peptide hits, a hit is considered target also if it maps to both a target and a decoy protein (i....
Definition: IDScoreGetterSetter.h:267
static void getPeptideScoresFromMap_(ScoreToTgtDecLabelPairs &scores_labels, const ConsensusMap &cmap, bool include_unassigned_peptides, Args &&... args)
Helper for getting scores in ConsensusMaps.
Definition: IDScoreGetterSetter.h:252
static void checkTDAnnotation_(const MetaInfoInterface &id_or_hit)
To check the metavalues before we do anything.
Definition: IDScoreGetterSetter.h:609
static void getPickedProteinGroupScores_(const std::unordered_map< String, ScoreToTgtDecLabelPair > &picked_scores, ScoreToTgtDecLabelPairs &scores_labels, const std::vector< ProteinIdentification::ProteinGroup > &grps, const String &decoy_string, bool decoy_prefix)
Fills the scores_labels vector from a vector of ProteinGroups grps for picked protein group FDR.
static void setScoreAndMoveIfTarget_(const std::map< double, double > &scores_to_FDR, PeptideHit &hit, const std::string &old_score_type, std::vector< PeptideHit > &new_hits, int charge)
Used when keep_decoy_peptides is false and charge states are considered.
Definition: IDScoreGetterSetter.h:555
static void getPickedProteinScores_(std::unordered_map< String, ScoreToTgtDecLabelPair > &picked_scores, const ProteinIdentification &id, const String &decoy_string, bool decoy_prefix)
Fills the scores_labels vector from an ProteinIdentification id for picked protein FDR....
void applyFunctionOnPeptideIDs(T &&f, bool include_unassigned=true)
applies a function on all PeptideIDs or only assigned ones
Definition: MapUtilities.h:68
Interface for classes that can store arbitrary meta information (Type-Name-Value tuples).
Definition: MetaInfoInterface.h:61
bool metaValueExists(const String &name) const
Returns whether an entry with the given name exists.
void setMetaValue(const String &name, const DataValue &value)
Sets the DataValue corresponding to a name.
const DataValue & getMetaValue(const String &name) const
Returns the value corresponding to a string, or DataValue::EMPTY if not found.
Representation of a peptide hit.
Definition: PeptideHit.h:57
double getScore() const
returns the PSM score
Int getCharge() const
returns the charge of the peptide
void setScore(double score)
sets the PSM score
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:65
Representation of a protein hit.
Definition: ProteinHit.h:60
double getScore() const
returns the score of the protein hit
Representation of a protein identification run.
Definition: ProteinIdentification.h:76
A more convenient string class.
Definition: String.h:60
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, IDPredicate &&fun, bool all_hits, Args &&... args)
Definition: IDScoreGetterSetter.h:196
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const PeptideHit &hit, HitPredicate &&fun)
Definition: IDScoreGetterSetter.h:224
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const std::vector< PeptideIdentification > &ids, Args &&... args)
Definition: IDScoreGetterSetter.h:145
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const HitType &hit)
Definition: IDScoreGetterSetter.h:236
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const std::vector< ProteinIdentification::ProteinGroup > &grps, const std::unordered_set< std::string > &decoy_accs)
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const ProteinIdentification &id)
Definition: IDScoreGetterSetter.h:156
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, bool all_hits, Args &&... args)
Definition: IDScoreGetterSetter.h:172
static void setScoresHigherWorseAndRemoveDecoys_(const std::map< double, double > &scores_to_FDR, IDType &id, const String &old_score_type, Args &&... args)
Definition: IDScoreGetterSetter.h:374
static void setScores_(const std::map< double, double > &scores_to_FDR, std::vector< ProteinIdentification::ProteinGroup > &grps, const std::string &score_type, bool higher_better)
static String setScoreType_(IDType &id, const std::string &score_type, bool higher_better)
Definition: IDScoreGetterSetter.h:297
static void setScoreHigherWorse_(const std::map< double, double > &scores_to_FDR, HitType &hit, const std::string &old_score_type)
Definition: IDScoreGetterSetter.h:395
static void setScores_(const std::map< double, double > &scores_to_FDR, PeptideIdentification &id, const std::string &score_type, bool higher_better, bool keep_decoy, int charge, const String &identifier)
Definition: IDScoreGetterSetter.h:430
static void setScores_(const std::map< double, double > &scores_to_FDR, IDType &id, const std::string &score_type, bool higher_better, bool keep_decoy, const String &identifier)
Definition: IDScoreGetterSetter.h:445
static void setScores_(const std::map< double, double > &scores_to_FDR, PeptideIdentification &id, const std::string &score_type, bool higher_better, bool keep_decoy, int charge)
Definition: IDScoreGetterSetter.h:412
static void setScore_(const std::map< double, double > &scores_to_FDR, HitType &hit, const std::string &old_score_type)
Definition: IDScoreGetterSetter.h:388
static void setScoresHigherWorse_(const std::map< double, double > &scores_to_FDR, IDType &id, const String &old_score_type)
Definition: IDScoreGetterSetter.h:349
static void setScoresAndRemoveDecoys_(const std::map< double, double > &scores_to_FDR, IDType &id, const String &old_score_type, Args &&... args)
Definition: IDScoreGetterSetter.h:360
static void setScores_(const std::map< double, double > &scores_to_FDR, IDType &id, const std::string &score_type, bool higher_better, int charge)
Definition: IDScoreGetterSetter.h:478
static void setScores_(const std::map< double, double > &scores_to_FDR, IDType &id, const std::string &score_type, bool higher_better, bool keep_decoy)
Definition: IDScoreGetterSetter.h:307
static void setScores_(const std::map< double, double > &scores_to_FDR, std::vector< IDType > &ids, const std::string &score_type, bool higher_better, Args &&... args)
Definition: IDScoreGetterSetter.h:284
static void setScores_(const std::map< double, double > &scores_to_FDR, PeptideIdentification &id, const std::string &score_type, bool higher_better, int charge, const String &identifier)
Definition: IDScoreGetterSetter.h:454
static void setScores_(const std::map< double, double > &scores_to_FDR, IDType &id, const String &old_score_type)
Definition: IDScoreGetterSetter.h:338
static void setScores_(const std::map< double, double > &scores_to_FDR, IDType &id, const std::string &score_type, bool higher_better, const String &identifier)
Definition: IDScoreGetterSetter.h:468
custom arguments to allow for looping calls
Definition: WizardHelper.h:73
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
std::pair< double, double > ScoreToTgtDecLabelPair
Definition: IDScoreGetterSetter.h:53
Definition: IDScoreGetterSetter.h:79
static bool const value
Definition: IDScoreGetterSetter.h:80
Definition: IDScoreGetterSetter.h:72
static bool const value
Definition: IDScoreGetterSetter.h:73
Definition: IDScoreGetterSetter.h:57
std::vector< ScoreToTgtDecLabelPair > Base
Definition: IDScoreGetterSetter.h:58