Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_fragment.hpp
1/*
2##############################################################################
3# File: ms_fragment.hpp #
4# Mascot Parser toolkit #
5# Encapsulates a single fragment ion #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2012 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11# $Source: parser/inc/ms_fragment.hpp $
12# $Author: villek@matrixscience.com $
13# $Date: 2019-10-25 16:58:28 +0100 $
14# $Revision: 729a9d2d2b60ca4ca4ccf3b95c449b13288dba7d | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $
15##############################################################################
16*/
17
18
19#if !defined(ms_fragment_INCLUDED_)
20#define ms_fragment_INCLUDED_
21
22
23// Includes from the standard template library
24#include <string>
25#include <set>
26#include <vector>
27#include <map>
28
29
30namespace matrix_science {
37 class MS_MASCOTRESFILE_API ms_fragment
38 {
39 public:
41
68 LABEL_FORMAT_TRADITIONAL = 0,
69 LABEL_FORMAT_PEPTIDE_VIEW = 1
70 };
71
74
76 ms_fragment(const ms_fragment &src);
77
78#ifndef SWIG
80 ms_fragment& operator=(const ms_fragment& right);
81#endif
83 void copyFrom(const ms_fragment* src);
84
86 ms_fragment(const int seriesID,
87 const double massValue,
88 const double nlValue,
89 const int col,
90 const int chargeState = 1,
91 const double matchedExptMass = 0,
92 const double matchedExptIntensity = 0);
93
95 ms_fragment(const ms_peptide::PSM psmComponent,
96 const int seriesID,
97 const double massValue,
98 const double nlValue,
99 const int col,
100 const int chargeState,
101 const double matchedExptMass = 0,
102 const double matchedExptIntensity = 0);
103
105 ms_fragment(const char * seriesName,
106 const double massValue,
107 const double nlValue,
108 const int col,
109 const int chargeState = 1,
110 const double matchedExptMass = 0,
111 const double matchedExptIntensity = 0);
112
114 ms_fragment(const ms_peptide::PSM psmComponent,
115 const char * seriesName,
116 const double massValue,
117 const double nlValue,
118 const int col,
119 const int chargeState,
120 const double matchedExptMass = 0,
121 const double matchedExptIntensity = 0);
122
124 ms_fragment(const int seriesID,
125 const double massValue,
126 const double nlValue,
127 const char * peptideStr,
128 const int startPos,
129 const int endPos,
130 const int chargeState = 1,
131 const double matchedExptMass = 0,
132 const double matchedExptIntensity = 0);
133
135 ms_fragment(const ms_peptide::PSM psmComponent,
136 const int seriesID,
137 const double massValue,
138 const double nlValue,
139 const char * peptideStr,
140 const int startPos,
141 const int endPos,
142 const int chargeState,
143 const double matchedExptMass = 0,
144 const double matchedExptIntensity = 0);
145
147 ms_fragment(const char residueName,
148 const double massValue,
149 const double nlValue,
150 const int col = -1,
151 const int chargeState = 1,
152 const double matchedExptMass = 0,
153 const double matchedExptIntensity = 0);
154
156 ms_fragment(const ms_peptide::PSM psmComponent,
157 const char residueName,
158 const double massValue,
159 const double nlValue,
160 const int col,
161 const int chargeState,
162 const double matchedExptMass = 0,
163 const double matchedExptIntensity = 0);
164
166 ms_fragment(const double massValue,
167 const double nlValue,
168 const int chargeState,
169 const double matchedExptMass = 0,
170 const double matchedExptIntensity = 0);
171
173 bool isFromAlpha() const;
174
176 bool isFromBeta() const;
177
179 bool isRegular() const;
180
182 bool isNTerminal() const;
183
185 bool isCTerminal() const;
186
188 bool isInternal() const;
189
191 bool isImmonium() const;
192
194 bool isPrecursorNL() const;
195
197 double getMass() const;
198
200 double getNeutralLoss() const;
201
203 std::string getLabel(const LABEL_FORMAT fmt = LABEL_FORMAT_TRADITIONAL) const;
204
206 std::string getPeptideSubstring() const;
207
209 std::string getSeriesName() const;
210
212 int getColumn() const;
213
215 int getStart() const;
216
218 int getEnd() const;
219
221 int getCharge() const;
222
224 void clearMatchedIon();
225
227 void setMatchedIon(const double mass, const double intensity);
228
230 double getMatchedIonMass() const;
231
233 double getMatchedIonIntensity() const;
234
236 int getAllMatchedIons(std::vector<double> & masses, std::vector<double> & intensities) const;
237
238 protected:
239 enum ION_TYPE {ION_TYPE_UNKNOWN,
240 ION_TYPE_REGULAR,
241 ION_TYPE_INTERNAL,
242 ION_TYPE_IMMONIUM,
243 ION_TYPE_PRECURSOR_NL};
244 enum ION_TERMINUS {ION_TERM_AMBIGUOUS,
245 ION_TERM_N,
246 ION_TERM_C};
247 ms_peptide::PSM psmComponent_;
248 double mass_;
249 double nl_;
250 std::string labelTraditional_;
251 std::string labelPeptideView_;
252 std::string peptideSubstring_;
253 std::string series_;
254 int start_;
255 int end_;
256 int charge_;
257 ION_TYPE type_;
258 ION_TERMINUS terminus_;
259 bool matchedValueSet_;
260 double matchedExptMass_;
261 double matchedExptIntensity_;
262 std::vector<double> matchedExptMasses_;
263 std::vector<double> matchedExptIntensities_;
264
265 private:
266 void initRegularFragment(const ms_peptide::PSM psmComponent,
267 const int seriesID,
268 const double massValue,
269 const double nlValue,
270 const int col,
271 const int chargeState,
272 const double matchedExptMass,
273 const double matchedExptIntensity);
274
275 void initRegularFragment(const ms_peptide::PSM psmComponent,
276 const char* seriesName,
277 const double massValue,
278 const double nlValue,
279 const int col,
280 const int chargeState,
281 const double matchedExptMass,
282 const double matchedExptIntensity);
283
284 void initInternalFragment(const ms_peptide::PSM psmComponent,
285 const int seriesID,
286 const double massValue,
287 const double nlValue,
288 const char* peptideStr,
289 const int startPos,
290 const int endPos,
291 const int chargeState,
292 const double matchedExptMass,
293 const double matchedExptIntensity);
294
295 void initImmoniumFragment(const ms_peptide::PSM psmComponent,
296 const char residueName,
297 const double massValue,
298 const double nlValue,
299 const int col,
300 const int chargeState,
301 const double matchedExptMass,
302 const double matchedExptIntensity);
303
304 }; //class ms_fragment // end of mass_calculation_group
306} // matrix_science
307
308#endif // !defined(ms_fragment_INCLUDED_)
Class representing a single peptide fragment.
Definition: ms_fragment.hpp:38
LABEL_FORMAT
Format of fragment labels returned by getLabel().
Definition: ms_fragment.hpp:67
PSM
Type of data to return from accessor methods.
Definition: ms_peptide.hpp:98