OpenMS
MassDecomposition.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: Timo Sachsenberg $
6 // $Authors: Andreas Bertsch $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
11 #include <OpenMS/config.h>
12 #include <OpenMS/CONCEPT/Types.h>
13 
14 #include <map>
15 
16 namespace OpenMS
17 {
18  class String;
19 
27  class OPENMS_DLLAPI MassDecomposition
28  {
29 public:
30 
37 
40 
42  explicit MassDecomposition(const String& deco);
44 
51 
54 
56  String toString() const;
57 
60 
63 
67 
73  bool operator<(const MassDecomposition& rhs) const;
74 
76  bool operator==(const String& deco) const;
77 
79  bool containsTag(const String& tag) const;
80 
82  bool compatible(const MassDecomposition& deco) const;
84 
85 protected:
86  std::map<char, Size> decomp_;
88  };
89 } // namespace OpenMS
90 
Class represents a decomposition of a mass into amino acids.
Definition: MassDecomposition.h:28
MassDecomposition operator+(const MassDecomposition &rhs) const
adds this decomposition and the decomposition given and returns a new composition
bool operator<(const MassDecomposition &rhs) const
less than predicate
String toString() const
returns the decomposition as a string
bool compatible(const MassDecomposition &deco) const
returns true if the mass decomposition if contained in this instance
bool operator==(const String &deco) const
equality operator
MassDecomposition()
default constructor
MassDecomposition(const MassDecomposition &deco)
copy constructor
Size number_of_max_aa_
Definition: MassDecomposition.h:87
bool containsTag(const String &tag) const
returns true if tag is contained in the mass decomposition
MassDecomposition & operator=(const MassDecomposition &rhs)
assignment operator
std::map< char, Size > decomp_
Definition: MassDecomposition.h:86
MassDecomposition(const String &deco)
constructor with String as parameter
MassDecomposition & operator+=(const MassDecomposition &d)
adds the mass decomposition d to this object
String toExpandedString() const
returns the decomposition as a string; instead of frequencies the amino acids are repeated
Size getNumberOfMaxAA() const
returns the max frequency of this composition
A more convenient string class.
Definition: String.h:34
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:97
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19