Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_peptide.hpp
1/*
2##############################################################################
3# file: ms_mascotrespeptide.hpp #
4# 'msparser' toolkit #
5# Encapsulates a peptide from the summary section or peptides section of the #
6# mascot results file #
7##############################################################################
8# COPYRIGHT NOTICE #
9# Copyright 1998-2002 Matrix Science Limited All Rights Reserved. #
10# #
11##############################################################################
12# $Archive:: /MowseBranches/ms_mascotresfile_1.2/include/ms_mascotrespe $ #
13# $Author: robertog@matrixscience.com $ #
14# $Date: 2024-09-17 12:39:58 +0100 $ #
15# $Revision: 32680bc4ad9a740ac65e549a795c40e355d93076 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
16# $NoKeywords:: $ #
17##############################################################################
18*/
19
20#ifndef MS_MASCOTRESPEPTIDE_HPP
21#define MS_MASCOTRESPEPTIDE_HPP
22
23
24// Includes from the standard template library
25#include <string>
26#include <vector>
27
28namespace msparser_internal {
29 class ms_peptide_implbase;
30 class ms_mascotresultsbase;
31}
32
33namespace matrix_science {
34 class ms_protein;
35 class ms_mascotresults;
36 class ms_linker_site;
37 class ms_linker_site_vector;
38
45
56 class MS_MASCOTRESFILE_API ms_peptide
57 {
58 public:
60 ms_peptide();
61
63 ms_peptide( int query,
64 int rank,
65 int missedCleavages,
66 double mrCalc,
67 double delta,
68 double observed,
69 int charge,
70 int numIonsMatched,
71 std::string peptideStr,
72 int peaksUsedFromIons1,
73 std::string varModsStr,
74 double ionsScore,
75 std::string seriesUsedStr,
76 int peaksUsedFromIons2,
77 int peaksUsedFromIons3,
78 const ms_mascotresults * pResults = 0,
79 bool storeReloadableInfo = true);
80
81 enum SEARCH_PHASE {
82 SEARCH_PHASE_PRIMARY = 0,
83 SEARCH_PHASE_ERRTOL = 1,
84 SEARCH_PHASE_LIBRARY = 2
85 };
86
88
98 enum PSM {
99 PSM_COMPLETE = 0,
100 PSM_CROSSLINK_ALPHA = 1,
101 PSM_CROSSLINK_BETA = 2
102 };
103
105
107 enum PSM_TYPE {
108 PSM_STANDARD = 0,
109 PSM_DECOY = 1,
110 PSM_ERRTOL = 2,
111 PSM_ERRTOLDECOY = 3,
112 PSM_LIBRARY = 4,
113 PSM_CROSSLINK = 5,
114
115 N_PSM_TYPES = 6
116 };
117
119 ms_peptide( const int query,
120 const int rank,
121 const SEARCH_PHASE searchPhase,
122 const int missedCleavages,
123 const double mrCalc,
124 const double delta,
125 const double observed,
126 const int charge,
127 const int numIonsMatched,
128 const std::string & peptideStr,
129 const int peaksUsedFromIons1,
130 const std::string & varModsStr,
131 const std::string & summedModsStr,
132 const std::string & localModsStr,
133 const std::string & monoLinkStr,
134 const ms_linker_site_vector & loopLinks,
135 const double ionsScore,
136 const std::string & seriesUsedStr,
137 const int peaksUsedFromIons2,
138 const int peaksUsedFromIons3,
139 const std::string & primaryNlStr,
140 const std::string & summedModsNlStr,
141 const std::string & localModsNlStr,
142 const std::string & substStr,
143 const std::string & componentStr,
144 const ms_mascotresults * pResults = 0,
145 const bool storeReloadableInfo = true);
146
147
149 ms_peptide( const int query,
150 const int rank,
151 const SEARCH_PHASE searchPhase,
152 const double delta,
153 const double observed,
154 const int charge,
155 const int numIonsMatched,
156 const int peaksUsedFromIons1,
157 const double ionsScore,
158 const std::string & seriesUsedStr,
159 const int peaksUsedFromIons2,
160 const int peaksUsedFromIons3,
161 const ms_peptide & pepAlpha,
162 const ms_peptide & pepBeta,
163 const ms_linker_site & linkerSite,
164 const ms_mascotresults * pResults = 0,
165 const bool storeReloadableInfo = true);
166
168 ms_peptide(const ms_peptide& src);
169
170#ifndef SWIG
172 ms_peptide(std::unique_ptr<msparser_internal::ms_peptide_implbase> pImpl);
173#endif
174
176 ~ms_peptide();
177
178#ifndef SWIG
180 ms_peptide& operator=(const ms_peptide& right);
181#endif
183 void copyFrom(const ms_peptide* src);
184
186 bool clearReloadableInfo();
187
188#ifndef SWIG
190 bool getAllProperties(int & outQuery,
191 int & outRank,
192 int & outPrettyRank,
193 int & outMissedCleavages,
194 double & outMrCalc,
195 double & outDelta,
196 double & outObserved,
197 int & outCharge,
198 int & outNumIonsMatched,
199 std::string & outPeptideStr,
200 int & outPeaksUsedFromIons1,
201 std::string & outVarModsStr,
202 std::string & outSummedModsStr,
203 std::string & outLocalModsStr,
204 std::string & outMonoLinkStr,
205 double & outIonsScore,
206 std::string & outSeriesUsedStr,
207 int & outPeaksUsedFromIons2,
208 int & outPeaksUsedFromIons3,
209 std::string & outPrimaryNlStr,
210 std::string & outSummedModsNlStr,
211 std::string & outLocalModsNlStr,
212 std::string & outComponentStr) const;
213#else // SWIG Multiple return values
214 bool getAllProperties(int & OUTPUT,
215 int & OUTPUT,
216 int & OUTPUT,
217 int & OUTPUT,
218 double & OUTPUT,
219 double & OUTPUT,
220 double & OUTPUT,
221 int & OUTPUT,
222 int & OUTPUT,
223 std::string & OUTPUT,
224 int & OUTPUT,
225 std::string & OUTPUT,
226 std::string & OUTPUT,
227 std::string & OUTPUT,
228 std::string & OUTPUT,
229 double & OUTPUT,
230 std::string & OUTPUT,
231 int & OUTPUT,
232 int & OUTPUT,
233 std::string & OUTPUT,
234 std::string & OUTPUT,
235 std::string & OUTPUT,
236 std::string & OUTPUT) const;
237#endif
239 int getQuery() const;
240
242 int getRank() const;
243 void setRank(int rank);
244
246 int getPrettyRank() const;
247 void setPrettyRank(int rank);
248
250 int getAmbiguityGroupId() const;
252 void setAmbiguityGroupId(int group);
253
255 bool getAnyMatch() const;
256
258 int getMissedCleavages(const PSM psmComponent = PSM_COMPLETE) const;
259
261 double getMrCalc(const PSM psmComponent = PSM_COMPLETE) const;
262
264 double getDelta() const;
265
267 double getObserved() const;
268
270 double getMrExperimental() const;
271
273 int getCharge() const;
274
276 int getNumIonsMatched() const;
277
279 std::string getPeptideStr(bool substituteAmbiguous = true, const PSM psmComponent = PSM_COMPLETE) const;
280
282 int getPeptideLength(const PSM psmComponent = PSM_COMPLETE) const;
283
285 int getPeaksUsedFromIons1() const;
286
288 int getPeaksUsedFromIons2() const;
289
291 int getPeaksUsedFromIons3() const;
292
294 std::string getVarModsStr(const PSM psmComponent = PSM_COMPLETE) const;
295
297 void setVarModsStr(const std::string str, const PSM psmComponent = PSM_COMPLETE);
298
300 std::string getSummedModsStr(const PSM psmComponent = PSM_COMPLETE) const;
301
303 void setSummedModsStr(const std::string str, const PSM psmComponent = PSM_COMPLETE);
304
306 std::string getLocalModsStr(const PSM psmComponent = PSM_COMPLETE) const;
307
309 void setLocalModsStr(const std::string str, const PSM psmComponent = PSM_COMPLETE);
310
312 std::string getParsedLocalModsStr(const PSM psmComponent = PSM_COMPLETE) const;
313
315 double getIonsScore() const;
316
318 double getExpectationValue() const;
319
321 std::string getSeriesUsedStr() const;
322
324 bool isSamePeptideStr(ms_peptide * peptide,
325 bool substituteAmbiguous = true) const;
326
328 bool isSameVarModsStr(ms_peptide * peptide) const;
329
331 bool isSameSummedModsStr(ms_peptide * peptide) const;
332
334 int getFirstProtAppearedIn() const;
335
338 void setFirstProtAppearedIn(int n);
339
342 void makeUnassigned();
343
345 double getIonsIntensity() const;
347 void setIonsIntensity(double n);
348
350 const ms_protein * getProtein(int num) const;
351
353 const std::vector<int> getProteins() const;
354
356 int getNumProteins() const;
357 void addProtein(const ms_protein * protein);
358 void addProtein(const int hitNumber);
359
361 std::string getAmbiguityString(const PSM psmComponent = PSM_COMPLETE) const;
363 bool setAmbiguityString(const std::string val, const PSM psmComponent = PSM_COMPLETE);
364
366 std::string getPrimaryNlStr(const PSM psmComponent = PSM_COMPLETE) const;
368 void setPrimaryNlStr(const std::string value, const PSM psmComponent = PSM_COMPLETE);
369
371 std::string getSummedModsNlStr(const PSM psmComponent = PSM_COMPLETE) const;
373 void setSummedModsNlStr(const std::string value, const PSM psmComponent = PSM_COMPLETE);
374
376 std::string getLocalModsNlStr(const PSM psmComponent = PSM_COMPLETE) const;
378 void setLocalModsNlStr(const std::string value, const PSM psmComponent = PSM_COMPLETE);
379
381 std::string getMonoLinkStr(const PSM psmComponent = PSM_COMPLETE) const;
383 void setMonoLinkStr(const std::string value, const PSM psmComponent = PSM_COMPLETE);
384
386 bool getIsFromErrorTolerant() const;
388 void setIsFromErrorTolerant(const bool isFromErrorTolerant);
389
391 std::string getComponentStr(const PSM psmComponent = PSM_COMPLETE) const;
393 void setComponentStr(const std::string value, const PSM psmComponent = PSM_COMPLETE);
394
396 bool getLessThanMinPepLen() const;
397
399 int getNum13C(const double tol, const std::string tolu, const std::string mass_type) const;
400
402 void setPercolatorScores(double posteriorErrorProbability,
403 double qValue,
404 double internalPercolatorScore);
405
407 bool anyPercolatorResults() const;
408
409#ifndef SWIG
411 void getPercolatorScores(double * posteriorErrorProbability,
412 double * qValue,
413 double * internalPercolatorScore,
414 double * mascotIonsScore) const;
415#else // SWIG Multiple return values
416 void getPercolatorScores(double * OUTPUT,
417 double * OUTPUT,
418 double * OUTPUT,
419 double * OUTPUT) const;
420#endif
421
423 bool getIsFromLibrary() const;
425 void setIsFromLibrary(const bool isFromLibrary);
426
428 void getAnyProteinTermination(
429 bool & isNterminus,
430 bool & isCterminus,
431 const PSM psmComponent = PSM_COMPLETE) const;
432
434 void setInternalSortingScore(double s);
435
437 double getInternalSortingScore() const;
438
440 int getNumberOfLinkedPeptides() const;
441
443 void getIntactLinks(ms_linker_site_vector &vec) const;
444
446 ms_linker_site_vector getIntactLinks() const;
447
449 void getLoopLinks(ms_linker_site_vector &vec, const PSM psmComponent = PSM_COMPLETE) const;
450
452 ms_linker_site_vector getLoopLinks(const PSM psmComponent = PSM_COMPLETE) const;
453
454 private:
455 std::unique_ptr<msparser_internal::ms_peptide_implbase> pImpl_;
456 }; // end of resfile_group
458} // matrix_science namespace
459
460#endif // MS_MASCOTRESPEPTIDE_HPP
461
462/*------------------------------- End of File -------------------------------*/
A vector of linker sites.
Definition: ms_linker_site_vector.hpp:46
Position of an intact link between alpha and beta peptide or a looplink.
Definition: ms_linker_site.hpp:42
Abstract class for either ms_peptidesummary or ms_proteinsummary.
Definition: ms_mascotresults.hpp:83
This class encapsulates a peptide from the mascot results file.
Definition: ms_peptide.hpp:57
PSM_TYPE
Specifies the search pass and origin of the peptide match.
Definition: ms_peptide.hpp:107
ms_peptide(const int query, const int rank, const SEARCH_PHASE searchPhase, const double delta, const double observed, const int charge, const int numIonsMatched, const int peaksUsedFromIons1, const double ionsScore, const std::string &seriesUsedStr, const int peaksUsedFromIons2, const int peaksUsedFromIons3, const ms_peptide &pepAlpha, const ms_peptide &pepBeta, const ms_linker_site &linkerSite, const ms_mascotresults *pResults=0, const bool storeReloadableInfo=true)
Constructor to initialise a crosslinked peptide.
PSM
Type of data to return from accessor methods.
Definition: ms_peptide.hpp:98
ms_peptide(const int query, const int rank, const SEARCH_PHASE searchPhase, const int missedCleavages, const double mrCalc, const double delta, const double observed, const int charge, const int numIonsMatched, const std::string &peptideStr, const int peaksUsedFromIons1, const std::string &varModsStr, const std::string &summedModsStr, const std::string &localModsStr, const std::string &monoLinkStr, const ms_linker_site_vector &loopLinks, const double ionsScore, const std::string &seriesUsedStr, const int peaksUsedFromIons2, const int peaksUsedFromIons3, const std::string &primaryNlStr, const std::string &summedModsNlStr, const std::string &localModsNlStr, const std::string &substStr, const std::string &componentStr, const ms_mascotresults *pResults=0, const bool storeReloadableInfo=true)
Constructor to initialise all values.
This class encapsulates a protein in the mascot results file.
Definition: ms_protein.hpp:57