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 #ifndef OPENMS_CHEMISTRY_RESIDUE_H
37 #define OPENMS_CHEMISTRY_RESIDUE_H
38 
41 #include <OpenMS/CONCEPT/Types.h>
43 
44 #include <iosfwd>
45 #include <set>
46 #include <vector>
47 
48 namespace OpenMS
49 {
62  class OPENMS_DLLAPI Residue
63  {
64  friend class ResidueDB;
65 
66 public:
67 
71 
72  // Formulae that need to be added to the internal residues to get to fragment type
73  // Formulae from http://www.matrixscience.com/help/fragmentation_help.html
74  inline static const EmpiricalFormula& getInternalToFull()
75  {
76  static const EmpiricalFormula to_full = EmpiricalFormula("H2O");
77  return to_full;
78  }
79 
80  inline static const EmpiricalFormula& getInternalToNTerm()
81  {
82  static const EmpiricalFormula to_full = EmpiricalFormula("H");
83  return to_full;
84  }
85 
86  inline static const EmpiricalFormula& getInternalToCTerm()
87  {
88  static const EmpiricalFormula to_full = EmpiricalFormula("OH");
89  return to_full;
90  }
91 
92  inline static const EmpiricalFormula& getInternalToAIon()
93  {
94  // Mind the "-"
95  static const EmpiricalFormula to_full =
96  getInternalToNTerm() - EmpiricalFormula("CHO");
97  return to_full;
98  }
99 
100  inline static const EmpiricalFormula& getInternalToBIon()
101  {
102  // Mind the "-"
103  static const EmpiricalFormula to_full =
104  getInternalToNTerm() - EmpiricalFormula("H");
105  return to_full;
106  }
107 
108  inline static const EmpiricalFormula& getInternalToCIon()
109  {
110  static const EmpiricalFormula to_full =
111  getInternalToNTerm() + EmpiricalFormula("NH2");
112  return to_full;
113  }
114 
115  inline static const EmpiricalFormula& getInternalToXIon()
116  {
117  // Mind the "-"
118  static const EmpiricalFormula to_full =
119  getInternalToCTerm() + EmpiricalFormula("CO") - EmpiricalFormula("H");
120  return to_full;
121  }
122 
123  inline static const EmpiricalFormula& getInternalToYIon()
124  {
125  static const EmpiricalFormula to_full =
126  getInternalToCTerm() + EmpiricalFormula("H");
127  return to_full;
128  }
129 
130  inline static const EmpiricalFormula& getInternalToZIon()
131  {
132  // Mind the "-"
133  static const EmpiricalFormula to_full =
134  getInternalToCTerm() - EmpiricalFormula("NH2");
135  return to_full;
136  }
137 
138 
140 
145  {
146  Full = 0, // with N-terminus and C-terminus
147  Internal, // internal, without any termini
148  NTerminal, // only N-terminus
149  CTerminal, // only C-terminus
150  AIon, // MS:1001229 N-terminus up to the C-alpha/carbonyl carbon bond
151  BIon, // MS:1001224 N-terminus up to the peptide bond
152  CIon, // MS:1001231 N-terminus up to the amide/C-alpha bond
153  XIon, // MS:1001228 amide/C-alpha bond up to the C-terminus
154  YIon, // MS:1001220 peptide bond up to the C-terminus
155  ZIon, // MS:1001230 C-alpha/carbonyl carbon bond
156  Precursor, // MS:1001523 Precursor ion
157  BIonMinusH20, // MS:1001222 b ion without water
158  YIonMinusH20, // MS:1001223 y ion without water
159  BIonMinusNH3, // MS:1001232 b ion without ammonia
160  YIonMinusNH3, // MS:1001233 y ion without ammonia
161  NonIdentified, // MS:1001240 Non-identified ion
162  Unannotated, // no stored annotation
163  SizeOfResidueType
164  };
166 
168  static String getResidueTypeName(const ResidueType res_type);
169 
170 
174  Residue();
176 
178  Residue(const Residue& residue);
179 
181  Residue(const String& name,
182  const String& three_letter_code,
183  const String& one_letter_code,
184  const EmpiricalFormula& formula);
185 
187  virtual ~Residue();
189 
193  Residue& operator=(const Residue& residue);
196 
200  void setName(const String& name);
202 
204  const String& getName() const;
205 
207  void setShortName(const String& short_name);
208 
210  const String& getShortName() const;
211 
213  void setSynonyms(const std::set<String>& synonyms);
214 
216  void addSynonym(const String& synonym);
217 
219  const std::set<String>& getSynonyms() const;
220 
222  void setThreeLetterCode(const String& three_letter_code);
223 
225  const String& getThreeLetterCode() const;
226 
228  void setOneLetterCode(const String& one_letter_code);
229 
231  const String& getOneLetterCode() const;
232 
234  void addLossFormula(const EmpiricalFormula&);
235 
237  void setLossFormulas(const std::vector<EmpiricalFormula>&);
238 
240  void addNTermLossFormula(const EmpiricalFormula&);
241 
243  void setNTermLossFormulas(const std::vector<EmpiricalFormula>&);
244 
246  const std::vector<EmpiricalFormula>& getLossFormulas() const;
247 
249  const std::vector<EmpiricalFormula>& getNTermLossFormulas() const;
250 
252  void setLossNames(const std::vector<String>& name);
253 
255  void setNTermLossNames(const std::vector<String>& name);
256 
258  void addLossName(const String& name);
259 
261  void addNTermLossName(const String& name);
262 
264  const std::vector<String>& getLossNames() const;
265 
267  const std::vector<String>& getNTermLossNames() const;
268 
270  void setFormula(const EmpiricalFormula& formula);
271 
273  EmpiricalFormula getFormula(ResidueType res_type = Full) const;
274 
276  void setAverageWeight(double weight);
277 
279  double getAverageWeight(ResidueType res_type = Full) const;
280 
282  void setMonoWeight(double weight);
283 
285  double getMonoWeight(ResidueType res_type = Full) const;
286 
288  const ResidueModification* getModification() const;
289 
291  void setModification(const String& name);
292 
294  const String& getModificationName() const;
295 
297  void setLowMassIons(const std::vector<EmpiricalFormula>& low_mass_ions);
298 
300  const std::vector<EmpiricalFormula>& getLowMassIons() const;
301 
303  void setResidueSets(const std::set<String>& residues_sets);
304 
306  void addResidueSet(const String& residue_sets);
307 
309  const std::set<String>& getResidueSets() const;
311 
315  bool hasNeutralLoss() const;
317 
319  bool hasNTermNeutralLosses() const;
320 
322  bool operator==(const Residue& residue) const;
323 
325  bool operator!=(const Residue& residue) const;
326 
328  bool operator==(char one_letter_code) const;
329 
331  bool operator!=(char one_letter_code) const;
332 
334  double getPka() const;
335 
337  double getPkb() const;
338 
340  double getPkc() const;
341 
343  double getPiValue() const;
344 
346  void setPka(double value);
347 
349  void setPkb(double value);
350 
352  void setPkc(double value);
353 
355  double getSideChainBasicity() const;
356 
358  void setSideChainBasicity(double gb_sc);
359 
361  double getBackboneBasicityLeft() const;
362 
364  void setBackboneBasicityLeft(double gb_bb_l);
365 
367  double getBackboneBasicityRight() const;
368 
370  void setBackboneBasicityRight(double gb_bb_r);
371 
373  bool isModified() const;
374 
376  bool isInResidueSet(const String& residue_set);
378 
380  friend OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const Residue& residue);
381 
382 protected:
383 
384  // basic
386 
388 
389  std::set<String> synonyms_;
390 
392 
394 
396 
398 
400 
401  double mono_weight_;
402 
403  // modification
405 
406  // loss
407  std::vector<String> loss_names_;
408 
409  std::vector<EmpiricalFormula> loss_formulas_;
410 
411  std::vector<String> NTerm_loss_names_;
412 
413  std::vector<EmpiricalFormula> NTerm_loss_formulas_;
414 
416 
418 
419  // low mass markers like immonium ions
420  std::vector<EmpiricalFormula> low_mass_ions_;
421 
422  // pka values
423  double pka_;
424 
425  // pkb values
426  double pkb_;
427 
428  // pkc values
429  double pkc_;
430 
431  double gb_sc_;
432 
433  double gb_bb_l_;
434 
435  double gb_bb_r_;
436 
437  // residue sets this amino acid is contained in
438  std::set<String> residue_sets_;
439 
441  void setModification_(const ResidueModification& mod);
442 
443  };
444 
445  OPENMS_DLLAPI std::ostream& operator<<(std::ostream& os, const Residue& residue);
446 
447 }
448 
449 #endif
Definition: Residue.h:150
Definition: Residue.h:154
std::vector< String > loss_names_
Definition: Residue.h:407
A more convenient string class.
Definition: String.h:57
std::vector< String > NTerm_loss_names_
Definition: Residue.h:411
double pkc_
Definition: Residue.h:429
static const EmpiricalFormula & getInternalToNTerm()
Definition: Residue.h:80
Definition: Residue.h:147
Definition: Residue.h:148
double gb_bb_r_
Definition: Residue.h:435
static const EmpiricalFormula & getInternalToFull()
Definition: Residue.h:74
Representation of a modification.
Definition: ResidueModification.h:77
Definition: Residue.h:149
static const EmpiricalFormula & getInternalToAIon()
Definition: Residue.h:92
static const EmpiricalFormula & getInternalToBIon()
Definition: Residue.h:100
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
double pka_
Definition: Residue.h:423
static const EmpiricalFormula & getInternalToXIon()
Definition: Residue.h:115
double gb_sc_
Definition: Residue.h:431
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
Definition: Residue.h:158
Representation of a residue.
Definition: Residue.h:62
std::vector< EmpiricalFormula > loss_formulas_
Definition: Residue.h:409
double gb_bb_l_
Definition: Residue.h:433
double loss_mono_weight_
Definition: Residue.h:417
std::vector< EmpiricalFormula > low_mass_ions_
Definition: Residue.h:420
static const EmpiricalFormula & getInternalToCTerm()
Definition: Residue.h:86
Representation of an empirical formula.
Definition: EmpiricalFormula.h:80
static const EmpiricalFormula & getInternalToYIon()
Definition: Residue.h:123
Definition: Residue.h:155
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:404
static const EmpiricalFormula & getInternalToZIon()
Definition: Residue.h:130
Definition: Residue.h:159
Definition: Residue.h:160
std::ostream & operator<<(std::ostream &os, const AccurateMassSearchResult &amsr)
double average_weight_
Definition: Residue.h:399
String short_name_
Definition: Residue.h:387
Definition: Residue.h:153
Definition: Residue.h:162
EmpiricalFormula internal_formula_
Definition: Residue.h:397
double mono_weight_
Definition: Residue.h:401
Definition: Residue.h:156
String name_
Definition: Residue.h:385
String three_letter_code_
Definition: Residue.h:391
Definition: Residue.h:157
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:61
ResidueType
Definition: Residue.h:144
Definition: Residue.h:161
double pkb_
Definition: Residue.h:426
Definition: Residue.h:151
std::set< String > synonyms_
Definition: Residue.h:389
EmpiricalFormula formula_
Definition: Residue.h:395
double loss_average_weight_
Definition: Residue.h:415
std::set< String > residue_sets_
Definition: Residue.h:438
std::vector< EmpiricalFormula > NTerm_loss_formulas_
Definition: Residue.h:413
String one_letter_code_
Definition: Residue.h:393
Definition: Residue.h:152
static const EmpiricalFormula & getInternalToCIon()
Definition: Residue.h:108

OpenMS / TOPP release 2.3.0 Documentation generated on Tue Jan 9 2018 18:22:03 using doxygen 1.8.13