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: 02a06a729c26ca3a83c94c5de5852f4f3f38c3cf | MSPARSER_REL_3_1_0-2025-07-27-0-gea47708fac $
14# @(#)$Date: 2024-12-08 15:34:14 +0000 $
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
99 ACQUISITION_MODE_DDA = 0,
100 ACQUISITION_MODE_DIA = 1
101 };
102
105
108
111
113 void defaultValues();
114
116 void copyFrom(const ms_fragmentationrules* right);
117
118#ifndef SWIG
120 ms_fragmentationrules& operator=(const ms_fragmentationrules& right);
121#endif
123 std::string getTitle() const;
124
126 void setTitle(const char * title);
127
129 static int getFirstSeries();
130
132 static int getFirstSerie();
133
135 static int getLastSeries();
136
138 static int getLastSerie();
139
141 bool isSinglyCharged() const;
142
144 void setSinglyCharged(const bool value);
145
147 bool isCharged2Plus() const;
148
150 void setCharged2Plus(const bool value);
151
153 bool isCharged3Plus() const;
154
156 void setCharged3Plus(const bool value);
157
159 bool isSeriesUsed(const int series) const;
160
162 void clearSeries();
163
165 void setSeriesUsed(const int series, const bool val);
166
168 bool isValid() const;
169
171 bool verifyRule(ms_errs* err_, const bool tryToFix);
172
174 static std::string getSeriesDescription(const int series);
175
177 double getMinInternalMass() const;
178
180 void setMinInternalMass(const double mass);
181
183 double getMaxInternalMass() const;
184
186 void setMaxInternalMass(const double mass);
187
189 ACQUISITION_MODE getAcquisitionMode() const;
190
192 void setAcquisitionMode(const ACQUISITION_MODE m);
193
195 int getOption_PERCOLATE() const;
196
198 void setOption_PERCOLATE(const int v);
199
201 std::string getOption_ML_ADAPTER_PARAM() const;
202
204 void setOption_ML_ADAPTER_PARAM(const std::string &v);
205
206
208 static std::string getSeriesName(const int series);
209
211 static bool isBackboneSeries(const int series);
212
214 static bool isNeutralLossSeries(const int series);
215
217 bool anyNLseriesUsed(const int series) const;
218
220 static int getTotalSeriesOutput();
221
222#ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
223#include "suppress_ms_customproperty.hpp"
224#endif
225
226 private:
227 std::string title_;
228 bool* which_series_;
229 double minInternalMass_;
230 double maxInternalMass_;
231 ACQUISITION_MODE acquisitionMode_;
232 int option_PERCOLATE_;
233 std::string option_ML_ADAPTER_PARAM_;
234 }; // class ms_fragmentationrules
235
237
242 class MS_MASCOTRESFILE_API ms_fragrulesfile: public ms_errors
243 {
244 public:
247
249 ms_fragrulesfile(const char* filename, const matrix_science::ms_connection_settings * cs = 0);
250
253
256
258 void defaultValues();
259
261 void copyFrom(const ms_fragrulesfile* right);
262
263#ifndef SWIG
265 ms_fragrulesfile& operator=(const ms_fragrulesfile& right);
266#endif
268 void setFileName(const char* filename);
269
271 std::string getFileName() const;
272
274 void setConnectionSettings(const matrix_science::ms_connection_settings & cs);
275
277 matrix_science::ms_connection_settings getConnectionSettings() const;
278
280 void read_file();
281
283 void read_buffer(const char * buffer);
284
286 void save_file();
287
289 int getNumberOfInstruments() const;
290
292 void clearInstruments();
293
295 void appendInstrument(const ms_fragmentationrules* item);
296
298 std::string getInstrumentName(const int instrumentNum) const;
299
301 const ms_fragmentationrules* getInstrumentByName(const char * name) const;
302
304 const ms_fragmentationrules* getInstrumentByNumber(const int instrumentNum) const;
305
307 bool updateInstrumentByNumber(const int num, const ms_fragmentationrules item);
308
310 bool updateInstrumentByName(const char* name, const ms_fragmentationrules item);
311
313 bool deleteInstrumentByNumber(const int num);
314
316 bool deleteInstrumentByName(const char* name);
317
318 private:
319 void read_filesource(ms_filesource & fsource);
320
321 std::string filename_;
322 std::vector< ms_fragmentationrules* > rules_;
323 std::vector< std::string > comments_;
325 }; // ms_fragrulesfile // end of config_group
327} // matrix_science namespace
328
329#endif // MS_FRAGMENTATIONRULES_HPP
330
331/*------------------------------- End of File -------------------------------*/
332
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
ACQUISITION_MODE
Definition: ms_fragmentationrules.hpp:98
This class encapsulates a complete fragmentation_rules file.
Definition: ms_fragmentationrules.hpp:243