Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
polymarker_service.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
21 #ifndef POLYMARKER_SERVICE_H
22 #define POLYMARKER_SERVICE_H
23 
24 #include "service.h"
25 #include "library.h"
26 
27 #include "async_tasks_manager.h"
28 
29 /*
30 ** Now we use the generic helper definitions above to define LIB_API and LIB_LOCAL.
31 ** LIB_API is used for the public API symbols. It either DLL imports or DLL exports
32 ** (or does nothing for static build)
33 ** LIB_LOCAL is used for non-api symbols.
34 */
35 
36 
37 
38 
39 #ifdef SHARED_LIBRARY /* defined if LIB is compiled as a DLL */
40  #ifdef POLYMARKER_LIBRARY_EXPORTS /* defined if we are building the LIB DLL (instead of using it) */
41  #define POLYMARKER_SERVICE_API LIB_HELPER_SYMBOL_EXPORT
42  #else
43  #define POLYMARKER_SERVICE_API LIB_HELPER_SYMBOL_IMPORT
44  #endif /* #ifdef POLYMARKER_LIBRARY_EXPORTS */
45  #define POLYMARKER_SERVICE_LOCAL LIB_HELPER_SYMBOL_LOCAL
46 #else /* SHARED_LIBRARY is not defined: this means LIB is a static lib. */
47  #define POLYMARKER_SERVICE_API
48  #define POLYMARKER_SERVICE_LOCAL
49 #endif /* #ifdef SHARED_LIBRARY */
50 
51 
52 /*
53  * The following preprocessor macros allow us to declare
54  * and define the variables in the same place. By default,
55  * they will expand to
56  *
57  * extern const char *SERVICE_NAME_S;
58  *
59  * however if ALLOCATE_JSON_TAGS is defined then it will
60  * become
61  *
62  * const char *SERVICE_NAME_S = "path";
63  *
64  * ALLOCATE_POLYMARKER_TAGS must be defined only once prior to
65  * including this header file. Currently this happens in
66  * polymarker_service.c.
67  */
68 #ifndef DOXYGEN_SHOULD_SKIP_THIS
69 
70 #ifdef ALLOCATE_POLYMARKER_TAGS
71  #define POLYMARKER_PREFIX POLYMARKER_SERVICE_API
72  #define POLYMARKER_VAL(x) = x
73  #define POLYMARKER_STRUCT_VAL(x,y) = { x, y}
74 #else
75  #define POLYMARKER_PREFIX extern
76  #define POLYMARKER_VAL(x)
77  #define POLYMARKER_STRUCT_VAL(x,y)
78 #endif
79 
80 #endif /* #ifndef DOXYGEN_SHOULD_SKIP_THIS */
81 
86 typedef enum
87 {
90 
95 
99 
100 
101 
106 typedef struct PolymarkerSequence
107 {
109  const char *ps_name_s;
110 
112  const char *ps_fasta_filename_s;
113 
115  const char *ps_description_s;
116 
122 
124 
125 
129 typedef struct PolymarkerServiceData
130 {
133 
136 
141  const char *psd_working_dir_s;
142 
143 
148  const char *psd_executable_s;
149 
150 
154  const char *psd_aligner_s;
155 
156 
161 
166 
172 
177 
178 
184 
186 
187 
191 POLYMARKER_PREFIX NamedParameterType PS_CONTIG_FILENAME POLYMARKER_STRUCT_VAL ("Contig filename", PT_STRING);
192 
193 
197 POLYMARKER_PREFIX NamedParameterType PS_GENE_ID POLYMARKER_STRUCT_VAL ("Gene", PT_STRING);
198 
202 POLYMARKER_PREFIX NamedParameterType PS_TARGET_CHROMOSOME POLYMARKER_STRUCT_VAL ("Chromosome", PT_STRING);
203 
204 
208 POLYMARKER_PREFIX NamedParameterType PS_SEQUENCE POLYMARKER_STRUCT_VAL ("Sequence", PT_LARGE_STRING);
209 
210 
215 POLYMARKER_PREFIX NamedParameterType PS_JOB_IDS POLYMARKER_STRUCT_VAL ("Previous results", PT_LARGE_STRING);
216 
217 
219 POLYMARKER_PREFIX const char *PS_TOOL_S POLYMARKER_VAL ("tool");
220 
222 POLYMARKER_PREFIX const char *PS_TOOL_SYSTEM_S POLYMARKER_VAL ("system");
223 
225 POLYMARKER_PREFIX const char *PS_TOOL_WEB_S POLYMARKER_VAL ("web");
226 
228 POLYMARKER_PREFIX const char *PS_ALIGNER_BLAST_S POLYMARKER_VAL ("blast");
229 
231 POLYMARKER_PREFIX const char *PS_ALIGNER_EXONERATE_S POLYMARKER_VAL ("exonerate");
232 
233 
234 #ifdef __cplusplus
235 extern "C"
236 {
237 #endif
238 
248 POLYMARKER_SERVICE_API ServicesArray *GetServices (UserDetails *user_p, GrassrootsServer *grassroots_p);
249 
250 
258 
259 
261 
262 
263 #ifdef __cplusplus
264 }
265 #endif
266 
267 
268 
269 #endif /* #ifndef POLYMARKER_SERVICE_H */
PolymarkerServiceData::psd_thermodynamic_parameters_path_s
const char * psd_thermodynamic_parameters_path_s
Path to Primer3 config files.
Definition: polymarker_service.h:165
PS_ALIGNER_BLAST_S
const char * PS_ALIGNER_BLAST_S
The constant string for denoting that Polymarker will use the blast aligner.
Definition: polymarker_service.h:228
PolymarkerSequence::ps_active_flag
bool ps_active_flag
Sets whether the PolymarkerSequence defaults to being searched against or not.
Definition: polymarker_service.h:121
NamedParameterType
This is a datatype that stores a read-only c-style string along with a ParameterType.
Definition: parameter.h:85
PolymarkerSequence::ps_fasta_filename_s
const char * ps_fasta_filename_s
The filename of the fasta file for this sequence.
Definition: polymarker_service.h:112
service.h
PT_STRING
A c-style string.
Definition: parameter_type.h:58
PolymarkerSequence
A datatype that stores the information of sequence data that the PolymarkerService can run with.
Definition: polymarker_service.h:106
PolymarkerSequence::ps_name_s
const char * ps_name_s
The name of the database to display to the user.
Definition: polymarker_service.h:109
PS_TOOL_WEB_S
const char * PS_TOOL_WEB_S
The constant string for denoting that Polymarker will use the web-based tool.
Definition: polymarker_service.h:225
PolymarkerToolType
PolymarkerToolType
An enum listing the different types of PolymarkerTool that are available.
Definition: polymarker_service.h:86
PT_LARGE_STRING
A potentially large c-style string.
Definition: parameter_type.h:90
PolymarkerServiceData::psd_base_data
ServiceData psd_base_data
The base ServiceData.
Definition: polymarker_service.h:132
PolymarkerSequence::ps_description_s
const char * ps_description_s
The description of the database to display to the user.
Definition: polymarker_service.h:115
ReleasePolymarkerService
void ReleasePolymarkerService(Service *service_p)
PolymarkerServiceData
The ServiceData used for the PolymarkerService.
Definition: polymarker_service.h:129
PS_JOB_IDS
NamedParameterType PS_JOB_IDS
The NamedParameterType for the parameter used for retrieving the results of previously-run jobs.
Definition: polymarker_service.h:215
PolymarkerServiceData::psd_default_primer_config_file_s
const char * psd_default_primer_config_file_s
File with preferences to be sent to primer3.
Definition: polymarker_service.h:160
PTT_NUM_TYPES
The number of different PolymarkerTools available.
Definition: polymarker_service.h:97
PS_TOOL_S
const char * PS_TOOL_S
The constant string for configuring the tool that Polymarker will use.
Definition: polymarker_service.h:219
Service
A datatype which defines an available service, its capabilities and its parameters.
Definition: service.h:153
async_tasks_manager.h
ServicesArray
A datatype for having a set of Services.
Definition: service.h:422
PS_TOOL_SYSTEM_S
const char * PS_TOOL_SYSTEM_S
The constant string for denoting that Polymarker will use the system-based tool.
Definition: polymarker_service.h:222
PTT_SYSTEM
Run the Polymarker program directly on the server.
Definition: polymarker_service.h:94
GetServices
ServicesArray * GetServices(UserDetails *user_p, GrassrootsServer *grassroots_p)
Get the ServicesArray containing the Polymarker Services.
library.h
PS_CONTIG_FILENAME
NamedParameterType PS_CONTIG_FILENAME
The NamedParameterType for the contig filename parameter.
Definition: polymarker_service.h:191
AsyncTasksManager
A datatype for storing AsyncTasks in a collection.
Definition: async_tasks_manager.h:24
GrassrootsServer
Definition: grassroots_server.h:45
PolymarkerServiceData::psd_tool_type
PolymarkerToolType psd_tool_type
The type of tool that this PolymarkerService will use.
Definition: polymarker_service.h:135
PS_GENE_ID
NamedParameterType PS_GENE_ID
The NamedParameterType for the gene ID parameter.
Definition: polymarker_service.h:197
PolymarkerServiceData::psd_index_data_size
size_t psd_index_data_size
The number of PolymarkerSequence objects stored in psd_index_data_p.
Definition: polymarker_service.h:176
ReleaseServices
void ReleaseServices(ServicesArray *services_p)
Free the ServicesArray containing the Polymarker Services.
PS_SEQUENCE
NamedParameterType PS_SEQUENCE
The NamedParameterType for the sequence parameter.
Definition: polymarker_service.h:208
PolymarkerServiceData::psd_task_manager_p
AsyncTasksManager * psd_task_manager_p
The AsyncTasksManager used for coordinating the PolymarkerServiceJobs being run.
Definition: polymarker_service.h:183
ServiceData
A datatype for holding the configuration data for a Service.
Definition: service.h:126
PS_TARGET_CHROMOSOME
NamedParameterType PS_TARGET_CHROMOSOME
The NamedParameterType for the target chromosome parameter.
Definition: polymarker_service.h:202
PTT_WEB
The web-based tool.
Definition: polymarker_service.h:89
PolymarkerServiceData::psd_executable_s
const char * psd_executable_s
If the system-based PolymarkerTool is to be used, this is the executable that the system-based Polyma...
Definition: polymarker_service.h:148
POLYMARKER_SERVICE_LOCAL
#define POLYMARKER_SERVICE_LOCAL
Definition: polymarker_service.h:48
POLYMARKER_SERVICE_API
#define POLYMARKER_SERVICE_API
Definition: polymarker_service.h:47
PolymarkerServiceData::psd_aligner_s
const char * psd_aligner_s
Polymarker can use either blast or exonerate as its aligner.
Definition: polymarker_service.h:154
PolymarkerServiceData::psd_index_data_p
PolymarkerSequence * psd_index_data_p
An array of available PolymarkerSequence objects that the PolymarkerService can run against.
Definition: polymarker_service.h:171
PolymarkerServiceData::psd_working_dir_s
const char * psd_working_dir_s
The directory where the Polymarker input, output and log files will be stored.
Definition: polymarker_service.h:141
PS_ALIGNER_EXONERATE_S
const char * PS_ALIGNER_EXONERATE_S
The constant string for denoting that Polymarker will use the exonerate aligner.
Definition: polymarker_service.h:231