OpenMS
WeightWrapper.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Chris Bielow$
6 // $Authors: Chris Bielow $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
13 
14 namespace OpenMS
15 {
16 
23  class OPENMS_DLLAPI WeightWrapper
24  {
25 
26 public:
27 
28  enum WEIGHTMODE {AVERAGE = 0, MONO, SIZE_OF_WEIGHTMODE};
29 
34 
38  explicit WeightWrapper(const WEIGHTMODE weight_mode);
39 
43  virtual ~WeightWrapper();
44 
48  WeightWrapper(const WeightWrapper & source);
49 
50 
57  void setWeightMode(const WEIGHTMODE mode);
58 
59 
67 
68 
76  double getWeight(const AASequence & aa) const;
77 
85  double getWeight(const EmpiricalFormula & ef) const;
86 
87 
95  double getWeight(const Residue & r, Residue::ResidueType res_type = Residue::Full) const;
96 
97 
98 private:
99 
101 
102 
103  };
104 }
Representation of a peptide/protein sequence.
Definition: AASequence.h:86
Representation of an empirical formula.
Definition: EmpiricalFormula.h:59
Representation of an amino acid residue.
Definition: Residue.h:37
ResidueType
Definition: Residue.h:126
@ Full
with N-terminus and C-terminus
Definition: Residue.h:127
Encapsulated weight queries to simplify mono vs average weight computation.
Definition: WeightWrapper.h:24
virtual ~WeightWrapper()
destructor
WEIGHTMODE weight_mode_
one of WeightWrapper::WEIGHTMODE's values
Definition: WeightWrapper.h:100
double getWeight(const EmpiricalFormula &ef) const
returns the weight of either mono or average value
WEIGHTMODE getWeightMode() const
Gets the weight mode (MONO or AVERAGE)
WeightWrapper(const WEIGHTMODE weight_mode)
constructor
void setWeightMode(const WEIGHTMODE mode)
Sets the weight mode (MONO or AVERAGE)
double getWeight(const AASequence &aa) const
returns the weight of either mono or average value
WEIGHTMODE
Definition: WeightWrapper.h:28
double getWeight(const Residue &r, Residue::ResidueType res_type=Residue::Full) const
returns the weight of either mono or average value
WeightWrapper(const WeightWrapper &source)
copy constructor
WeightWrapper()
constructor
@ AVERAGE
Definition: MetaData.h:50
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22