All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
IDScoreSwitcherAlgorithm.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, OpenMS Inc. -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Julianus Pfeuffer $
6 // $Authors: Julianus Pfeuffer $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
16 
17 #include <algorithm>
18 #include <vector>
19 #include <set>
20 
21 namespace OpenMS
22 {
23 
39  class OPENMS_DLLAPI IDScoreSwitcherAlgorithm :
40  public DefaultParamHandler
41  {
42  public:
45 
53  enum class ScoreType
54  {
55  RAW,
56  RAW_EVAL,
57  PP,
58  PEP,
59  FDR,
60  QVAL,
61  };
62 
74  bool isScoreType(const String& score_name, const ScoreType& type)
75  {
76  String chopped = score_name;
77  if (chopped.hasSuffix("_score"))
78  {
79  chopped = chopped.chop(6);
80  }
81  const std::set<String>& possible_types = type_to_str_[type];
82  return possible_types.find(chopped) != possible_types.end();
83  }
84 
97  static ScoreType toScoreTypeEnum(String score_type)
98  {
99  if (score_type.hasSuffix("_score"))
100  {
101  score_type = score_type.chop(6);
102  }
103  score_type.toLower();
104  score_type.erase(std::remove_if(score_type.begin(), score_type.end(),
105  [](unsigned char c) { return c == '-' || c == '_' || c == ' '; }),
106  score_type.end());
107 
108  const std::map<String, ScoreType> s_to_type =
109  {
110  {"raw", ScoreType::RAW},
111  {"rawevalue", ScoreType::RAW_EVAL},
112  {"qvalue", ScoreType::QVAL},
113  {"fdr", ScoreType::FDR},
114  {"falsediscoveryrate", ScoreType::FDR},
115  {"pep", ScoreType::PEP},
116  {"posteriorerrorprobability", ScoreType::PEP},
117  {"posteriorprobabilty", ScoreType::PP},
118  {"pp", ScoreType::PP}
119  };
120 
121  if (auto it = s_to_type.find(score_type); it != s_to_type.end())
122  {
123  return it->second;
124  }
125  else
126  {
127  throw Exception::MissingInformation(__FILE__, __LINE__,
128  OPENMS_PRETTY_FUNCTION, String("Unknown score type '") + score_type + "'.");
129  }
130  }
131 
139  {
140  return type_to_better_[score_type];
141  }
142 
148  std::vector<String> getScoreNames();
149 
170  template <typename IDType>
171  void switchScores(IDType& id, Size& counter)
172  {
173  for (auto hit_it = id.getHits().begin();
174  hit_it != id.getHits().end(); ++hit_it, ++counter)
175  {
176  if (!hit_it->metaValueExists(new_score_))
177  {
178  std::stringstream msg;
179  msg << "Meta value '" << new_score_ << "' not found for " << *hit_it;
180  throw Exception::MissingInformation(__FILE__, __LINE__,
181  OPENMS_PRETTY_FUNCTION, msg.str());
182  }
183 
184  const String& old_score_meta = (old_score_.empty() ? id.getScoreType() :
185  old_score_);
186  const DataValue& dv = hit_it->getMetaValue(old_score_meta);
187  if (!dv.isEmpty()) // meta value for old score already exists
188  {
189  // TODO: find a better way to check if old score type is something different (even if it has same name)
190  // This currently, is a workaround for e.g., having Percolator_qvalue as meta value and same q-value as main score (getScore()).
191  // Note by jpfeuffer: The problem with this is, that this may add the old score to some of the hits if different, but not
192  // all, in case one is by chance the same. I would be fine with this, if it was done in the beginning and checked
193  // for every score.
194  if (fabs((double(dv) - hit_it->getScore()) * 2.0 /
195  (double(dv) + hit_it->getScore())) > tolerance_)
196  {
197  hit_it->setMetaValue(old_score_meta + "~", hit_it->getScore());
198  }
199  }
200  else
201  {
202  hit_it->setMetaValue(old_score_meta, hit_it->getScore());
203  }
204  hit_it->setScore(hit_it->getMetaValue(new_score_));
205  }
206  id.setScoreType(new_score_type_);
207  id.setHigherScoreBetter(higher_better_);
208  }
209 
236  template<class IDType>
237  void switchToGeneralScoreType(std::vector<IDType>& id, ScoreType type, Size& counter)
238  {
239  if (id.empty()) return;
240  String t = findScoreType(id[0], type);
241  if (t.empty())
242  {
243  String msg = "First encountered ID does not have the requested score type.";
244  throw Exception::MissingInformation(__FILE__, __LINE__,
245  OPENMS_PRETTY_FUNCTION, msg);
246  }
247  else if (t == id[0].getScoreType())
248  {
249  // we assume that all the other peptide ids
250  // also already have the correct score set
251  return;
252  }
253 
254  if (t.hasSuffix("_score"))
255  {
256  new_score_type_ = t.chop(6);
257  }
258  else
259  {
260  new_score_type_ = t;
261  }
262  new_score_ = t;
263 
264  if (higher_better_ != type_to_better_[type])
265  {
266  OPENMS_LOG_WARN << "Requested score type does not match the expected score direction. Correcting!\n";
267  higher_better_ = type_to_better_[type];
268  }
269  for (auto& i : id)
270  {
271  switchScores(i, counter);
272  }
273  }
274 
285  {
286  std::vector<PeptideIdentification>& vec = pep_ids.getData();
287  switchToGeneralScoreType(vec, type, counter);
288  }
289 
303  void switchToGeneralScoreType(ConsensusMap& cmap, ScoreType type, Size& counter, bool unassigned_peptides_too = true)
304  {
305  String new_type = "";
306  for (const auto& f : cmap)
307  {
308  const auto& ids = f.getPeptideIdentifications();
309  if (!ids.empty())
310  {
311  new_type = findScoreType(ids[0], type);
312  if (new_type == ids[0].getScoreType())
313  {
314  return;
315  }
316  else
317  {
318  break;
319  }
320  }
321  }
322 
323  if (new_type.empty())
324  {
325  String msg = "First encountered ID does not have the requested score type.";
326  throw Exception::MissingInformation(__FILE__, __LINE__,
327  OPENMS_PRETTY_FUNCTION, msg);
328  }
329 
330  if (new_type.hasSuffix("_score"))
331  {
332  new_score_type_ = new_type.chop(6);
333  }
334  else
335  {
336  new_score_type_ = new_type;
337  }
338  new_score_ = new_type;
339 
340  if (higher_better_ != type_to_better_[type])
341  {
342  OPENMS_LOG_WARN << "Requested score type does not match the expected score direction. Correcting!\n";
343  higher_better_ = type_to_better_[type];
344  }
345 
346  const auto switchScoresSingle = [&counter,this](PeptideIdentification& id){switchScores(id,counter);};
347  cmap.applyFunctionOnPeptideIDs(switchScoresSingle, unassigned_peptides_too);
348  }
349 
364  const PeptideIdentificationList& pep_ids,
365  String& name,
366  bool& higher_better,
367  ScoreType& score_type)
368  {
369  //TODO check all pep IDs? this assumes equality
370  if (!pep_ids.empty())
371  {
372  name = pep_ids[0].getScoreType(); // The name of the score. Typically a name like "XTandem" or "Percolator_qvalue"
373  higher_better = pep_ids[0].isHigherScoreBetter();
374 
375  // look up the score category ("RAW", "PEP", "q-value", etc.) for the given score name
376  for (auto& [scoretype, names] : type_to_str_)
377  {
378  if (names.find(name) != names.end())
379  {
380  score_type = scoretype;
381  OPENMS_LOG_INFO << "Found score type " << name << " to be of type "
382  << static_cast<std::underlying_type<ScoreType>::type>(scoretype) << std::endl;
383  return;
384  }
385  }
386  }
387  }
388 
404  String& name,
405  bool& higher_better,
406  ScoreType& score_type,
407  bool include_unassigned = true)
408  {
409  name = "";
410  higher_better = true;
411 
412  // TODO: check all pep IDs? this assumes equality to first encountered
413  for (const auto& cf : cmap)
414  {
415  const auto& pep_ids = cf.getPeptideIdentifications();
416  if (!pep_ids.empty())
417  {
418  name = pep_ids[0].getScoreType();
419  higher_better = pep_ids[0].isHigherScoreBetter();
420 
421  // look up the score category ("RAW", "PEP", "q-value", etc.) for the given score name
422  for (auto& [scoretype, names] : type_to_str_)
423  {
424  if (names.find(name) != names.end())
425  {
426  score_type = scoretype;
427  return;
428  }
429  }
430  }
431  }
432 
433  if (name.empty() && include_unassigned)
434  {
435  for (const auto& id : cmap.getUnassignedPeptideIdentifications())
436  {
437  name = id.getScoreType();
438  higher_better = id.isHigherScoreBetter();
439 
440  // look up the score category ("RAW", "PEP", "q-value", etc.) for the given score name
441  for (auto& [scoretype, names] : type_to_str_)
442  {
443  if (names.find(name) != names.end())
444  {
445  score_type = scoretype;
446  return;
447  }
448  }
449  return;
450  }
451  }
452  }
453 
467  void switchScores(ConsensusMap& cmap, Size& counter, bool unassigned_peptides_too = true)
468  {
469  for (const auto& f : cmap)
470  {
471  const auto& ids = f.getPeptideIdentifications();
472  if (!ids.empty())
473  {
474  if (new_score_ == ids[0].getScoreType()) // correct score or category already set
475  {
476  return;
477  }
478  else
479  {
480  break;
481  }
482  }
483  }
484  const auto switchScoresSingle = [&counter,this](PeptideIdentification& id){switchScores(id,counter);};
485  cmap.applyFunctionOnPeptideIDs(switchScoresSingle, unassigned_peptides_too);
486  }
487 
500  void switchScores(PeptideIdentificationList& pep_ids, Size& counter)
501  {
502  if (pep_ids.empty()) return;
503 
504  if (new_score_ == pep_ids[0].getScoreType()) // correct score already set
505  {
506  return;
507  }
508 
509  for (auto& id : pep_ids)
510  {
511  switchScores(id, counter);
512  }
513  }
514 
539  template <typename IDType>
541  {
542  const String& curr_score_type = id.getScoreType();
543  const std::set<String>& possible_types = type_to_str_[type];
544  if (possible_types.find(curr_score_type) != possible_types.end())
545  {
546  OPENMS_LOG_INFO << "Requested score type already set as main score: " + curr_score_type + "\n";
547  return curr_score_type;
548  }
549  else
550  {
551  if (id.getHits().empty())
552  {
553  OPENMS_LOG_WARN << "Identification entry used to check for alternative score was empty.\n";
554  return "";
555  }
556  const auto& hit = id.getHits()[0];
557  for (const auto& poss_str : possible_types)
558  {
559  if (hit.metaValueExists(poss_str))
560  {
561  return poss_str;
562  }
563  else if (hit.metaValueExists(poss_str + "_score"))
564  {
565  return poss_str + "_score";
566  }
567  }
568  OPENMS_LOG_WARN << "Score of requested type not found in the UserParams of the checked ID object.\n";
569  return "";
570  }
571  }
572 
582  {
583  // the score name, orientation and type used before the switch
585  bool original_score_higher_better = true;
587  // the score name, orientation and type used after the switch
588  bool requested_score_higher_better = original_score_higher_better;
589  IDScoreSwitcherAlgorithm::ScoreType requested_score_type = original_score_type;
590  String requested_score_name; // the search engine score name (e.g. "X!Tandem_score" or score category (e.g. "PEP")
591  // wheter the main score was switched
592  bool score_switched = false;
593  };
594 
608  static IDSwitchResult switchToScoreType(ConsensusMap& cmap, String requested_score_type_as_string, bool include_unassigned = true)
609  {
610  IDSwitchResult result;
611  // fill in the original score name, orientation and type
613  result.original_score_name,
615  result.original_score_type,
616  include_unassigned);
617 
618  // initalize with the assumption that the main score is the requested score
619  result.requested_score_name = result.original_score_name; // the search engine score name (e.g. "X!Tandem_score" or score category (e.g. "PEP")
622 
623  // no score type specified -> use main score
624  if (requested_score_type_as_string.empty())
625  {
626  OPENMS_LOG_DEBUG << "No score type specified. Using main score." << std::endl;
627  return result;
628  }
629 
630  // ENUM for requested score type (e.g. "RAW", "PEP", "q-value")
631  result.requested_score_type = IDScoreSwitcherAlgorithm::toScoreTypeEnum(requested_score_type_as_string);
632  if (result.requested_score_type != result.original_score_type) // switch needed because we change type?
633  { // user requests a different score type than the main score
636  auto param = idsa.getDefaults();
637  param.setValue("new_score", result.requested_score_name);
638  param.setValue("new_score_orientation", result.requested_score_higher_better ? "higher_better" : "lower_better");
639  param.setValue("proteins", "false");
640  param.setValue("old_score", ""); // use default name generated for old score
641  idsa.setParameters(param);
642 
643  Size counter = 0;
644  idsa.switchToGeneralScoreType(cmap, result.requested_score_type, counter, include_unassigned);
645  OPENMS_LOG_DEBUG << "Switched scores for " << counter << " IDs." << std::endl;
646  result.score_switched = true;
647  }
648 
649  // update after potential switch and read out actual score name
651  result.requested_score_name,
653  result.requested_score_type,
654  include_unassigned);
655 
656  return result;
657  }
658 
673  static IDSwitchResult switchToScoreType(PeptideIdentificationList& pep_ids, String requested_score_type_as_string)
674  {
675  IDSwitchResult result;
676  // fill in the original score name, orientation and type
678  result.original_score_name,
680  result.original_score_type
681  );
682 
683  // initalize with the assumption that the main score is the requested score
684  result.requested_score_name = result.original_score_name; // the search engine score name (e.g. "X!Tandem_score" or score category (e.g. "PEP")
687 
688  // no score type specified -> use main score
689  if (requested_score_type_as_string.empty())
690  {
691  OPENMS_LOG_DEBUG << "No score type specified. Using main score." << std::endl;
692  return result;
693  }
694 
695  // ENUM for requested score type (e.g. "RAW", "PEP", "q-value")
696  result.requested_score_type = IDScoreSwitcherAlgorithm::toScoreTypeEnum(requested_score_type_as_string);
697  if (result.requested_score_type != result.original_score_type) // switch needed because we change type?
698  { // user requests a different score type than the main score
701  auto param = idsa.getDefaults();
702  param.setValue("new_score", result.requested_score_name);
703  param.setValue("new_score_orientation", result.requested_score_higher_better ? "higher_better" : "lower_better");
704  param.setValue("proteins", "false");
705  param.setValue("old_score", ""); // use default name generated for old score
706  idsa.setParameters(param);
707  Size counter = 0;
708  idsa.switchToGeneralScoreType(pep_ids, result.requested_score_type, counter);
709  OPENMS_LOG_DEBUG << "Switched scores for " << counter << " IDs." << std::endl;
710 
711  result.score_switched = true;
712  }
713 
714  // update after potential switch and read out actual score name
716  result.requested_score_name,
718  result.requested_score_type
719  );
720 
721  return result;
722  }
723 
734  static void switchBackScoreType(ConsensusMap& cmap, IDSwitchResult isr, bool include_unassigned = true)
735  {
736  if (isr.score_switched)
737  {
738  // switch back to original score
740  auto param = idsa.getDefaults();
741  param.setValue("new_score", isr.original_score_name);
742  param.setValue("new_score_orientation", isr.original_score_higher_better ? "higher_better" : "lower_better");
743  param.setValue("proteins", "false");
744  param.setValue("old_score", ""); // use default name generated for old score
745  idsa.setParameters(param);
746  Size counter = 0;
747  idsa.switchScores(cmap, counter, include_unassigned);
748  OPENMS_LOG_DEBUG << "Switched scores back for " << counter << " PSMs." << std::endl;
749  }
750  }
751 
763  {
764  if (isr.score_switched)
765  {
766  // switch back to original score
768  auto param = idsa.getDefaults();
769  param.setValue("new_score", isr.original_score_name);
770  param.setValue("new_score_orientation", isr.original_score_higher_better ? "higher_better" : "lower_better");
771  param.setValue("proteins", "false");
772  param.setValue("old_score", ""); // use default name generated for old score
773  idsa.setParameters(param);
774  Size counter = 0;
775  idsa.switchScores(pep_ids, counter);
776  OPENMS_LOG_DEBUG << "Switched scores back for " << counter << " PSMs." << std::endl;
777  }
778  }
779 
780  private:
781 
782  void updateMembers_() override;
783 
785  const double tolerance_ = 1e-6;
786 
788  String new_score_, new_score_type_, old_score_;
789 
791  bool higher_better_; // for the new scores, are higher ones better?
792 
794  std::map<ScoreType, std::set<String>> type_to_str_ =
795  {
796  //TODO introduce real meaningful score names for XTandem, Mascot etc. (e.g., hyperscore)
797  {ScoreType::RAW, {"svm", "MS:1001492", "XTandem", "OMSSA", "SEQUEST:xcorr", "Mascot", "mvh", "hyperscore", "ln(hyperscore)"}},
798  //TODO find out reasonable raw scores for SES that provide E-Values as main score or see below
799  //TODO there is no test for spectraST idXML, so I don't know its score
800  //TODO check if we should combine RAW and RAW_EVAL:
801  // What if a SE does not have an e-value score (spectrast, OMSSA, crux/sequest, myrimatch),
802  // then you need additional if's/try's
803  {ScoreType::RAW_EVAL, {"expect", "SpecEValue", "E-Value", "evalue", "MS:1002053", "MS:1002257"}},
804  {ScoreType::PP, {"Posterior Probability"}},
805  {ScoreType::PEP, {"Posterior Error Probability", "pep", "MS:1001493"}}, // TODO add CV terms
806  {ScoreType::FDR, {"FDR", "fdr", "false discovery rate"}},
807  {ScoreType::QVAL, {"q-value", "qvalue", "MS:1001491", "q-Value", "qval"}}
808  };
809 
811  std::map<ScoreType, bool> type_to_better_ =
812  {
813  {ScoreType::RAW, true}, //TODO this might actually not always be true
814  {ScoreType::RAW_EVAL, false},
815  {ScoreType::PP, true},
816  {ScoreType::PEP, false},
817  {ScoreType::FDR, false},
818  {ScoreType::QVAL, false}
819  };
820  };
821 } // namespace OpenMS
#define OPENMS_LOG_DEBUG
Macro for general debugging information.
Definition: LogStream.h:454
#define OPENMS_LOG_WARN
Macro if a warning, a piece of information which should be read by the user, should be logged.
Definition: LogStream.h:444
#define OPENMS_LOG_INFO
Macro if a information, e.g. a status should be reported.
Definition: LogStream.h:449
A container for consensus elements.
Definition: ConsensusMap.h:68
const PeptideIdentificationList & getUnassignedPeptideIdentifications() const
non-mutable access to the unassigned peptide identifications
Class to hold strings, numeric values, lists of strings and lists of numeric values.
Definition: DataValue.h:33
bool isEmpty() const
Test if the value is empty.
Definition: DataValue.h:362
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
void setParameters(const Param &param)
Sets the parameters.
const Param & getDefaults() const
Non-mutable access to the default parameters.
Not all required information provided.
Definition: Exception.h:155
bool empty() const noexcept
Definition: ExposedVector.h:140
const VecMember & getData() const
read-only access to the underlying data
Definition: ExposedVector.h:328
This class is used to switch identification scores within identification or consensus feature maps.
Definition: IDScoreSwitcherAlgorithm.h:41
void switchScores(PeptideIdentificationList &pep_ids, Size &counter)
Switches the scores of peptide identifications.
Definition: IDScoreSwitcherAlgorithm.h:500
bool score_switched
Definition: IDScoreSwitcherAlgorithm.h:592
bool requested_score_higher_better
the type of the original score
Definition: IDScoreSwitcherAlgorithm.h:588
String findScoreType(IDType &id, IDScoreSwitcherAlgorithm::ScoreType type)
Searches for a specified score type within an identification object and its meta values.
Definition: IDScoreSwitcherAlgorithm.h:540
IDScoreSwitcherAlgorithm::ScoreType original_score_type
whether a higher original score is better
Definition: IDScoreSwitcherAlgorithm.h:586
bool isScoreTypeHigherBetter(ScoreType score_type)
Determines whether a higher score type is better given a ScoreType enum.
Definition: IDScoreSwitcherAlgorithm.h:138
void switchToGeneralScoreType(PeptideIdentificationList &pep_ids, ScoreType type, Size &counter)
Switches the score type of a PeptideIdentificationList to a general score type.
Definition: IDScoreSwitcherAlgorithm.h:284
void determineScoreNameOrientationAndType(const ConsensusMap &cmap, String &name, bool &higher_better, ScoreType &score_type, bool include_unassigned=true)
Determines the score type and orientation of the main score in a ConsensusMap.
Definition: IDScoreSwitcherAlgorithm.h:403
void switchToGeneralScoreType(ConsensusMap &cmap, ScoreType type, Size &counter, bool unassigned_peptides_too=true)
Switches the score type of a ConsensusMap to a general score type.
Definition: IDScoreSwitcherAlgorithm.h:303
IDScoreSwitcherAlgorithm::ScoreType requested_score_type
whether a higher requested score is better
Definition: IDScoreSwitcherAlgorithm.h:589
void switchScores(IDType &id, Size &counter)
Switches the main scores of all hits in an identification object based on the new scoring settings.
Definition: IDScoreSwitcherAlgorithm.h:171
static ScoreType toScoreTypeEnum(String score_type)
Converts a string representation of a score type to a ScoreType enum.
Definition: IDScoreSwitcherAlgorithm.h:97
std::vector< String > getScoreNames()
Gets a vector of all score names that are used in OpenMS.
void switchScores(ConsensusMap &cmap, Size &counter, bool unassigned_peptides_too=true)
Switches the scores of peptide identifications in a ConsensusMap.
Definition: IDScoreSwitcherAlgorithm.h:467
String requested_score_name
the type of the requested score
Definition: IDScoreSwitcherAlgorithm.h:590
ScoreType
This is a rough hierarchy of possible score types in MS.
Definition: IDScoreSwitcherAlgorithm.h:54
@ RAW
Raw score, e.g., search engine specific scores like hyperscore.
void switchToGeneralScoreType(std::vector< IDType > &id, ScoreType type, Size &counter)
Switches the scoring type of identification objects to a general score type.
Definition: IDScoreSwitcherAlgorithm.h:237
void determineScoreNameOrientationAndType(const PeptideIdentificationList &pep_ids, String &name, bool &higher_better, ScoreType &score_type)
Determines the score type and orientation of the main score for a set of peptide identifications.
Definition: IDScoreSwitcherAlgorithm.h:363
bool original_score_higher_better
The name of the original score used before the switch.
Definition: IDScoreSwitcherAlgorithm.h:585
void updateMembers_() override
documented in base class
String original_score_name
Definition: IDScoreSwitcherAlgorithm.h:584
IDScoreSwitcherAlgorithm()
Default constructor. Initializes the parameter handler with default values.
static void switchBackScoreType(ConsensusMap &cmap, IDSwitchResult isr, bool include_unassigned=true)
Reverts the score type of a ConsensusMap to its original type based on the provided IDSwitchResult.
Definition: IDScoreSwitcherAlgorithm.h:734
String new_score_
will be set according to the algorithm parameters
Definition: IDScoreSwitcherAlgorithm.h:788
static void switchBackScoreType(PeptideIdentificationList &pep_ids, IDSwitchResult isr)
Reverts the scoring type of peptide identifications to their original scores.
Definition: IDScoreSwitcherAlgorithm.h:762
static IDSwitchResult switchToScoreType(PeptideIdentificationList &pep_ids, String requested_score_type_as_string)
Switches the score type of peptide identifications to the requested type.
Definition: IDScoreSwitcherAlgorithm.h:673
static IDSwitchResult switchToScoreType(ConsensusMap &cmap, String requested_score_type_as_string, bool include_unassigned=true)
Switches the score type of a ConsensusMap to the requested score type.
Definition: IDScoreSwitcherAlgorithm.h:608
bool higher_better_
will be set according to the algorithm parameters
Definition: IDScoreSwitcherAlgorithm.h:791
bool isScoreType(const String &score_name, const ScoreType &type)
Checks if the given score name corresponds to a specific score type.
Definition: IDScoreSwitcherAlgorithm.h:74
Structure holding score switching information for IDScoreSwitcherAlgorithm.
Definition: IDScoreSwitcherAlgorithm.h:582
void applyFunctionOnPeptideIDs(T &&f, bool include_unassigned=true)
applies a function on all PeptideIDs or only assigned ones
Definition: MapUtilities.h:43
void setValue(const std::string &key, const ParamValue &value, const std::string &description="", const std::vector< std::string > &tags=std::vector< std::string >())
Sets a value.
Container for peptide identifications from multiple spectra.
Definition: PeptideIdentificationList.h:66
Represents the set of candidates (SpectrumMatches) identified for a single precursor spectrum.
Definition: PeptideIdentification.h:63
A more convenient string class.
Definition: String.h:34
String chop(Size n) const
Returns a substring where n characters were removed from the end of the string.
String & toLower()
Converts the string to lowercase.
bool hasSuffix(const String &string) const
true if String ends with string, false otherwise
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
const double c
Definition: Constants.h:188
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19