OpenMS
IDScoreSwitcherAlgorithm.h
Go to the documentation of this file.
1 // Copyright (c) 2002-present, The OpenMS Team -- 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 
15 
16 #include <algorithm>
17 #include <vector>
18 #include <set>
19 
20 namespace OpenMS
21 {
22 
38  class OPENMS_DLLAPI IDScoreSwitcherAlgorithm :
39  public DefaultParamHandler
40  {
41  public:
44 
52  enum class ScoreType
53  {
54  RAW,
55  RAW_EVAL,
56  PP,
57  PEP,
58  FDR,
59  QVAL,
60  };
61 
73  bool isScoreType(const String& score_name, const ScoreType& type)
74  {
75  String chopped = score_name;
76  if (chopped.hasSuffix("_score"))
77  {
78  chopped = chopped.chop(6);
79  }
80  const std::set<String>& possible_types = type_to_str_[type];
81  return possible_types.find(chopped) != possible_types.end();
82  }
83 
96  static ScoreType toScoreTypeEnum(String score_type)
97  {
98  if (score_type.hasSuffix("_score"))
99  {
100  score_type = score_type.chop(6);
101  }
102  score_type.toLower();
103  score_type.erase(std::remove_if(score_type.begin(), score_type.end(),
104  [](unsigned char c) { return c == '-' || c == '_' || c == ' '; }),
105  score_type.end());
106 
107  const std::map<String, ScoreType> s_to_type =
108  {
109  {"raw", ScoreType::RAW},
110  {"rawevalue", ScoreType::RAW_EVAL},
111  {"qvalue", ScoreType::QVAL},
112  {"fdr", ScoreType::FDR},
113  {"falsediscoveryrate", ScoreType::FDR},
114  {"pep", ScoreType::PEP},
115  {"posteriorerrorprobability", ScoreType::PEP},
116  {"posteriorprobabilty", ScoreType::PP},
117  {"pp", ScoreType::PP}
118  };
119 
120  if (auto it = s_to_type.find(score_type); it != s_to_type.end())
121  {
122  return it->second;
123  }
124  else
125  {
126  throw Exception::MissingInformation(__FILE__, __LINE__,
127  OPENMS_PRETTY_FUNCTION, String("Unknown score type '") + score_type + "'.");
128  }
129  }
130 
138  {
139  return type_to_better_[score_type];
140  }
141 
147  std::vector<String> getScoreNames();
148 
169  template <typename IDType>
170  void switchScores(IDType& id, Size& counter)
171  {
172  for (auto hit_it = id.getHits().begin();
173  hit_it != id.getHits().end(); ++hit_it, ++counter)
174  {
175  if (!hit_it->metaValueExists(new_score_))
176  {
177  std::stringstream msg;
178  msg << "Meta value '" << new_score_ << "' not found for " << *hit_it;
179  throw Exception::MissingInformation(__FILE__, __LINE__,
180  OPENMS_PRETTY_FUNCTION, msg.str());
181  }
182 
183  const String& old_score_meta = (old_score_.empty() ? id.getScoreType() :
184  old_score_);
185  const DataValue& dv = hit_it->getMetaValue(old_score_meta);
186  if (!dv.isEmpty()) // meta value for old score already exists
187  {
188  // TODO: find a better way to check if old score type is something different (even if it has same name)
189  // This currently, is a workaround for e.g., having Percolator_qvalue as meta value and same q-value as main score (getScore()).
190  // Note by jpfeuffer: The problem with this is, that this may add the old score to some of the hits if different, but not
191  // all, in case one is by chance the same. I would be fine with this, if it was done in the beginning and checked
192  // for every score.
193  if (fabs((double(dv) - hit_it->getScore()) * 2.0 /
194  (double(dv) + hit_it->getScore())) > tolerance_)
195  {
196  hit_it->setMetaValue(old_score_meta + "~", hit_it->getScore());
197  }
198  }
199  else
200  {
201  hit_it->setMetaValue(old_score_meta, hit_it->getScore());
202  }
203  hit_it->setScore(hit_it->getMetaValue(new_score_));
204  }
205  id.setScoreType(new_score_type_);
206  id.setHigherScoreBetter(higher_better_);
207  }
208 
235  template<class IDType>
236  void switchToGeneralScoreType(std::vector<IDType>& id, ScoreType type, Size& counter)
237  {
238  if (id.empty()) return;
239  String t = findScoreType(id[0], type);
240  if (t.empty())
241  {
242  String msg = "First encountered ID does not have the requested score type.";
243  throw Exception::MissingInformation(__FILE__, __LINE__,
244  OPENMS_PRETTY_FUNCTION, msg);
245  }
246  else if (t == id[0].getScoreType())
247  {
248  // we assume that all the other peptide ids
249  // also already have the correct score set
250  return;
251  }
252 
253  if (t.hasSuffix("_score"))
254  {
255  new_score_type_ = t.chop(6);
256  }
257  else
258  {
259  new_score_type_ = t;
260  }
261  new_score_ = t;
262 
263  if (higher_better_ != type_to_better_[type])
264  {
265  OPENMS_LOG_WARN << "Requested score type does not match the expected score direction. Correcting!\n";
266  higher_better_ = type_to_better_[type];
267  }
268  for (auto& i : id)
269  {
270  switchScores(i, counter);
271  }
272  }
273 
287  void switchToGeneralScoreType(ConsensusMap& cmap, ScoreType type, Size& counter, bool unassigned_peptides_too = true)
288  {
289  String new_type = "";
290  for (const auto& f : cmap)
291  {
292  const auto& ids = f.getPeptideIdentifications();
293  if (!ids.empty())
294  {
295  new_type = findScoreType(ids[0], type);
296  if (new_type == ids[0].getScoreType())
297  {
298  return;
299  }
300  else
301  {
302  break;
303  }
304  }
305  }
306 
307  if (new_type.empty())
308  {
309  String msg = "First encountered ID does not have the requested score type.";
310  throw Exception::MissingInformation(__FILE__, __LINE__,
311  OPENMS_PRETTY_FUNCTION, msg);
312  }
313 
314  if (new_type.hasSuffix("_score"))
315  {
316  new_score_type_ = new_type.chop(6);
317  }
318  else
319  {
320  new_score_type_ = new_type;
321  }
322  new_score_ = new_type;
323 
324  if (higher_better_ != type_to_better_[type])
325  {
326  OPENMS_LOG_WARN << "Requested score type does not match the expected score direction. Correcting!\n";
327  higher_better_ = type_to_better_[type];
328  }
329 
330  const auto switchScoresSingle = [&counter,this](PeptideIdentification& id){switchScores(id,counter);};
331  cmap.applyFunctionOnPeptideIDs(switchScoresSingle, unassigned_peptides_too);
332  }
333 
348  const std::vector<PeptideIdentification>& pep_ids,
349  String& name,
350  bool& higher_better,
351  ScoreType& score_type)
352  {
353  //TODO check all pep IDs? this assumes equality
354  if (!pep_ids.empty())
355  {
356  name = pep_ids[0].getScoreType(); // The name of the score. Typically a name like "XTandem" or "Percolator_qvalue"
357  higher_better = pep_ids[0].isHigherScoreBetter();
358 
359  // look up the score category ("RAW", "PEP", "q-value", etc.) for the given score name
360  for (auto& [scoretype, names] : type_to_str_)
361  {
362  if (names.find(name) != names.end())
363  {
364  score_type = scoretype;
365  OPENMS_LOG_INFO << "Found score type " << name << " to be of type "
366  << static_cast<std::underlying_type<ScoreType>::type>(scoretype) << std::endl;
367  return;
368  }
369  }
370  }
371  }
372 
388  String& name,
389  bool& higher_better,
390  ScoreType& score_type,
391  bool include_unassigned = true)
392  {
393  name = "";
394  higher_better = true;
395 
396  // TODO: check all pep IDs? this assumes equality to first encountered
397  for (const auto& cf : cmap)
398  {
399  const auto& pep_ids = cf.getPeptideIdentifications();
400  if (!pep_ids.empty())
401  {
402  name = pep_ids[0].getScoreType();
403  higher_better = pep_ids[0].isHigherScoreBetter();
404 
405  // look up the score category ("RAW", "PEP", "q-value", etc.) for the given score name
406  for (auto& [scoretype, names] : type_to_str_)
407  {
408  if (names.find(name) != names.end())
409  {
410  score_type = scoretype;
411  return;
412  }
413  }
414  }
415  }
416 
417  if (name.empty() && include_unassigned)
418  {
419  for (const auto& id : cmap.getUnassignedPeptideIdentifications())
420  {
421  name = id.getScoreType();
422  higher_better = id.isHigherScoreBetter();
423 
424  // look up the score category ("RAW", "PEP", "q-value", etc.) for the given score name
425  for (auto& [scoretype, names] : type_to_str_)
426  {
427  if (names.find(name) != names.end())
428  {
429  score_type = scoretype;
430  return;
431  }
432  }
433  return;
434  }
435  }
436  }
437 
451  void switchScores(ConsensusMap& cmap, Size& counter, bool unassigned_peptides_too = true)
452  {
453  for (const auto& f : cmap)
454  {
455  const auto& ids = f.getPeptideIdentifications();
456  if (!ids.empty())
457  {
458  if (new_score_ == ids[0].getScoreType()) // correct score or category already set
459  {
460  return;
461  }
462  else
463  {
464  break;
465  }
466  }
467  }
468  const auto switchScoresSingle = [&counter,this](PeptideIdentification& id){switchScores(id,counter);};
469  cmap.applyFunctionOnPeptideIDs(switchScoresSingle, unassigned_peptides_too);
470  }
471 
484  void switchScores(std::vector<PeptideIdentification>& pep_ids, Size& counter)
485  {
486  if (pep_ids.empty()) return;
487 
488  if (new_score_ == pep_ids[0].getScoreType()) // correct score already set
489  {
490  return;
491  }
492 
493  for (auto& id : pep_ids)
494  {
495  switchScores(id, counter);
496  }
497  }
498 
523  template <typename IDType>
525  {
526  const String& curr_score_type = id.getScoreType();
527  const std::set<String>& possible_types = type_to_str_[type];
528  if (possible_types.find(curr_score_type) != possible_types.end())
529  {
530  OPENMS_LOG_INFO << "Requested score type already set as main score: " + curr_score_type + "\n";
531  return curr_score_type;
532  }
533  else
534  {
535  if (id.getHits().empty())
536  {
537  OPENMS_LOG_WARN << "Identification entry used to check for alternative score was empty.\n";
538  return "";
539  }
540  const auto& hit = id.getHits()[0];
541  for (const auto& poss_str : possible_types)
542  {
543  if (hit.metaValueExists(poss_str))
544  {
545  return poss_str;
546  }
547  else if (hit.metaValueExists(poss_str + "_score"))
548  {
549  return poss_str + "_score";
550  }
551  }
552  OPENMS_LOG_WARN << "Score of requested type not found in the UserParams of the checked ID object.\n";
553  return "";
554  }
555  }
556 
566  {
567  // the score name, orientation and type used before the switch
569  bool original_score_higher_better = true;
571  // the score name, orientation and type used after the switch
572  bool requested_score_higher_better = original_score_higher_better;
573  IDScoreSwitcherAlgorithm::ScoreType requested_score_type = original_score_type;
574  String requested_score_name; // the search engine score name (e.g. "X!Tandem_score" or score category (e.g. "PEP")
575  // wheter the main score was switched
576  bool score_switched = false;
577  };
578 
592  static IDSwitchResult switchToScoreType(ConsensusMap& cmap, String requested_score_type_as_string, bool include_unassigned = true)
593  {
594  IDSwitchResult result;
595  // fill in the original score name, orientation and type
597  result.original_score_name,
599  result.original_score_type,
600  include_unassigned);
601 
602  // initalize with the assumption that the main score is the requested score
603  result.requested_score_name = result.original_score_name; // the search engine score name (e.g. "X!Tandem_score" or score category (e.g. "PEP")
606 
607  // no score type specified -> use main score
608  if (requested_score_type_as_string.empty())
609  {
610  OPENMS_LOG_DEBUG << "No score type specified. Using main score." << std::endl;
611  return result;
612  }
613 
614  // ENUM for requested score type (e.g. "RAW", "PEP", "q-value")
615  result.requested_score_type = IDScoreSwitcherAlgorithm::toScoreTypeEnum(requested_score_type_as_string);
616  if (result.requested_score_type != result.original_score_type) // switch needed because we change type?
617  { // user requests a different score type than the main score
620  auto param = idsa.getDefaults();
621  param.setValue("new_score", result.requested_score_name);
622  param.setValue("new_score_orientation", result.requested_score_higher_better ? "higher_better" : "lower_better");
623  param.setValue("proteins", "false");
624  param.setValue("old_score", ""); // use default name generated for old score
625  idsa.setParameters(param);
626 
627  Size counter = 0;
628  idsa.switchToGeneralScoreType(cmap, result.requested_score_type, counter, include_unassigned);
629  OPENMS_LOG_DEBUG << "Switched scores for " << counter << " IDs." << std::endl;
630  result.score_switched = true;
631  }
632 
633  // update after potential switch and read out actual score name
635  result.requested_score_name,
637  result.requested_score_type,
638  include_unassigned);
639 
640  return result;
641  }
642 
657  static IDSwitchResult switchToScoreType(std::vector<PeptideIdentification>& pep_ids, String requested_score_type_as_string)
658  {
659  IDSwitchResult result;
660  // fill in the original score name, orientation and type
662  result.original_score_name,
664  result.original_score_type
665  );
666 
667  // initalize with the assumption that the main score is the requested score
668  result.requested_score_name = result.original_score_name; // the search engine score name (e.g. "X!Tandem_score" or score category (e.g. "PEP")
671 
672  // no score type specified -> use main score
673  if (requested_score_type_as_string.empty())
674  {
675  OPENMS_LOG_DEBUG << "No score type specified. Using main score." << std::endl;
676  return result;
677  }
678 
679  // ENUM for requested score type (e.g. "RAW", "PEP", "q-value")
680  result.requested_score_type = IDScoreSwitcherAlgorithm::toScoreTypeEnum(requested_score_type_as_string);
681  if (result.requested_score_type != result.original_score_type) // switch needed because we change type?
682  { // user requests a different score type than the main score
685  auto param = idsa.getDefaults();
686  param.setValue("new_score", result.requested_score_name);
687  param.setValue("new_score_orientation", result.requested_score_higher_better ? "higher_better" : "lower_better");
688  param.setValue("proteins", "false");
689  param.setValue("old_score", ""); // use default name generated for old score
690  idsa.setParameters(param);
691  Size counter = 0;
692  idsa.switchToGeneralScoreType(pep_ids, result.requested_score_type, counter);
693  OPENMS_LOG_DEBUG << "Switched scores for " << counter << " IDs." << std::endl;
694 
695  result.score_switched = true;
696  }
697 
698  // update after potential switch and read out actual score name
700  result.requested_score_name,
702  result.requested_score_type
703  );
704 
705  return result;
706  }
707 
718  static void switchBackScoreType(ConsensusMap& cmap, IDSwitchResult isr, bool include_unassigned = true)
719  {
720  if (isr.score_switched)
721  {
722  // switch back to original score
724  auto param = idsa.getDefaults();
725  param.setValue("new_score", isr.original_score_name);
726  param.setValue("new_score_orientation", isr.original_score_higher_better ? "higher_better" : "lower_better");
727  param.setValue("proteins", "false");
728  param.setValue("old_score", ""); // use default name generated for old score
729  idsa.setParameters(param);
730  Size counter = 0;
731  idsa.switchScores(cmap, counter, include_unassigned);
732  OPENMS_LOG_DEBUG << "Switched scores back for " << counter << " PSMs." << std::endl;
733  }
734  }
735 
746  static void switchBackScoreType(std::vector<PeptideIdentification>& pep_ids, IDSwitchResult isr)
747  {
748  if (isr.score_switched)
749  {
750  // switch back to original score
752  auto param = idsa.getDefaults();
753  param.setValue("new_score", isr.original_score_name);
754  param.setValue("new_score_orientation", isr.original_score_higher_better ? "higher_better" : "lower_better");
755  param.setValue("proteins", "false");
756  param.setValue("old_score", ""); // use default name generated for old score
757  idsa.setParameters(param);
758  Size counter = 0;
759  idsa.switchScores(pep_ids, counter);
760  OPENMS_LOG_DEBUG << "Switched scores back for " << counter << " PSMs." << std::endl;
761  }
762  }
763 
764  private:
765 
766  void updateMembers_() override;
767 
769  const double tolerance_ = 1e-6;
770 
772  String new_score_, new_score_type_, old_score_;
773 
775  bool higher_better_; // for the new scores, are higher ones better?
776 
778  std::map<ScoreType, std::set<String>> type_to_str_ =
779  {
780  //TODO introduce real meaningful score names for XTandem, Mascot etc. (e.g., hyperscore)
781  {ScoreType::RAW, {"svm", "MS:1001492", "XTandem", "OMSSA", "SEQUEST:xcorr", "Mascot", "mvh", "hyperscore", "ln(hyperscore)"}},
782  //TODO find out reasonable raw scores for SES that provide E-Values as main score or see below
783  //TODO there is no test for spectraST idXML, so I don't know its score
784  //TODO check if we should combine RAW and RAW_EVAL:
785  // What if a SE does not have an e-value score (spectrast, OMSSA, crux/sequest, myrimatch),
786  // then you need additional if's/try's
787  {ScoreType::RAW_EVAL, {"expect", "SpecEValue", "E-Value", "evalue", "MS:1002053", "MS:1002257"}},
788  {ScoreType::PP, {"Posterior Probability"}},
789  {ScoreType::PEP, {"Posterior Error Probability", "pep", "MS:1001493"}}, // TODO add CV terms
790  {ScoreType::FDR, {"FDR", "fdr", "false discovery rate"}},
791  {ScoreType::QVAL, {"q-value", "qvalue", "MS:1001491", "q-Value", "qval"}}
792  };
793 
795  std::map<ScoreType, bool> type_to_better_ =
796  {
797  {ScoreType::RAW, true}, //TODO this might actually not always be true
798  {ScoreType::RAW_EVAL, false},
799  {ScoreType::PP, true},
800  {ScoreType::PEP, false},
801  {ScoreType::FDR, false},
802  {ScoreType::QVAL, false}
803  };
804  };
805 } // 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:66
const std::vector< PeptideIdentification > & 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
This class is used to switch identification scores within identification or consensus feature maps.
Definition: IDScoreSwitcherAlgorithm.h:40
bool score_switched
Definition: IDScoreSwitcherAlgorithm.h:576
bool requested_score_higher_better
the type of the original score
Definition: IDScoreSwitcherAlgorithm.h:572
static void switchBackScoreType(std::vector< PeptideIdentification > &pep_ids, IDSwitchResult isr)
Reverts the scoring type of peptide identifications to their original scores.
Definition: IDScoreSwitcherAlgorithm.h:746
String findScoreType(IDType &id, IDScoreSwitcherAlgorithm::ScoreType type)
Searches for a specified score type within an identification object and its meta values.
Definition: IDScoreSwitcherAlgorithm.h:524
IDScoreSwitcherAlgorithm::ScoreType original_score_type
whether a higher original score is better
Definition: IDScoreSwitcherAlgorithm.h:570
bool isScoreTypeHigherBetter(ScoreType score_type)
Determines whether a higher score type is better given a ScoreType enum.
Definition: IDScoreSwitcherAlgorithm.h:137
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:387
void determineScoreNameOrientationAndType(const std::vector< PeptideIdentification > &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:347
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:287
IDScoreSwitcherAlgorithm::ScoreType requested_score_type
whether a higher requested score is better
Definition: IDScoreSwitcherAlgorithm.h:573
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:170
static ScoreType toScoreTypeEnum(String score_type)
Converts a string representation of a score type to a ScoreType enum.
Definition: IDScoreSwitcherAlgorithm.h:96
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:451
String requested_score_name
the type of the requested score
Definition: IDScoreSwitcherAlgorithm.h:574
ScoreType
This is a rough hierarchy of possible score types in MS.
Definition: IDScoreSwitcherAlgorithm.h:53
@ 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:236
bool original_score_higher_better
The name of the original score used before the switch.
Definition: IDScoreSwitcherAlgorithm.h:569
static IDSwitchResult switchToScoreType(std::vector< PeptideIdentification > &pep_ids, String requested_score_type_as_string)
Switches the score type of peptide identifications to the requested type.
Definition: IDScoreSwitcherAlgorithm.h:657
void updateMembers_() override
documented in base class
void switchScores(std::vector< PeptideIdentification > &pep_ids, Size &counter)
Switches the scores of peptide identifications.
Definition: IDScoreSwitcherAlgorithm.h:484
String original_score_name
Definition: IDScoreSwitcherAlgorithm.h:568
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:718
String new_score_
will be set according to the algorithm parameters
Definition: IDScoreSwitcherAlgorithm.h:772
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:592
bool higher_better_
will be set according to the algorithm parameters
Definition: IDScoreSwitcherAlgorithm.h:775
bool isScoreType(const String &score_name, const ScoreType &type)
Checks if the given score name corresponds to a specific score type.
Definition: IDScoreSwitcherAlgorithm.h:73
Structure holding score switching information for IDScoreSwitcherAlgorithm.
Definition: IDScoreSwitcherAlgorithm.h:566
void applyFunctionOnPeptideIDs(T &&f, bool include_unassigned=true)
applies a function on all PeptideIDs or only assigned ones
Definition: MapUtilities.h:42
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.
Represents the peptide hits for a spectrum.
Definition: PeptideIdentification.h:39
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