OpenMS  3.0.0
ResidueModification.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-2022.
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: Timo Sachsenberg $
32 // $Authors: Andreas Bertsch $
33 // --------------------------------------------------------------------------
34 //
35 
36 #pragma once
37 
40 
41 #include <set>
42 
43 namespace OpenMS
44 {
45  // forward declaration
46  class Residue;
47 
78  class OPENMS_DLLAPI ResidueModification
79  {
80 public:
81 
98  {
99  ANYWHERE = 0,
100  C_TERM = 1,
101  N_TERM = 2,
102  PROTEIN_C_TERM = 3,
103  PROTEIN_N_TERM = 4,
104  NUMBER_OF_TERM_SPECIFICITY
105  };
106 
110  {
111  ARTIFACT = 0,
127  NUMBER_OF_SOURCE_CLASSIFICATIONS
128  };
130 
134 
137 
139  ResidueModification(const ResidueModification&) = default;
140 
143 
145  virtual ~ResidueModification();
147 
151 
153  ResidueModification& operator=(const ResidueModification&) = default;
154 
156  ResidueModification& operator=(ResidueModification&&) & = default;
158 
162  void setId(const String& id);
164 
166  const String& getId() const;
167 
175  void setFullId(const String& full_id = "");
176 
178 
187  const String& getFullId() const;
188 
190  void setUniModRecordId(const Int& id);
191 
193  const Int& getUniModRecordId() const;
194 
196  const String getUniModAccession() const;
197 
199  void setPSIMODAccession(const String& id);
200 
202  const String& getPSIMODAccession() const;
203 
205  void setFullName(const String& full_name);
206 
208  const String& getFullName() const;
209 
211  void setName(const String& name);
212 
214  const String& getName() const;
215 
221  void setTermSpecificity(TermSpecificity term_spec);
222 
230  void setTermSpecificity(const String& name);
231 
233  TermSpecificity getTermSpecificity() const;
234 
241  String getTermSpecificityName(TermSpecificity term_spec = NUMBER_OF_TERM_SPECIFICITY) const;
242 
251  void setOrigin(char origin);
252 
254  char getOrigin() const;
255 
257  void setSourceClassification(const String& classification);
258 
260  void setSourceClassification(SourceClassification classification);
261 
263  SourceClassification getSourceClassification() const;
264 
266  String getSourceClassificationName(SourceClassification classification = NUMBER_OF_SOURCE_CLASSIFICATIONS) const;
267 
269  void setAverageMass(double mass);
270 
272  double getAverageMass() const;
273 
275  void setMonoMass(double mass);
276 
278  double getMonoMass() const;
279 
281  void setDiffAverageMass(double mass);
282 
284  double getDiffAverageMass() const;
285 
287  void setDiffMonoMass(double mass);
288 
290  double getDiffMonoMass() const;
291 
293  void setFormula(const String& composition);
294 
296  const String& getFormula() const;
297 
299  void setDiffFormula(const EmpiricalFormula& diff_formula);
300 
302  const EmpiricalFormula& getDiffFormula() const;
303 
305  void setSynonyms(const std::set<String>& synonyms);
306 
308  void addSynonym(const String& synonym);
309 
311  const std::set<String>& getSynonyms() const;
312 
314  void setNeutralLossDiffFormulas(const std::vector<EmpiricalFormula>& diff_formulas);
315 
317  const std::vector<EmpiricalFormula>& getNeutralLossDiffFormulas() const;
318 
320  void setNeutralLossMonoMasses(std::vector<double> mono_masses);
321 
323  std::vector<double> getNeutralLossMonoMasses() const;
324 
326  void setNeutralLossAverageMasses(std::vector<double> average_masses);
327 
329  std::vector<double> getNeutralLossAverageMasses() const;
331 
335  bool hasNeutralLoss() const;
337 
339  bool isUserDefined() const;
340 
342  bool operator==(const ResidueModification& modification) const;
343 
345  bool operator!=(const ResidueModification& modification) const;
346 
348  bool operator<(const ResidueModification& modification) const;
349 
351 
354 
361  static const ResidueModification* createUnknownFromMassString(const String& mod,
362  const double mass,
363  const bool delta_mass,
364  const TermSpecificity specificity,
365  const Residue* residue = nullptr);
366 
383  static const ResidueModification* combineMods(const ResidueModification* base,
384  const std::set<const ResidueModification*>& addons,
385  bool allow_unknown_masses = false,
386  const Residue* residue = nullptr);
387 
395  String toString() const;
396 
399  static String getDiffMonoMassString(const double diff_mono_mass);
400 
402  static String getDiffMonoMassWithBracket(const double diff_mono_mass);
403 
405  static String getMonoMassWithBracket(const double mono_mass);
406 
407 protected:
409 
411 
413 
414  // The UniMod record id (an integer)
416 
418 
420 
422 
423  char origin_;
424 
426 
428 
429  double mono_mass_;
430 
432 
434 
436 
438 
439  std::set<String> synonyms_;
440 
441  std::vector<EmpiricalFormula> neutral_loss_diff_formulas_;
442 
443  std::vector<double> neutral_loss_mono_masses_;
444 
445  std::vector<double> neutral_loss_average_masses_;
446  };
447 }
OpenMS::ResidueModification::classification_
SourceClassification classification_
Definition: ResidueModification.h:425
OpenMS::ResidueModification::full_id_
String full_id_
Definition: ResidueModification.h:410
OpenMS::toString
const std::string & toString(const DriftTimeUnit value)
OpenMS::ResidueModification::OTHER_GLYCOSYLATION
Other glycosylation (i.e. neither N nor O-linked)
Definition: ResidueModification.h:119
OpenMS::ResidueModification
Representation of a modification on an amino acid residue.
Definition: ResidueModification.h:78
OpenMS::ResidueModification::HYPOTHETICAL
A hypothetical modification.
Definition: ResidueModification.h:112
OpenMS::ResidueModification::ISOTOPIC_LABEL
A chemical label (artificial)
Definition: ResidueModification.h:117
OpenMS::String
A more convenient string class.
Definition: String.h:58
OpenMS::ResidueModification::full_name_
String full_name_
Definition: ResidueModification.h:417
KDTree::operator!=
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
OpenMS::ResidueModification::MULTIPLE
A combination of multiple modifications.
Definition: ResidueModification.h:115
OpenMS::ResidueModification::NATURAL
A natural modification.
Definition: ResidueModification.h:113
OpenMS::ResidueModification::NONSTANDARD_RESIDUE
A non-standard amino acid.
Definition: ResidueModification.h:123
OpenMS::ResidueModification::name_
String name_
Definition: ResidueModification.h:419
OpenMS::ResidueModification::UNKNOWN
An unknown modification.
Definition: ResidueModification.h:126
OpenMS::operator<
bool operator<(const MultiplexDeltaMasses &dm1, const MultiplexDeltaMasses &dm2)
OpenMS::ResidueModification::COTRANSLATIONAL
A co-translational modification.
Definition: ResidueModification.h:124
OpenMS::Int
int Int
Signed integer type.
Definition: Types.h:102
OpenMS::ResidueModification::PRETRANSLATIONAL
A pre-translational modification.
Definition: ResidueModification.h:118
OpenMS
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
OpenMS::ResidueModification::neutral_loss_mono_masses_
std::vector< double > neutral_loss_mono_masses_
Definition: ResidueModification.h:443
OpenMS::ResidueModification::origin_
char origin_
Definition: ResidueModification.h:423
OpenMS::ResidueModification::CHEMICAL_DERIVATIVE
A chemical derivative.
Definition: ResidueModification.h:116
OpenMS::Residue
Representation of an amino acid residue.
Definition: Residue.h:62
OpenMS::ResidueModification::TermSpecificity
TermSpecificity
Position where the modification is allowed to occur.
Definition: ResidueModification.h:97
OpenMS::ResidueModification::OTHER
Other modification.
Definition: ResidueModification.h:122
OpenMS::ResidueModification::AA_SUBSTITUTION
An amino acid substitution that presents like a modification.
Definition: ResidueModification.h:121
OpenMS::ResidueModification::SourceClassification
SourceClassification
Classification of the modification.
Definition: ResidueModification.h:109
OpenMS::ResidueModification::synonyms_
std::set< String > synonyms_
Definition: ResidueModification.h:439
OpenMS::ResidueModification::average_mass_
double average_mass_
Definition: ResidueModification.h:427
OpenMS::ResidueModification::neutral_loss_diff_formulas_
std::vector< EmpiricalFormula > neutral_loss_diff_formulas_
Definition: ResidueModification.h:441
OpenMS::ResidueModification::psi_mod_accession_
String psi_mod_accession_
Definition: ResidueModification.h:412
EmpiricalFormula.h
OpenMS::Internal::operator==
bool operator==(const IDBoostGraph::ProteinGroup &lhs, const IDBoostGraph::ProteinGroup &rhs)
OpenMS::ResidueModification::id_
String id_
Definition: ResidueModification.h:408
OpenMS::ResidueModification::NLINKED_GLYCOSYLATION
N-linked glycosylation.
Definition: ResidueModification.h:120
OpenMS::EmpiricalFormula
Representation of an empirical formula.
Definition: EmpiricalFormula.h:84
OpenMS::ResidueModification::formula_
String formula_
Definition: ResidueModification.h:435
OpenMS::ResidueModification::diff_mono_mass_
double diff_mono_mass_
Definition: ResidueModification.h:433
OpenMS::ResidueModification::mono_mass_
double mono_mass_
Definition: ResidueModification.h:429
String.h
OpenMS::ResidueModification::diff_average_mass_
double diff_average_mass_
Definition: ResidueModification.h:431
OpenMS::ResidueModification::OLINKED_GLYCOSYLATION
A O-linked glycosylation.
Definition: ResidueModification.h:125
OpenMS::ResidueModification::unimod_record_id_
Int unimod_record_id_
Definition: ResidueModification.h:415
OpenMS::ResidueModification::neutral_loss_average_masses_
std::vector< double > neutral_loss_average_masses_
Definition: ResidueModification.h:445
OpenMS::ResidueModification::diff_formula_
EmpiricalFormula diff_formula_
Definition: ResidueModification.h:437
OpenMS::ResidueModification::POSTTRANSLATIONAL
A post-translational modification.
Definition: ResidueModification.h:114
OpenMS::ResidueModification::term_spec_
TermSpecificity term_spec_
Definition: ResidueModification.h:421