Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Residue.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-2017.
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 #include <OpenMS/CONCEPT/Types.h>
42 
43 #include <iosfwd>
44 #include <set>
45 #include <vector>
46 
47 namespace OpenMS
48 {
61  class OPENMS_DLLAPI Residue
62  {
63  friend class ResidueDB;
64 
65 public:
66 
70 
71  // Formulae that need to be added to the internal residues to get to fragment type
72  // Formulae from http://www.matrixscience.com/help/fragmentation_help.html
73  inline static const EmpiricalFormula& getInternalToFull()
74  {
75  static const EmpiricalFormula to_full = EmpiricalFormula("H2O");
76  return to_full;
77  }
78 
79  inline static const EmpiricalFormula& getInternalToNTerm()
80  {
81  static const EmpiricalFormula to_full = EmpiricalFormula("H");
82  return to_full;
83  }
84 
85  inline static const EmpiricalFormula& getInternalToCTerm()
86  {
87  static const EmpiricalFormula to_full = EmpiricalFormula("OH");
88  return to_full;
89  }
90 
91  inline static const EmpiricalFormula& getInternalToAIon()
92  {
93  // Mind the "-"
94  static const EmpiricalFormula to_full =
95  getInternalToNTerm() - EmpiricalFormula("CHO");
96  return to_full;
97  }
98 
99  inline static const EmpiricalFormula& getInternalToBIon()
100  {
101  // Mind the "-"
102  static const EmpiricalFormula to_full =
103  getInternalToNTerm() - EmpiricalFormula("H");
104  return to_full;
105  }
106 
107  inline static const EmpiricalFormula& getInternalToCIon()
108  {
109  static const EmpiricalFormula to_full =
110  getInternalToNTerm() + EmpiricalFormula("NH2");
111  return to_full;
112  }
113 
114  inline static const EmpiricalFormula& getInternalToXIon()
115  {
116  // Mind the "-"
117  static const EmpiricalFormula to_full =
118  getInternalToCTerm() + EmpiricalFormula("CO") - EmpiricalFormula("H");
119  return to_full;
120  }
121 
122  inline static const EmpiricalFormula& getInternalToYIon()
123  {
124  static const EmpiricalFormula to_full =
125  getInternalToCTerm() + EmpiricalFormula("H");
126  return to_full;
127  }
128 
129  inline static const EmpiricalFormula& getInternalToZIon()
130  {
131  // Mind the "-"
132  static const EmpiricalFormula to_full =
133  getInternalToCTerm() - EmpiricalFormula("NH2");
134  return to_full;
135  }
136 
137 
139 
144  {
145  Full = 0, // with N-terminus and C-terminus
146  Internal, // internal, without any termini
147  NTerminal, // only N-terminus
148  CTerminal, // only C-terminus
149  AIon, // MS:1001229 N-terminus up to the C-alpha/carbonyl carbon bond
150  BIon, // MS:1001224 N-terminus up to the peptide bond
151  CIon, // MS:1001231 N-terminus up to the amide/C-alpha bond
152  XIon, // MS:1001228 amide/C-alpha bond up to the C-terminus
153  YIon, // MS:1001220 peptide bond up to the C-terminus
154  ZIon, // MS:1001230 C-alpha/carbonyl carbon bond
155  Precursor, // MS:1001523 Precursor ion
156  BIonMinusH20, // MS:1001222 b ion without water
157  YIonMinusH20, // MS:1001223 y ion without water
158  BIonMinusNH3, // MS:1001232 b ion without ammonia
159  YIonMinusNH3, // MS:1001233 y ion without ammonia
160  NonIdentified, // MS:1001240 Non-identified ion
161  Unannotated, // no stored annotation
162  SizeOfResidueType
163  };
165 
167  static String getResidueTypeName(const ResidueType res_type);
168 
169 
173  Residue();
175 
177  Residue(const Residue& residue);
178 
180  Residue(const String& name,
181  const String& three_letter_code,
182  const String& one_letter_code,
183  const EmpiricalFormula& formula);
184 
186  virtual ~Residue();
188 
192  Residue& operator=(const Residue& residue);
195 
199  void setName(const String& name);
201 
203  const String& getName() const;
204 
206  void setShortName(const String& short_name);
207 
209  const String& getShortName() const;
210 
212  void setSynonyms(const std::set<String>& synonyms);
213 
215  void addSynonym(const String& synonym);
216 
218  const std::set<String>& getSynonyms() const;
219 
221  void setThreeLetterCode(const String& three_letter_code);
222 
224  const String& getThreeLetterCode() const;
225 
227  void setOneLetterCode(const String& one_letter_code);
228 
230  const String& getOneLetterCode() const;
231 
233  void addLossFormula(const EmpiricalFormula&);
234 
236  void setLossFormulas(const std::vector<EmpiricalFormula>&);
237 
239  void addNTermLossFormula(const EmpiricalFormula&);
240 
242  void setNTermLossFormulas(const std::vector<EmpiricalFormula>&);
243 
245  const std::vector<EmpiricalFormula>& getLossFormulas() const;
246 
248  const std::vector<EmpiricalFormula>& getNTermLossFormulas() const;
249 
251  void setLossNames(const std::vector<String>& name);
252 
254  void setNTermLossNames(const std::vector<String>& name);
255 
257  void addLossName(const String& name);
258 
260  void addNTermLossName(const String& name);
261 
263  const std::vector<String>& getLossNames() const;
264 
266  const std::vector<String>& getNTermLossNames() const;
267 
269  void setFormula(const EmpiricalFormula& formula);
270 
272  EmpiricalFormula getFormula(ResidueType res_type = Full) const;
273 
275  void setAverageWeight(double weight);
276 
278  double getAverageWeight(ResidueType res_type = Full) const;
279 
281  void setMonoWeight(double weight);
282 
284  double getMonoWeight(ResidueType res_type = Full) const;
285 
287  const ResidueModification* getModification() const;
288 
290  void setModification(const String& name);
291 
293  const String& getModificationName() const;
294 
296  void setLowMassIons(const std::vector<EmpiricalFormula>& low_mass_ions);
297 
299  const std::vector<EmpiricalFormula>& getLowMassIons() const;
300 
302  void setResidueSets(const std::set<String>& residues_sets);
303 
305  void addResidueSet(const String& residue_sets);
306 
308  const std::set<String>& getResidueSets() const;
310 
314  bool hasNeutralLoss() const;
316 
318  bool hasNTermNeutralLosses() const;
319 
321  bool operator==(const Residue& residue) const;
322 
324  bool operator!=(const Residue& residue) const;
325 
327  bool operator==(char one_letter_code) const;
328 
330  bool operator!=(char one_letter_code) const;
331 
333  double getPka() const;
334 
336  double getPkb() const;
337 
339  double getPkc() const;
340 
342  double getPiValue() const;
343 
345  void setPka(double value);
346 
348  void setPkb(double value);
349 
351  void setPkc(double value);
352 
354  double getSideChainBasicity() const;
355 
357  void setSideChainBasicity(double gb_sc);
358 
360  double getBackboneBasicityLeft() const;
361 
363  void setBackboneBasicityLeft(double gb_bb_l);
364 
366  double getBackboneBasicityRight() const;
367 
369  void setBackboneBasicityRight(double gb_bb_r);
370 
372  bool isModified() const;
373 
375  bool isInResidueSet(const String& residue_set);
377 
379  friend OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const Residue& residue);
380 
381 protected:
382 
383  // basic
385 
387 
388  std::set<String> synonyms_;
389 
391 
393 
395 
397 
399 
400  double mono_weight_;
401 
402  // modification
404 
405  // loss
406  std::vector<String> loss_names_;
407 
408  std::vector<EmpiricalFormula> loss_formulas_;
409 
410  std::vector<String> NTerm_loss_names_;
411 
412  std::vector<EmpiricalFormula> NTerm_loss_formulas_;
413 
415 
417 
418  // low mass markers like immonium ions
419  std::vector<EmpiricalFormula> low_mass_ions_;
420 
421  // pka values
422  double pka_;
423 
424  // pkb values
425  double pkb_;
426 
427  // pkc values
428  double pkc_;
429 
430  double gb_sc_;
431 
432  double gb_bb_l_;
433 
434  double gb_bb_r_;
435 
436  // residue sets this amino acid is contained in
437  std::set<String> residue_sets_;
438 
440  void setModification_(const ResidueModification& mod);
441 
442  };
443 
444  OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const Residue& residue);
445 
446 }
447 
Definition: Residue.h:149
Definition: Residue.h:153
std::vector< String > loss_names_
Definition: Residue.h:406
A more convenient string class.
Definition: String.h:57
std::vector< String > NTerm_loss_names_
Definition: Residue.h:410
double pkc_
Definition: Residue.h:428
static const EmpiricalFormula & getInternalToNTerm()
Definition: Residue.h:79
Definition: Residue.h:146
Definition: Residue.h:147
double gb_bb_r_
Definition: Residue.h:434
static const EmpiricalFormula & getInternalToFull()
Definition: Residue.h:73
Representation of a modification.
Definition: ResidueModification.h:76
Definition: Residue.h:148
static const EmpiricalFormula & getInternalToAIon()
Definition: Residue.h:91
static const EmpiricalFormula & getInternalToBIon()
Definition: Residue.h:99
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
double pka_
Definition: Residue.h:422
static const EmpiricalFormula & getInternalToXIon()
Definition: Residue.h:114
double gb_sc_
Definition: Residue.h:430
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
Definition: Residue.h:157
Representation of a residue.
Definition: Residue.h:61
std::vector< EmpiricalFormula > loss_formulas_
Definition: Residue.h:408
double gb_bb_l_
Definition: Residue.h:432
double loss_mono_weight_
Definition: Residue.h:416
std::vector< EmpiricalFormula > low_mass_ions_
Definition: Residue.h:419
static const EmpiricalFormula & getInternalToCTerm()
Definition: Residue.h:85
Representation of an empirical formula.
Definition: EmpiricalFormula.h:79
static const EmpiricalFormula & getInternalToYIon()
Definition: Residue.h:122
Definition: Residue.h:154
void setModification(int location, int max_size, String modification, OpenMS::AASequence &aas)
helper function that sets a modification on a AASequence object
const ResidueModification * modification_
Definition: Residue.h:403
static const EmpiricalFormula & getInternalToZIon()
Definition: Residue.h:129
Definition: Residue.h:158
Definition: Residue.h:159
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
double average_weight_
Definition: Residue.h:398
String short_name_
Definition: Residue.h:386
Definition: Residue.h:152
Definition: Residue.h:161
EmpiricalFormula internal_formula_
Definition: Residue.h:396
double mono_weight_
Definition: Residue.h:400
Definition: Residue.h:155
String name_
Definition: Residue.h:384
String three_letter_code_
Definition: Residue.h:390
Definition: Residue.h:156
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
residue data base which holds residues
Definition: ResidueDB.h:60
ResidueType
Definition: Residue.h:143
Definition: Residue.h:160
double pkb_
Definition: Residue.h:425
Definition: Residue.h:150
std::set< String > synonyms_
Definition: Residue.h:388
EmpiricalFormula formula_
Definition: Residue.h:394
double loss_average_weight_
Definition: Residue.h:414
std::set< String > residue_sets_
Definition: Residue.h:437
std::vector< EmpiricalFormula > NTerm_loss_formulas_
Definition: Residue.h:412
String one_letter_code_
Definition: Residue.h:392
Definition: Residue.h:151
static const EmpiricalFormula & getInternalToCIon()
Definition: Residue.h:107

OpenMS / TOPP release 2.3.0 Documentation generated on Wed Apr 18 2018 19:29:07 using doxygen 1.8.14