Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_fragmentationrules.hpp
1/*
2##############################################################################
3# file: ms_fragmentationrules.hpp #
4# 'msparser' toolkit #
5# Encapsulates a fragmentation_rules file (mascot configuration files) #
6# #
7##############################################################################
8# COPYRIGHT NOTICE #
9# Copyright 1998-2006 Matrix Science Limited All Rights Reserved. #
10# #
11##############################################################################
12# @(#)$Source: parser/inc/ms_fragmentationrules.hpp $
13# @(#)$Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $
14# @(#)$Date: 2018-07-30 16:23:53 +0100 $
15# @(#)$Author: villek@matrixscience.com $
16##############################################################################
17*/
18
19#ifndef MS_FRAGMENTATIONRULES_HPP
20#define MS_FRAGMENTATIONRULES_HPP
21
22
23// Includes from the standard template library
24#include <vector>
25#include <string>
26
27
28namespace matrix_science {
34 class ms_filesource;
35
37
55 class MS_MASCOTRESFILE_API ms_fragmentationrules : public ms_customproperty
56 {
57 friend class ms_fragrulesfile;
58 public:
59
61
68 {
69 FRAG_IMMONIUM = 4,
70 FRAG_A_SERIES = 5,
71 FRAG_A_MINUS_NH3 = 6,
72 FRAG_A_MINUS_H2O = 7,
73 FRAG_B_SERIES = 8,
74 FRAG_B_MINUS_NH3 = 9,
75 FRAG_B_MINUS_H2O = 10,
76 FRAG_C_SERIES = 11,
77 FRAG_X_SERIES = 12,
78 FRAG_Y_SERIES = 13,
79 FRAG_Y_MINUS_NH3 = 14,
80 FRAG_Y_MINUS_H2O = 15,
81 FRAG_Z_SERIES = 16,
82 FRAG_INTERNAL_YB = 17,
83 FRAG_INTERNAL_YA = 18,
84 FRAG_Z_PLUS_1 = 21,
85 FRAG_D_SERIES = 22,
86 FRAG_V_SERIES = 23,
87 FRAG_W_SERIES = 24,
88 FRAG_Z_PLUS_2 = 25
89 };
90
93
96
99
101 void defaultValues();
102
104 void copyFrom(const ms_fragmentationrules* right);
105
106#ifndef SWIG
108 ms_fragmentationrules& operator=(const ms_fragmentationrules& right);
109#endif
111 std::string getTitle() const;
112
114 void setTitle(const char * title);
115
117 static int getFirstSeries();
118
120 static int getFirstSerie();
121
123 static int getLastSeries();
124
126 static int getLastSerie();
127
129 bool isSinglyCharged() const;
130
132 void setSinglyCharged(const bool value);
133
135 bool isCharged2Plus() const;
136
138 void setCharged2Plus(const bool value);
139
141 bool isCharged3Plus() const;
142
144 void setCharged3Plus(const bool value);
145
147 bool isSeriesUsed(const int series) const;
148
150 void clearSeries();
151
153 void setSeriesUsed(const int series, const bool val);
154
156 bool isValid() const;
157
159 bool verifyRule(ms_errs* err_, const bool tryToFix);
160
162 static std::string getSeriesDescription(const int series);
163
165 double getMinInternalMass() const;
166
168 void setMinInternalMass(const double mass);
169
171 double getMaxInternalMass() const;
172
174 void setMaxInternalMass(const double mass);
175
177 static std::string getSeriesName(const int series);
178
180 static bool isBackboneSeries(const int series);
181
183 static bool isNeutralLossSeries(const int series);
184
186 bool anyNLseriesUsed(const int series) const;
187
189 static int getTotalSeriesOutput();
190
191#ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
192#include "suppress_ms_customproperty.hpp"
193#endif
194
195 private:
196 std::string title_;
197 bool* which_series_;
198 double minInternalMass_;
199 double maxInternalMass_;
200 }; // class ms_fragmentationrules
201
203
208 class MS_MASCOTRESFILE_API ms_fragrulesfile: public ms_errors
209 {
210 public:
213
215 ms_fragrulesfile(const char* filename, const matrix_science::ms_connection_settings * cs = 0);
216
219
222
224 void defaultValues();
225
227 void copyFrom(const ms_fragrulesfile* right);
228
229#ifndef SWIG
231 ms_fragrulesfile& operator=(const ms_fragrulesfile& right);
232#endif
234 void setFileName(const char* filename);
235
237 std::string getFileName() const;
238
240 void setConnectionSettings(const matrix_science::ms_connection_settings & cs);
241
243 matrix_science::ms_connection_settings getConnectionSettings() const;
244
246 void read_file();
247
249 void read_buffer(const char * buffer);
250
252 void save_file();
253
255 int getNumberOfInstruments() const;
256
258 void clearInstruments();
259
261 void appendInstrument(const ms_fragmentationrules* item);
262
264 std::string getInstrumentName(const int instrumentNum) const;
265
267 const ms_fragmentationrules* getInstrumentByName(const char * name) const;
268
270 const ms_fragmentationrules* getInstrumentByNumber(const int instrumentNum) const;
271
273 bool updateInstrumentByNumber(const int num, const ms_fragmentationrules item);
274
276 bool updateInstrumentByName(const char* name, const ms_fragmentationrules item);
277
279 bool deleteInstrumentByNumber(const int num);
280
282 bool deleteInstrumentByName(const char* name);
283
284 private:
285 void read_filesource(ms_filesource & fsource);
286
287 std::string filename_;
288 std::vector< ms_fragmentationrules* > rules_;
289 std::vector< std::string > comments_;
291 }; // ms_fragrulesfile // end of config_group
293} // matrix_science namespace
294
295#endif // MS_FRAGMENTATIONRULES_HPP
296
297/*------------------------------- End of File -------------------------------*/
298
Settings required to make an HTTP connection to a Mascot server.
Definition: ms_connection_settings.hpp:54
The class is used as a base for property-containing classes, such as ms_mascotoptions.
Definition: ms_customproperty.hpp:91
This class is used as a base class for several Mascot Parser classes.
Definition: ms_errors.hpp:696
All errors are collected in an instance of this class.
Definition: ms_errors.hpp:37
This class encapsulates a single entry (an instrument) from a fragmentation_rules file.
Definition: ms_fragmentationrules.hpp:56
FRAG_SERIES_TYPE
Definitions for ID-constants for series used.
Definition: ms_fragmentationrules.hpp:68
This class encapsulates a complete fragmentation_rules file.
Definition: ms_fragmentationrules.hpp:209