ProteoWizard
Main Page
Namespaces
Classes
Files
File List
File Members
pwiz
data
proteome
Peptide.hpp
Go to the documentation of this file.
1
//
2
// $Id: Peptide.hpp 2453 2011-01-07 21:29:27Z chambm $
3
//
4
//
5
// Original author: Darren Kessner <darren@proteowizard.org>
6
//
7
// Copyright 2006 Louis Warschaw Prostate Cancer Center
8
// Cedars Sinai Medical Center, Los Angeles, California 90048
9
//
10
// Licensed under the Apache License, Version 2.0 (the "License");
11
// you may not use this file except in compliance with the License.
12
// You may obtain a copy of the License at
13
//
14
// http://www.apache.org/licenses/LICENSE-2.0
15
//
16
// Unless required by applicable law or agreed to in writing, software
17
// distributed under the License is distributed on an "AS IS" BASIS,
18
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
// See the License for the specific language governing permissions and
20
// limitations under the License.
21
//
22
23
24
#ifndef _PEPTIDE_HPP_
25
#define _PEPTIDE_HPP_
26
27
28
#include "
pwiz/utility/misc/Export.hpp
"
29
#include "
pwiz/utility/chemistry/Chemistry.hpp
"
30
#include <boost/shared_ptr.hpp>
31
32
33
namespace
pwiz {
34
namespace
proteome {
35
36
class
ModificationMap;
37
class
Fragmentation;
38
39
/// settings to enable parsing of inline modifications in peptide sequences
40
enum
PWIZ_API_DECL
ModificationParsing
41
{
42
ModificationParsing_Off
,
/// any non-AA characters will cause an exception
43
ModificationParsing_ByFormula
,
/// oxidized P in peptide: PEP(O)TIDE
44
ModificationParsing_ByMass
,
/// PEP(15.94)TIDE or PEP(15.94,15.99)TIDE
45
ModificationParsing_Auto
/// either by formula or by mass
46
};
47
48
/// the delimiter expected to signify an inline modification
49
enum
PWIZ_API_DECL
ModificationDelimiter
50
{
51
ModificationDelimiter_Parentheses
,
/// '(' and ')'
52
ModificationDelimiter_Brackets
,
/// '[' and ']'
53
ModificationDelimiter_Braces
/// '{' and '}'
54
};
55
56
#define MODIFICATION_PARSING_ARGUMENTS \
57
ModificationParsing mp = ModificationParsing_Off, \
58
ModificationDelimiter md = ModificationDelimiter_Parentheses
59
60
/// represents a peptide or polypeptide (a sequence of amino acids)
61
class
PWIZ_API_DECL
Peptide
62
{
63
public
:
64
65
Peptide
(
const
std::string& sequence =
""
,
MODIFICATION_PARSING_ARGUMENTS
);
66
Peptide
(
const
char
* sequence,
MODIFICATION_PARSING_ARGUMENTS
);
67
Peptide
(std::string::const_iterator begin, std::string::const_iterator end,
MODIFICATION_PARSING_ARGUMENTS
);
68
Peptide
(
const
char
* begin,
const
char
* end,
MODIFICATION_PARSING_ARGUMENTS
);
69
Peptide
(
const
Peptide
&);
70
Peptide
& operator=(
const
Peptide
&);
71
virtual
~
Peptide
();
72
73
/// returns the sequence of amino acids making up the peptide
74
const
std::string& sequence()
const
;
75
76
/// if modified = false: returns the composition formula of sequence()+water
77
/// if modified = true: returns the composition formula of sequence()+modifications()+water
78
/// throws an exception if modified = true and any modification has only mass information
79
chemistry::Formula
formula(
bool
modified =
false
)
const
;
80
81
/// if charge = 0: returns neutral mass
82
/// if charge > 0: returns charged m/z
83
/// if modified = false: returns the monoisotopic mass of sequence()+water
84
/// if modified = true: returns the monoisotopic mass of sequence()+modifications()+water
85
double
monoisotopicMass(
int
charge = 0,
bool
modified =
true
)
const
;
86
87
/// if charge = 0: returns neutral mass
88
/// if charge > 0: returns charged m/z
89
/// if modified = false: returns the molecular weight of sequence()+water
90
/// if modified = true: returns the molecular weight of sequence()+modifications()+water
91
double
molecularWeight(
int
charge = 0,
bool
modified =
true
)
const
;
92
93
/// the map of sequence offsets (0-based) to modifications;
94
/// modifications can be added or removed from the peptide with this map
95
ModificationMap
&
modifications
();
96
97
/// the map of sequence offsets (0-based) to modifications
98
const
ModificationMap
&
modifications
()
const
;
99
100
/// returns a fragmentation model for the peptide;
101
/// fragment masses can calculated as mono/avg and as modified/unmodified
102
Fragmentation
fragmentation(
bool
monoisotopic =
true
,
bool
modified =
true
)
const
;
103
104
/// returns true iff peptide sequences and modifications are equal
105
bool
operator==
(
const
Peptide
& rhs)
const
;
106
107
/// returns true iff this peptide has a lesser sequence length, sequence,
108
/// modifications length, or modifications
109
bool
operator<(
const
Peptide
& rhs)
const
;
110
111
private
:
112
friend
class
ModificationMap
;
// allow ModificationMap to befriend Peptide::Impl
113
friend
class
Fragmentation
;
114
class
Impl;
115
boost::shared_ptr<Impl>
impl_
;
116
};
117
118
119
/// provides fragment ion masses for a peptide
120
class
PWIZ_API_DECL
Fragmentation
121
{
122
public
:
123
124
Fragmentation
(
const
Peptide
&
peptide
,
125
bool
monoisotopic,
126
bool
modified);
127
Fragmentation
(
const
Fragmentation
&);
128
~
Fragmentation
();
129
130
/// returns the a ion of length <length>;
131
/// example: a(1) returns the a1 ion
132
/// if <charge> = 0: returns neutral mass
133
/// if <charge> > 0: returns charged m/z
134
double
a(
size_t
length,
size_t
charge = 0)
const
;
135
136
/// returns the b ion of length <length>
137
/// example: b(1) returns the b1 ion
138
/// if <charge> = 0: returns neutral mass
139
/// if <charge> > 0: returns charged m/z
140
double
b(
size_t
length,
size_t
charge = 0)
const
;
141
142
/// returns the c ion of length <length>
143
/// example: c(1) returns the c1 ion
144
/// if <charge> = 0: returns neutral mass
145
/// if <charge> > 0: returns charged m/z
146
double
c(
size_t
length,
size_t
charge = 0)
const
;
147
148
/// returns the x ion of length <length>
149
/// example: x(1) returns the x1 ion
150
/// if <charge> = 0: returns neutral mass
151
/// if <charge> > 0: returns charged m/z
152
double
x
(
size_t
length,
size_t
charge = 0)
const
;
153
154
/// returns the y ion of length <length>
155
/// example: y(1) returns the y1 ion
156
/// if <charge> = 0: returns neutral mass
157
/// if <charge> > 0: returns charged m/z
158
double
y
(
size_t
length,
size_t
charge = 0)
const
;
159
160
/// returns the z ion of length <length>
161
/// example: z(1) returns the z1 ion
162
/// if <charge> = 0: returns neutral mass
163
/// if <charge> > 0: returns charged m/z
164
double
z(
size_t
length,
size_t
charge = 0)
const
;
165
166
/// returns the z radical ion of length <length>
167
/// example: zRadical(1) returns the z1* ion
168
/// if <charge> = 0: returns neutral mass
169
/// if <charge> > 0: returns charged m/z
170
double
zRadical(
size_t
length,
size_t
charge = 0)
const
;
171
172
private
:
173
class
Impl;
174
boost::shared_ptr<Impl>
impl_
;
175
};
176
177
178
}
// namespace proteome
179
}
// namespace pwiz
180
181
182
// include here for user convenience
183
#include "
Modification.hpp
"
184
185
186
#endif // _PEPTIDE_HPP_
187
Generated on Mon Nov 26 2012 18:05:49 for ProteoWizard by
1.8.1.1