ProteoWizard
Unimod.hpp
Go to the documentation of this file.
1 //
2 // $Id: Unimod.hpp 9934 2016-08-02 17:48:03Z chambm $
3 //
4 //
5 // Original author: Matt Chambers <matt.chambers .@. vanderbilt.edu>
6 //
7 // Copyright 2011 Vanderbilt University - Nashville, TN 37232
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 //
21 
22 
23 #ifndef _UNIMOD_HPP_
24 #define _UNIMOD_HPP_
25 
26 
30 #include "cv.hpp"
31 #include <boost/enum.hpp>
32 #include <boost/logic/tribool.hpp>
33 
34 
35 namespace pwiz {
36 namespace data {
37 namespace unimod {
38 
39 using namespace cv;
40 using namespace chemistry;
41 using namespace boost::logic;
42 
44  (Any)(1<<0)
45  (NTerminus)(1<<1)
46  (CTerminus)(1<<2)
47  (Alanine)(1<<3)
48  (Cysteine)(1<<4)
49  (AsparticAcid)(1<<5)
50  (GlutamicAcid)(1<<6)
51  (Phenylalanine)(1<<7)
52  (Glycine)(1<<8)
53  (Histidine)(1<<9)
54  (Isoleucine)(1<<10)
55  (Lysine)(1<<11)
56  (Leucine)(1<<12)
57  (Methionine)(1<<13)
58  (Asparagine)(1<<14)
59  (Proline)(1<<15)
60  (Glutamine)(1<<16)
61  (Arginine)(1<<17)
62  (Serine)(1<<18)
63  (Threonine)(1<<19)
64  (Selenocysteine)(1<<20)
65  (Valine)(1<<21)
66  (Tryptophan)(1<<22)
67  (Tyrosine)(1<<23)
68 )
69 BOOST_BITFIELD_DOMAIN_OPERATORS(Site)
70 
71 BOOST_ENUM_EX(Position, PWIZ_API_DECL,
72  (Anywhere)
73  (AnyNTerminus)
74  (AnyCTerminus)
76  (ProteinCTerminus)
77 )
78 BOOST_ENUM_DOMAIN_OPERATORS(Position)
79 
80 BOOST_BITFIELD_EX(Classification, PWIZ_API_DECL,
81  (Any)(1<<0)
82  (Artifact)(1<<1)
83  (ChemicalDerivative)(1<<2)
84  (CoTranslational)(1<<3)
85  (IsotopicLabel)(1<<4)
86  (Multiple)(1<<5)
87  (NLinkedGlycosylation)(1<<6)
88  (NonStandardResidue)(1<<7)
89  (OLinkedGlycosylation)(1<<8)
90  (OtherGlycosylation)(1<<9)
91  (Other)(1<<10)
92  (PostTranslational)(1<<11)
93  (PreTranslational)(1<<12)
94  (Substitution)(1<<13)
95  (SynthPepProtectGP)(1<<14)
96 )
97 BOOST_BITFIELD_DOMAIN_OPERATORS(Classification)
98 
99 
100 /// a modification from Unimod
101 struct PWIZ_API_DECL Modification
102 {
103  struct PWIZ_API_DECL Specificity
104  {
105  Site site;
106  Position position;
107  bool hidden;
108  Classification classification;
109  };
110 
111  CVID cvid;
112  std::string name;
113  Formula deltaComposition;
114  double deltaMonoisotopicMass() const;
115  double deltaAverageMass() const;
116  bool approved;
117  std::vector<Specificity> specificities;
118 };
119 
120 
121 /// returns the Site given a one-letter residue code, or:
122 /// 'x' for Site::Any, 'n' for Site::NTerminus, 'c' for Site::CTerminus
123 PWIZ_API_DECL Site site(char symbol);
124 
125 
126 /// returns a Position corresponding to one of the following CVIDs:
127 /// CVID_Unknown: Position::Anywhere
128 /// MS_modification_specificity_peptide_N_term: Position::AnyNTerminus
129 /// MS_modification_specificity_peptide_C_term: Position::AnyCTerminus
130 /// Else: invalid_argument exception
131 PWIZ_API_DECL Position position(CVID cvid = CVID_Unknown);
132 
133 
134 /// the entire list of Unimod modifications
135 PWIZ_API_DECL const std::vector<Modification>& modifications();
136 
137 /// get a list of modifications by mass and tolerance;
138 /// - mass is treated as monoisotopic if monoisotopic=true; if indeterminate, both average and monoisotopic lookups are done
139 /// - if approved is not indeterminate, only approved/unapproved modifications are considered
140 /// - the site, position, and classification parameters filter the resulting modifications such that
141 /// every modification must have at least one specificity matching all three criteria;
142 /// - if hidden is not indeterminate, matching site/position/classification specificities must be hidden (or not)
143 PWIZ_API_DECL std::vector<Modification> modifications(double mass,
144  double tolerance,
145  tribool monoisotopic = true,
146  tribool approved = true,
147  Site site = Site::Any,
148  Position position = Position::Anywhere,
149  Classification classification = Classification::Any,
150  tribool hidden = indeterminate);
151 
152 /// find a modification by CVID
153 PWIZ_API_DECL const Modification& modification(CVID cvid);
154 
155 /// find a modification by title, e.g. "Phospho" not "Phosphorylation"
156 PWIZ_API_DECL const Modification& modification(const std::string& title);
157 
158 
159 } // namespace unimod
160 } // namespace data
161 } // namespace pwiz
162 
163 
164 #endif // _UNIMOD_HPP_
Phenylalanine
Definition: AminoAcid.hpp:45
PWIZ_API_DECL const Modification & modification(CVID cvid)
find a modification by CVID
PWIZ_API_DECL const CV & cv(const std::string &prefix)
returns a CV object for the specified namespace (prefix); currently supported namespaces are: MS UO ...
Isoleucine
Definition: AminoAcid.hpp:45
class to represent a chemical formula
Definition: Chemistry.hpp:133
Glutamine
Definition: AminoAcid.hpp:45
Selenocysteine
Definition: AminoAcid.hpp:45
Tryptophan
Definition: AminoAcid.hpp:45
AsparticAcid
Definition: AminoAcid.hpp:45
() Anywhere() AnyNTerminus() AnyCTerminus()() Any(1<< 0)(Artifact)(1<< 1)(ChemicalDerivative)(1<< 2)(CoTranslational)(1<< 3)(IsotopicLabel)(1<< 4)(Multiple)(1<< 5)(NLinkedGlycosylation)(1<< 6)(NonStandardResidue)(1<< 7)(OLinkedGlycosylation)(1<< 8)(OtherGlycosylation)(1<< 9)(Other)(1<< 10)(PostTranslational)(1<< 11)(PreTranslational)(1<< 12)(Substitution)(1<< 13)(SynthPepProtectGP)(1<< 14)) struct PWIZ_API_DECL Modification
a modification from Unimod
Definition: Unimod.hpp:81
Methionine
Definition: AminoAcid.hpp:45
represents a post-translational modification (PTM) modification formula or masses must be provided at...
PWIZ_API_DECL const std::vector< Modification > & modifications()
the entire list of Unimod modifications
Threonine
Definition: AminoAcid.hpp:45
Cysteine
Definition: AminoAcid.hpp:45
BOOST_BITFIELD_EX(Site, PWIZ_API_DECL,(Any)(1<< 0)(NTerminus)(1<< 1)(CTerminus)(1<< 2)(Alanine)(1<< 3)(Cysteine)(1<< 4)(AsparticAcid)(1<< 5)(GlutamicAcid)(1<< 6)(Phenylalanine)(1<< 7)(Glycine)(1<< 8)(Histidine)(1<< 9)(Isoleucine)(1<< 10)(Lysine)(1<< 11)(Leucine)(1<< 12)(Methionine)(1<< 13)(Asparagine)(1<< 14)(Proline)(1<< 15)(Glutamine)(1<< 16)(Arginine)(1<< 17)(Serine)(1<< 18)(Threonine)(1<< 19)(Selenocysteine)(1<< 20)(Valine)(1<< 21)(Tryptophan)(1<< 22)(Tyrosine)(1<< 23)) BOOST_ENUM_EX(Position
Proline
Definition: AminoAcid.hpp:45
Asparagine
Definition: AminoAcid.hpp:45
Tyrosine
Definition: AminoAcid.hpp:45
Arginine
Definition: AminoAcid.hpp:45
Histidine
Definition: AminoAcid.hpp:45
Lysine
Definition: AminoAcid.hpp:45
Valine
Definition: AminoAcid.hpp:45
PWIZ_API_DECL Position position(CVID cvid=CVID_Unknown)
returns a Position corresponding to one of the following CVIDs: CVID_Unknown: Position::Anywhere MS_m...
CVID_Unknown
Definition: cv.hpp:97
GlutamicAcid
Definition: AminoAcid.hpp:45
Leucine
Definition: AminoAcid.hpp:45
Alanine
Definition: AminoAcid.hpp:45
() Anywhere() AnyNTerminus() AnyCTerminus() ProteinNTerminus(ProteinCTerminus)) BOOST_BITFIELD_EX(Classification
PWIZ_API_DECL Site site(char symbol)
returns the Site given a one-letter residue code, or: &#39;x&#39; for Site::Any, &#39;n&#39; for Site::NTerminus, &#39;c&#39; for Site::CTerminus
Glycine
Definition: AminoAcid.hpp:45
Serine
Definition: AminoAcid.hpp:45