Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_databaseoptions.hpp
1/*
2##############################################################################
3# file: ms_databaseoptions.hpp #
4# 'msparser' toolkit #
5# Encapsulates "mascot.dat"-file that describes most important parameters #
6##############################################################################
7# COPYRIGHT NOTICE #
8# Copyright 1998-2003 Matrix Science Limited All Rights Reserved. #
9# #
10##############################################################################
11# $Archive:: /Mowse/ms_mascotresfile/include/ms_databaseoptions.hpp $ #
12# $Author: villek@matrixscience.com $ #
13# $Date: 2018-07-30 16:23:53 +0100 $ #
14# $Revision: 1b450440f9c97e1e41d0fc6016a27d68951d4532 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
15# $NoKeywords:: $ #
16##############################################################################
17*/
18
19#ifndef MS_DATABASEOPTIONS_HPP
20#define MS_DATABASEOPTIONS_HPP
21
22
23#include <string>
24#include <vector>
25
26
27namespace matrix_science {
39 {
40 AA=0,
41 NA=1,
42 SL=2,
44 };
45
47
58 class MS_MASCOTRESFILE_API ms_databaseoptions
59 {
60 friend class ms_datfile;
61 friend class ms_databases;
62
63 public:
65
70 enum {
71 NUM_THREADS_AUTO_DETECT = -1
72 };
73
74
77
80
83
85 void defaultValues();
86
88 void copyFrom(const ms_databaseoptions* right);
89
90#ifndef SWIG
92 ms_databaseoptions& operator=(const ms_databaseoptions& right);
93#endif
95 bool isActive() const;
96
98 void setActive(const bool value);
99
101 std::string getName() const;
102
104 void setName(const char* name);
105
107 std::string getPath() const;
108
110 void setPath(const char* path);
111
113 int getDBType() const;
114
116 void setDBType(const int type);
117
119 bool isMemoryMapFiles() const;
120
122 void setMemoryMapFiles(const bool flag);
123
125 int getNumberOfThreads() const;
126
128 void setNumberOfThreads(const int number);
129
131 bool isLockMemory() const;
132
134 void setLockMemory(const bool flag);
135
137 bool isLocalRefFile() const;
138
140 void setLocalRefFile(const bool flag);
141
143 int getAccessionParseRuleIndex() const;
144
146 void setAccessionParseRuleIndex(const int index);
147
149 int getDescriptionParseRuleIndex() const;
150
152 void setDescriptionParseRuleIndex(const int index);
153
155 int getAccessionRefParseRuleIndex() const;
156
158 void setAccessionRefParseRuleIndex(const int index);
159
161 int getTaxonomyParseRuleIndex() const;
162
164 void setTaxonomyParseRuleIndex(const int index);
165
167 bool isBlastIndexFiles() const;
168
170 void setBlastIndexFiles(const bool flag);
171
173 void setPreceedingComments(const std::string &str);
174
176 const std::string& getPreceedingComments() const;
177
178 private:
179 std::string getStringValue() const;
180
181 bool active_;
182 std::string name_;
183 std::string path_;
184 int type_;
185 int __numEntries_; // no longer used
186 int __uniqueID_; // no longer used
187 bool mmapFiles_;
188 bool __useBlastIndexFiles_; // no longer used - was also blocks
189 int numThreads_;
190 bool lockMemory_;
191 bool hasRefFile_;
192 int accessionParseRule_;
193 int descriptionParseRule_;
194 int accessionRefParseRule_;
195 int taxonomyParseRule_;
196 std::string comment_;
197 }; // class ms_databaseoptions
198
200
224 class MS_MASCOTRESFILE_API ms_databases: public ms_customproperty
225 {
226 friend class ms_datfile;
227 public:
229 ms_databases();
230
232 ms_databases(const ms_databases& src);
233
236
238 void defaultValues();
239
241 void copyFrom(const ms_databases* right);
242
243#ifndef SWIG
245 ms_databases& operator=(const ms_databases& right);
246#endif
248 bool isSectionAvailable() const;
249
251 void setSectionAvailable(const bool value);
252
254 int getNumberOfDatabases() const;
255
257 const ms_databaseoptions* getDatabase(const int index) const;
258
260 void clearDatabases();
261
263 void appendDatabase(const ms_databaseoptions* item);
264
266 int findDatabase(const char* dbName, const bool searchInactive = false) const;
267
269 bool updateDatabaseByNumber(const int num, const ms_databaseoptions db);
270
272 bool updateDatabaseByName(const char* name, const ms_databaseoptions db);
273
275 bool deleteDatabaseByNumber(const int num);
276
278 bool deleteDatabaseByName(const char* name);
279
280#ifdef SUPPRESS_MS_CUSTOMPROPERTY_INHERITANCE
281#include "suppress_ms_customproperty.hpp"
282#endif
283
284 private:
285 void appendDatabase(const ms_databaseoptions* item, const char *propVal);
286 void setFollowingComments(const std::string &str);
287 const std::string& getFollowingComments() const;
288
289 bool sectionAvailable_;
290 std::vector< ms_databaseoptions* > dbases_;
291 std::string followingComments_;
292 }; // class ms_databases // end of config_group
294} // namespace matrix_science
295
296#endif // MS_DATABASEOPTIONS_HPP
297
298/*------------------------------- End of File -------------------------------*/
The class is used as a base for property-containing classes, such as ms_mascotoptions.
Definition: ms_customproperty.hpp:91
An instance of this class represents a single database definition from the Databases section of masco...
Definition: ms_databaseoptions.hpp:59
An instance of this class represents the Databases section of mascot.dat.
Definition: ms_databaseoptions.hpp:225
Encapsulates the mascot.dat file that contains the most important parameters.
Definition: ms_datfile.hpp:47
DATABASE_TYPE
Definition: ms_databaseoptions.hpp:39
@ SLREF
FASTA reference database of a Spectral Library.
Definition: ms_databaseoptions.hpp:43
@ SL
Spectral Library (MSP file)
Definition: ms_databaseoptions.hpp:42
@ NA
NA sequence database (FASTA file, nucleic acid)
Definition: ms_databaseoptions.hpp:41
@ AA
Protein sequence database (FASTA file, amino acid)
Definition: ms_databaseoptions.hpp:40