OpenMS
Ribonucleotide.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-2023.
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: Hendrik Weisser $
32 // $Authors: Hendrik Weisser $
33 // --------------------------------------------------------------------------
34 
35 #pragma once
36 
39 #include <iosfwd>
40 
41 namespace OpenMS
42 {
51  class OPENMS_DLLAPI Ribonucleotide
52  {
53  friend class RibonucleotideDB;
54  public:
55 
57  {
61  NUMBER_OF_TERM_SPECIFICITY
62  };
63 
68  Ribonucleotide(const String& name = "unknown ribonucleotide",
69  const String& code = ".",
70  const String& new_code = "",
71  const String& html_code = ".",
72  const EmpiricalFormula& formula = EmpiricalFormula(),
73  char origin = '.',
74  double mono_mass = 0.0,
75  double avg_mass = 0.0,
76  enum TermSpecificityNuc term_spec = ANYWHERE,
77  const EmpiricalFormula& baseloss_formula =
78  default_baseloss_);
79 
81  Ribonucleotide(const Ribonucleotide& ribo) = default;
82 
84  virtual ~Ribonucleotide();
86 
91  Ribonucleotide& operator=(const Ribonucleotide& ribo) = default;
93 
94 
99  bool operator==(const Ribonucleotide& ribonucleotide) const;
101 
105 
107  const String getCode() const;
108 
110  void setCode(const String& code);
111 
113  const String getName() const;
114 
116  void setName(const String& name);
117 
120 
122  void setFormula(const EmpiricalFormula& formula);
123 
125  double getMonoMass() const;
126 
128  void setMonoMass(double mono_mass);
129 
131  double getAvgMass() const;
132 
134  void setAvgMass(double avg_mass);
135 
137  const String getNewCode() const;
138 
140  void setNewCode(const String &new_code);
141 
143  friend OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const Ribonucleotide& ribo);
144 
146  char getOrigin() const;
147 
149  void setOrigin(char origin);
150 
153 
155  void setHTMLCode(const String& html_code);
156 
158  enum TermSpecificityNuc getTermSpecificity() const;
159 
162 
165 
167  void setBaselossFormula(const EmpiricalFormula& formula);
168 
170 
172  bool isModified() const;
173 
175  bool isAmbiguous() const;
176 
177  protected:
180 
186  char origin_;
187  double mono_mass_;
188  double avg_mass_;
189  enum TermSpecificityNuc term_spec_;
191  };
192 
194  OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const Ribonucleotide& ribo);
195 
198 
199 }
Representation of an empirical formula.
Definition: EmpiricalFormula.h:85
Database of ribonucleotides (modified and unmodified)
Definition: RibonucleotideDB.h:52
Representation of a ribonucleotide (modified or unmodified)
Definition: Ribonucleotide.h:52
const EmpiricalFormula getBaselossFormula() const
Get sum formula after loss of the nucleobase.
double avg_mass_
average mass
Definition: Ribonucleotide.h:188
const String getNewCode() const
Get the "new" (Modomics) code.
virtual ~Ribonucleotide()
Destructor.
String new_code_
Modomics code.
Definition: Ribonucleotide.h:183
Ribonucleotide & operator=(const Ribonucleotide &ribo)=default
assignment operator
void setAvgMass(double avg_mass)
Get the average mass of the ribonucleotide.
Ribonucleotide(const Ribonucleotide &ribo)=default
Copy constructor.
String name_
full name
Definition: Ribonucleotide.h:181
EmpiricalFormula baseloss_formula_
sum formula after loss of the nucleobase
Definition: Ribonucleotide.h:190
Ribonucleotide(const String &name="unknown ribonucleotide", const String &code=".", const String &new_code="", const String &html_code=".", const EmpiricalFormula &formula=EmpiricalFormula(), char origin='.', double mono_mass=0.0, double avg_mass=0.0, enum TermSpecificityNuc term_spec=ANYWHERE, const EmpiricalFormula &baseloss_formula=default_baseloss_)
Constructor.
void setNewCode(const String &new_code)
Set the "new" (Modomics) code.
bool isAmbiguous() const
Return whether this is an "ambiguous" modification (representing isobaric modifications on the base/r...
double mono_mass_
monoisotopic mass
Definition: Ribonucleotide.h:187
bool isModified() const
Return true if this is a modified ribonucleotide and false otherwise.
void setCode(const String &code)
Set the short name.
void setMonoMass(double mono_mass)
Set the monoisotopic mass of the ribonucleotide.
TermSpecificityNuc
Definition: Ribonucleotide.h:57
@ FIVE_PRIME
Definition: Ribonucleotide.h:59
@ THREE_PRIME
Definition: Ribonucleotide.h:60
@ ANYWHERE
Definition: Ribonucleotide.h:58
void setName(const String &name)
Set the name of the ribonucleotide.
const EmpiricalFormula getFormula() const
Get formula for the ribonucleotide.
char origin_
character of unmodified version of ribonucleotide
Definition: Ribonucleotide.h:186
static const EmpiricalFormula default_baseloss_
Default value for sum formula after nucleobase loss.
Definition: Ribonucleotide.h:179
String html_code_
RNAMods code.
Definition: Ribonucleotide.h:184
void setTermSpecificity(enum TermSpecificityNuc term_spec)
Set the terminal specificity.
String getHTMLCode() const
Set the HTML (RNAMods) code.
char getOrigin() const
Get the code of the unmodified base (e.g., "A", "C", ...)
String code_
short name
Definition: Ribonucleotide.h:182
double getMonoMass() const
Get the monoisotopic mass of the ribonucleotide.
void setOrigin(char origin)
Set the code of the unmodified base (e.g., "A", "C", ...)
void setBaselossFormula(const EmpiricalFormula &formula)
Set the sum formula after loss of the nucleobase.
friend std::ostream & operator<<(std::ostream &os, const Ribonucleotide &ribo)
ostream iterator to write the residue to a stream
bool operator==(const Ribonucleotide &ribonucleotide) const
Equality operator.
EmpiricalFormula formula_
sum formula
Definition: Ribonucleotide.h:185
double getAvgMass() const
Set the average mass of the ribonucleotide.
const String getName() const
Get the name of the ribonucleotide.
void setFormula(const EmpiricalFormula &formula)
Set the empirical formula for the ribonucleotide.
const String getCode() const
Return the short name.
A more convenient string class.
Definition: String.h:60
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)