OpenMS  2.8.0
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-2021.
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 
125  //TODO could be done with set of target accessions, too
126  //TODO even better: store nr targets and nr decoys when creating the groups!
127  //TODO alternative scoring is possible, too (e.g. ratio of tgts vs decoys)
128  static void getScores_(
129  ScoreToTgtDecLabelPairs &scores_labels,
130  const std::vector<ProteinIdentification::ProteinGroup> &grps,
131  const std::unordered_set<std::string> &decoy_accs);
132 
133  static void getScores_(
134  ScoreToTgtDecLabelPairs &scores_labels,
135  const ProteinIdentification &id)
136  {
137 
138  scores_labels.reserve(scores_labels.size() + id.getHits().size());
139  std::transform(id.getHits().begin(), id.getHits().end(),
140  std::back_inserter(scores_labels),
141  [](const ProteinHit &hit)
142  {
143  checkTDAnnotation_(hit);
144  return std::make_pair<double, bool>(hit.getScore(), getTDLabel_(hit));
145  }
146  );
147 
148  }
149 
150  static void getScores_(
151  ScoreToTgtDecLabelPairs &scores_labels,
152  const PeptideIdentification &id, bool all_hits, int charge, const String &identifier)
153  {
154  if (id.getIdentifier() == identifier)
155  {
156  getScores_(scores_labels, id, all_hits, charge);
157  }
158  }
159 
160 
161  static void getScores_(
162  ScoreToTgtDecLabelPairs &scores_labels,
163  const PeptideIdentification &id, bool all_hits, const String &identifier)
164  {
165  if (id.getIdentifier() == identifier)
166  {
167  getScores_(scores_labels, id, all_hits);
168  }
169  }
170 
171  static void getScores_(
172  ScoreToTgtDecLabelPairs &scores_labels,
173  const PeptideIdentification &id, int charge, const String &identifier)
174  {
175  if (id.getIdentifier() == identifier)
176  {
177  getScores_(scores_labels, id, charge);
178  }
179  }
180 
181  template<typename IDType, typename std::enable_if<IsIDType<IDType>::value>::type * = nullptr>
182  static void getScores_(
183  ScoreToTgtDecLabelPairs &scores_labels,
184  const IDType &id, const String &identifier)
185  {
186  if (id.getIdentifier() == identifier)
187  {
188  getScores_(scores_labels, id);
189  }
190  }
191 
192  template<class ...Args>
193  static void getScores_(
194  ScoreToTgtDecLabelPairs &scores_labels,
195  const PeptideIdentification &id,
196  bool all_hits,
197  Args &&... args)
198  {
199  if (all_hits)
200  {
201  for (const PeptideHit &hit : id.getHits())
202  {
203  getScores_(scores_labels, hit, std::forward<Args>(args)...);
204  }
205  }
206  else
207  {
208  //TODO for speed I assume that they are sorted and first = best.
209  //id.sort();
210  const PeptideHit &hit = id.getHits()[0];
211  getScores_(scores_labels, hit, std::forward<Args>(args)...);
212  }
213  }
214 
215  static void getScores_(
216  ScoreToTgtDecLabelPairs &scores_labels,
217  const PeptideHit &hit,
218  int charge)
219  {
220  if (charge == hit.getCharge())
221  {
222  checkTDAnnotation_(hit);
223  scores_labels.emplace_back(hit.getScore(), getTDLabel_(hit));
224  }
225  }
226 
227  static void getScores_(
228  ScoreToTgtDecLabelPairs &scores_labels,
229  const PeptideIdentification &id,
230  int charge)
231  {
232  for (const PeptideHit &hit : id.getHits())
233  {
234  getScores_(scores_labels, hit, charge);
235  }
236  }
237 
238  template<typename HitType, typename std::enable_if<IsHitType<HitType>::value>::type * = nullptr>
239  static void getScores_(
240  ScoreToTgtDecLabelPairs &scores_labels,
241  const HitType &hit)
242  {
243  checkTDAnnotation_(hit);
244  scores_labels.emplace_back(hit.getScore(), getTDLabel_(hit));
245  }
246 
247  template<typename IDType, typename std::enable_if<IsIDType<IDType>::value>::type * = nullptr>
248  static void getScores_(
249  ScoreToTgtDecLabelPairs &scores_labels,
250  const IDType &id)
251  {
252  for (const typename IDType::HitType &hit : id.getHits())
253  {
254  getScores_(scores_labels, hit);
255  }
256  }
257 
258  template<class ...Args>
259  static void getScores_(
260  ScoreToTgtDecLabelPairs &scores_labels,
261  const std::vector<PeptideIdentification> &ids,
262  Args &&... args)
263  {
264  for (const auto &id : ids)
265  {
266  getScores_(scores_labels, id, std::forward<Args>(args)...);
267  }
268  }
277  template<class ...Args>
279  ScoreToTgtDecLabelPairs &scores_labels,
280  const ConsensusMap &cmap, bool include_unassigned_peptides, Args &&... args)
281  {
282  auto f =
283  [&](const PeptideIdentification &id) -> void
284  { getScores_(scores_labels, id, std::forward<Args>(args)...); };
285  cmap.applyFunctionOnPeptideIDs(f, include_unassigned_peptides);
286  }
287 
293  static bool getTDLabel_(const MetaInfoInterface &idOrHit)
294  {
295  return std::string(idOrHit.getMetaValue("target_decoy"))[0] == 't';
296  }
297 
309  template<typename IDType, class ...Args>
310  static void setScores_(const std::map<double, double> &scores_to_FDR,
311  std::vector<IDType> &ids,
312  const std::string &score_type,
313  bool higher_better,
314  Args &&... args)
315  {
316  for (auto &id : ids)
317  {
318  setScores_(scores_to_FDR, id, score_type, higher_better, std::forward<Args>(args)...);
319  }
320  }
321 
322  template<typename IDType>
323  static String setScoreType_(IDType &id, const std::string &score_type,
324  bool higher_better)
325  {
326  String old_score_type = id.getScoreType() + "_score";
327  id.setScoreType(score_type);
328  id.setHigherScoreBetter(higher_better);
329  return old_score_type;
330  }
331 
332  template<typename IDType>
333  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id, const std::string &score_type,
334  bool higher_better, bool keep_decoy)
335  {
336  bool old_higher_better = id.isHigherScoreBetter();
337  String old_score_type = setScoreType_(id, score_type, higher_better);
338 
339  if (keep_decoy) //in-place set scores
340  {
341  if (old_higher_better)
342  {
343  setScores_(scores_to_FDR, id, old_score_type);
344  }
345  else
346  {
347  setScoresHigherWorse_(scores_to_FDR, id, old_score_type);
348  }
349  }
350  else
351  {
352  if (old_higher_better)
353  {
354  setScoresAndRemoveDecoys_(scores_to_FDR, id, old_score_type);
355  }
356  else
357  {
358  setScoresHigherWorseAndRemoveDecoys_(scores_to_FDR, id, old_score_type);
359  }
360  }
361  }
362 
363  template<typename IDType>
364  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id,
365  const String &old_score_type)
366  {
367  std::vector<typename IDType::HitType> &hits = id.getHits();
368  for (auto &hit : hits)
369  {
370  setScore_(scores_to_FDR, hit, old_score_type);
371  }
372  }
373 
374  template<typename IDType>
375  static void setScoresHigherWorse_(const std::map<double, double> &scores_to_FDR, IDType &id,
376  const String &old_score_type)
377  {
378  std::vector<typename IDType::HitType> &hits = id.getHits();
379  for (auto &hit : hits)
380  {
381  setScoreHigherWorse_(scores_to_FDR, hit, old_score_type);
382  }
383  }
384 
385  template<typename IDType, class ...Args>
386  static void setScoresAndRemoveDecoys_(const std::map<double, double> &scores_to_FDR, IDType &id,
387  const String &old_score_type, Args&& ... args)
388  {
389  std::vector<typename IDType::HitType> &hits = id.getHits();
390  std::vector<typename IDType::HitType> new_hits;
391  new_hits.reserve(hits.size());
392  for (auto &hit : hits)
393  {
394  setScoreAndMoveIfTarget_(scores_to_FDR, hit, old_score_type, new_hits, std::forward<Args>(args)...);
395  }
396  hits.swap(new_hits);
397  }
398 
399  template<typename IDType, class ...Args>
400  static void setScoresHigherWorseAndRemoveDecoys_(const std::map<double, double> &scores_to_FDR, IDType &id,
401  const String &old_score_type, Args&& ... args)
402  {
403  std::vector<typename IDType::HitType> &hits = id.getHits();
404  std::vector<typename IDType::HitType> new_hits;
405  new_hits.reserve(hits.size());
406  for (auto &hit : hits)
407  {
408  setScoreHigherWorseAndMoveIfTarget_(scores_to_FDR, hit, old_score_type, new_hits, std::forward<Args>(args)...);
409  }
410  hits.swap(new_hits);
411  }
412 
413  template<typename HitType>
414  static void setScore_(const std::map<double, double> &scores_to_FDR, HitType &hit, const std::string &old_score_type)
415  {
416  hit.setMetaValue(old_score_type, hit.getScore());
417  hit.setScore(scores_to_FDR.lower_bound(hit.getScore())->second);
418  }
419 
420  template<typename HitType>
421  static void setScoreHigherWorse_(const std::map<double, double> &scores_to_FDR, HitType &hit, const std::string &old_score_type)
422  {
423  hit.setMetaValue(old_score_type, hit.getScore());
424  auto ub = scores_to_FDR.upper_bound(hit.getScore());
425  if (ub != scores_to_FDR.begin()) ub--;
426  hit.setScore(ub->second);
427  }
428 
429  /*template<typename IDType>
430  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id, const std::string &score_type,
431  bool higher_better)
432  {
433  bool old_higher_better = id.isHigherScoreBetter();
434  String old_score_type = setScoreType_(id, score_type, higher_better);
435  setScores_(scores_to_FDR, id, old_score_type, old_higher_better);
436  }*/
437 
438  static void setScores_(const std::map<double, double> &scores_to_FDR,
440  const std::string &score_type,
441  bool higher_better,
442  bool keep_decoy,
443  int charge)
444  {
445  String old_score_type = setScoreType_(id, score_type, higher_better);
446  if (keep_decoy) //in-place set scores
447  {
448  setScores_(scores_to_FDR, id, old_score_type, higher_better, charge);
449  }
450  else
451  {
452  setScoresAndRemoveDecoys_<PeptideIdentification>(scores_to_FDR, id, old_score_type, charge);
453  }
454  }
455 
456  static void setScores_(const std::map<double, double> &scores_to_FDR,
458  const std::string &score_type,
459  bool higher_better,
460  bool keep_decoy,
461  int charge,
462  const String &identifier)
463  {
464  if (id.getIdentifier() == identifier)
465  {
466  setScores_(scores_to_FDR, id, score_type, higher_better, keep_decoy, charge);
467  }
468  }
469 
470  template<typename IDType>
471  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id, const std::string &score_type,
472  bool higher_better, bool keep_decoy, const String &identifier)
473  {
474  if (id.getIdentifier() == identifier)
475  {
476  setScores_(scores_to_FDR, id, score_type, higher_better, keep_decoy);
477  }
478  }
479 
480  static void setScores_(const std::map<double, double> &scores_to_FDR,
482  const std::string &score_type,
483  bool higher_better,
484  int charge,
485  const String &identifier)
486  {
487  if (id.getIdentifier() == identifier)
488  {
489  setScores_(scores_to_FDR, id, score_type, higher_better, charge);
490  }
491  }
492 
493  template<typename IDType>
494  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id, const std::string &score_type,
495  bool higher_better, const String &identifier)
496  {
497  if (id.getIdentifier() == identifier)
498  {
499  setScores_(scores_to_FDR, id, score_type, higher_better);
500  }
501  }
502 
503  template<typename IDType>
504  static void setScores_(const std::map<double, double> &scores_to_FDR, IDType &id, const std::string &score_type,
505  bool higher_better, int charge)
506  {
507  for (auto& hit : id.getHits())
508  {
509  if (hit.getCharge() == charge)
510  {
511  if (higher_better)
512  {
513  setScore_(scores_to_FDR, hit, score_type);
514  }
515  else
516  {
517  setScoreHigherWorse_(scores_to_FDR, hit, score_type);
518  }
519  }
520  }
521  }
522 
523  //TODO could also get a keep_decoy flag when we define what a "decoy group" is -> keep all always for now
524  static void setScores_(
525  const std::map<double, double> &scores_to_FDR,
526  std::vector<ProteinIdentification::ProteinGroup> &grps,
527  const std::string &score_type,
528  bool higher_better);
529 
540  template<typename HitType>
541  static void setScoreAndMoveIfTarget_(const std::map<double, double> &scores_to_FDR,
542  HitType &hit,
543  const std::string &old_score_type,
544  std::vector<HitType> &new_hits)
545  {
546  const String &target_decoy(hit.getMetaValue("target_decoy"));
547  if (target_decoy[0] == 't')
548  {
549  hit.setMetaValue(old_score_type, hit.getScore());
550  hit.setScore(scores_to_FDR.lower_bound(hit.getScore())->second);
551  new_hits.push_back(std::move(hit));
552  } // else do not move over
553  }
554 
555  template<typename HitType>
556  static void setScoreHigherWorseAndMoveIfTarget_(const std::map<double, double> &scores_to_FDR,
557  HitType &hit,
558  const std::string &old_score_type,
559  std::vector<HitType> &new_hits)
560  {
561  const String &target_decoy(hit.getMetaValue("target_decoy"));
562  if (target_decoy[0] == 't')
563  {
564  hit.setMetaValue(old_score_type, hit.getScore());
565  auto ub = scores_to_FDR.upper_bound(hit.getScore());
566  if (ub != scores_to_FDR.begin()) ub--;
567  hit.setScore(ub->second);
568  new_hits.push_back(std::move(hit));
569  } // else do not move over
570  }
571 
572 
581  static void setScoreAndMoveIfTarget_(const std::map<double, double> &scores_to_FDR,
582  PeptideHit &hit,
583  const std::string &old_score_type,
584  std::vector<PeptideHit> &new_hits,
585  int charge)
586  {
587  if (charge == hit.getCharge())
588  {
589  const String &target_decoy(hit.getMetaValue("target_decoy"));
590  if (target_decoy[0] == 't')
591  {
592  hit.setMetaValue(old_score_type, hit.getScore());
593  hit.setScore(scores_to_FDR.lower_bound(hit.getScore())->second);
594  new_hits.push_back(std::move(hit));
595  } // else do not move over
596  }
597  else // different charge, move over unchanged to process later at correct charge.
598  {
599  new_hits.push_back(std::move(hit));
600  }
601  }
602 
613  template<class ...Args>
614  static void setPeptideScoresForMap_(const std::map<double, double> &scores_to_FDR,
615  ConsensusMap &cmap,
616  bool include_unassigned_peptides,
617  const std::string &score_type,
618  bool higher_better,
619  bool keep_decoy,
620  Args&&... args)
621  {
622  //Note: Gcc4.8 cannot handle variadic templates in lambdas
623  auto f =
624  [&](PeptideIdentification &id) -> void
625  { setScores_(scores_to_FDR, id, score_type,
626  higher_better, keep_decoy, std::forward<Args>(args)...); };
627  cmap.applyFunctionOnPeptideIDs(f, include_unassigned_peptides);
628  }
629 
635  static void checkTDAnnotation_(const MetaInfoInterface &id_or_hit)
636  {
637  if (!id_or_hit.metaValueExists("target_decoy"))
638  {
639  throw Exception::MissingInformation(__FILE__,
640  __LINE__,
641  OPENMS_PRETTY_FUNCTION,
642  "Meta value 'target_decoy' does not exist in all ProteinHits! Reindex the idXML file with 'PeptideIndexer'");
643  }
644  }
645  };
646 } // namespace OpenMS
A container for consensus elements.
Definition: ConsensusMap.h:90
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 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:556
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:541
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:614
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:293
static void getPeptideScoresFromMap_(ScoreToTgtDecLabelPairs &scores_labels, const ConsensusMap &cmap, bool include_unassigned_peptides, Args &&... args)
Helper for getting scores in ConsensusMaps.
Definition: IDScoreGetterSetter.h:278
static void checkTDAnnotation_(const MetaInfoInterface &id_or_hit)
To check the metavalues before we do anything.
Definition: IDScoreGetterSetter.h:635
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:581
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 DataValue &default_value=DataValue::EMPTY) const
Returns the value corresponding to a string, or a default value (default: DataValue::EMPTY) if not fo...
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:72
A more convenient string class.
Definition: String.h:60
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const IDType &id, const String &identifier)
Definition: IDScoreGetterSetter.h:182
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, int charge)
Definition: IDScoreGetterSetter.h:227
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, int charge, const String &identifier)
Definition: IDScoreGetterSetter.h:171
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const IDType &id)
Definition: IDScoreGetterSetter.h:248
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const PeptideHit &hit, int charge)
Definition: IDScoreGetterSetter.h:215
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const std::vector< PeptideIdentification > &ids, Args &&... args)
Definition: IDScoreGetterSetter.h:259
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const HitType &hit)
Definition: IDScoreGetterSetter.h:239
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, bool all_hits, const String &identifier)
Definition: IDScoreGetterSetter.h:161
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:133
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, bool all_hits, int charge, const String &identifier)
Definition: IDScoreGetterSetter.h:150
static void getScores_(ScoreToTgtDecLabelPairs &scores_labels, const PeptideIdentification &id, bool all_hits, Args &&... args)
Definition: IDScoreGetterSetter.h:193
static void setScoresHigherWorseAndRemoveDecoys_(const std::map< double, double > &scores_to_FDR, IDType &id, const String &old_score_type, Args &&... args)
Definition: IDScoreGetterSetter.h:400
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:323
static void setScoreHigherWorse_(const std::map< double, double > &scores_to_FDR, HitType &hit, const std::string &old_score_type)
Definition: IDScoreGetterSetter.h:421
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:456
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:471
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:438
static void setScore_(const std::map< double, double > &scores_to_FDR, HitType &hit, const std::string &old_score_type)
Definition: IDScoreGetterSetter.h:414
static void setScoresHigherWorse_(const std::map< double, double > &scores_to_FDR, IDType &id, const String &old_score_type)
Definition: IDScoreGetterSetter.h:375
static void setScoresAndRemoveDecoys_(const std::map< double, double > &scores_to_FDR, IDType &id, const String &old_score_type, Args &&... args)
Definition: IDScoreGetterSetter.h:386
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:504
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:333
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:310
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:480
static void setScores_(const std::map< double, double > &scores_to_FDR, IDType &id, const String &old_score_type)
Definition: IDScoreGetterSetter.h:364
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:494
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
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