OpenMS
Ribonucleotide.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: Hendrik Weisser $
6 // $Authors: Hendrik Weisser $
7 // --------------------------------------------------------------------------
8 
9 #pragma once
10 
13 #include <iosfwd>
14 
15 namespace OpenMS
16 {
25  class OPENMS_DLLAPI Ribonucleotide
26  {
27  friend class RibonucleotideDB;
28  public:
29 
31  {
35  NUMBER_OF_TERM_SPECIFICITY
36  };
37 
42  Ribonucleotide(const String& name = "unknown ribonucleotide",
43  const String& code = ".",
44  const String& new_code = "",
45  const String& html_code = ".",
46  const EmpiricalFormula& formula = EmpiricalFormula(),
47  char origin = '.',
48  double mono_mass = 0.0,
49  double avg_mass = 0.0,
50  enum TermSpecificityNuc term_spec = ANYWHERE,
51  const EmpiricalFormula& baseloss_formula =
52  default_baseloss_);
53 
55  Ribonucleotide(const Ribonucleotide& ribo) = default;
56 
58  virtual ~Ribonucleotide();
60 
65  Ribonucleotide& operator=(const Ribonucleotide& ribo) = default;
67 
68 
73  bool operator==(const Ribonucleotide& ribonucleotide) const;
75 
79 
81  const String getCode() const;
82 
84  void setCode(const String& code);
85 
87  const String getName() const;
88 
90  void setName(const String& name);
91 
94 
96  void setFormula(const EmpiricalFormula& formula);
97 
99  double getMonoMass() const;
100 
102  void setMonoMass(double mono_mass);
103 
105  double getAvgMass() const;
106 
108  void setAvgMass(double avg_mass);
109 
111  const String getNewCode() const;
112 
114  void setNewCode(const String &new_code);
115 
117  friend OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const Ribonucleotide& ribo);
118 
120  char getOrigin() const;
121 
123  void setOrigin(char origin);
124 
127 
129  void setHTMLCode(const String& html_code);
130 
132  enum TermSpecificityNuc getTermSpecificity() const;
133 
136 
139 
141  void setBaselossFormula(const EmpiricalFormula& formula);
142 
144 
146  bool isModified() const;
147 
149  bool isAmbiguous() const;
150 
151  protected:
154 
160  char origin_;
161  double mono_mass_;
162  double avg_mass_;
163  enum TermSpecificityNuc term_spec_;
165  };
166 
168  OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const Ribonucleotide& ribo);
169 
172 
173 }
Representation of an empirical formula.
Definition: EmpiricalFormula.h:59
Database of ribonucleotides (modified and unmodified)
Definition: RibonucleotideDB.h:26
Representation of a ribonucleotide (modified or unmodified)
Definition: Ribonucleotide.h:26
const EmpiricalFormula getBaselossFormula() const
Get sum formula after loss of the nucleobase.
double avg_mass_
average mass
Definition: Ribonucleotide.h:162
const String getNewCode() const
Get the "new" (Modomics) code.
virtual ~Ribonucleotide()
Destructor.
String new_code_
Modomics code.
Definition: Ribonucleotide.h:157
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:155
EmpiricalFormula baseloss_formula_
sum formula after loss of the nucleobase
Definition: Ribonucleotide.h:164
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:161
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:31
@ FIVE_PRIME
Definition: Ribonucleotide.h:33
@ THREE_PRIME
Definition: Ribonucleotide.h:34
@ ANYWHERE
Definition: Ribonucleotide.h:32
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:160
static const EmpiricalFormula default_baseloss_
Default value for sum formula after nucleobase loss.
Definition: Ribonucleotide.h:153
String html_code_
RNAMods code.
Definition: Ribonucleotide.h:158
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:156
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:159
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:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)