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.
blast_service_params.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 
22 /*
23  * blast_service_params.h
24  *
25  * Created on: 13 Feb 2016
26  * Author: billy
27  */
28 
29 #ifndef SERVICES_BLAST_INCLUDE_BLAST_SERVICE_PARAMS_H_
30 #define SERVICES_BLAST_INCLUDE_BLAST_SERVICE_PARAMS_H_
31 
32 
33 #include "blast_service.h"
34 #include "blast_service_api.h"
35 #include "parameter_set.h"
36 
37 
43 typedef enum BlastOutputFormat
44 {
47 
50 
53 
56 
59 
62 
65 
68 
71 
74 
77 
80 
83 
86 
89 
92 
95 
98 
101 
104 
108 
109 
110 
111 extern const char *BSP_OUTPUT_FORMATS_SS [BOF_NUM_TYPES];
112 
113 
114 
115 /* Grassroots params */
116 
122 BLAST_SERVICE_PREFIX NamedParameterType BS_JOB_ID BLAST_SERVICE_STRUCT_VAL ("job_id", PT_STRING);
123 
124 /*
125  * These become the -query_loc parameter with the value "<subrange_from>-<subrange_to>"
126  */
132 BLAST_SERVICE_PREFIX NamedParameterType BS_SUBRANGE_FROM BLAST_SERVICE_STRUCT_VAL ("subrange_from", PT_UNSIGNED_INT);
133 
139 BLAST_SERVICE_PREFIX NamedParameterType BS_SUBRANGE_TO BLAST_SERVICE_STRUCT_VAL ("subrange_to", PT_UNSIGNED_INT);
140 
141 /* General Blast params */
147 BLAST_SERVICE_PREFIX NamedParameterType BS_TASK BLAST_SERVICE_STRUCT_VAL ("task", PT_STRING);
148 
154 BLAST_SERVICE_PREFIX NamedParameterType BS_INPUT_QUERY BLAST_SERVICE_STRUCT_VAL ("query", PT_FASTA);
155 
161 BLAST_SERVICE_PREFIX NamedParameterType BS_MAX_SEQUENCES BLAST_SERVICE_STRUCT_VAL ("max_target_seqs", PT_UNSIGNED_INT);
162 
163 
169 BLAST_SERVICE_PREFIX NamedParameterType BS_EXPECT_THRESHOLD BLAST_SERVICE_STRUCT_VAL ("evalue", PT_UNSIGNED_REAL);
170 
177 BLAST_SERVICE_PREFIX NamedParameterType BS_OUTPUT_FORMAT BLAST_SERVICE_STRUCT_VAL ("outfmt", PT_UNSIGNED_INT);
178 
185 BLAST_SERVICE_PREFIX NamedParameterType BS_CUSTOM_OUTPUT_FORMAT BLAST_SERVICE_STRUCT_VAL ("custom_outfmt", PT_STRING);
186 
187 
194 BLAST_SERVICE_PREFIX NamedParameterType BS_WORD_SIZE BLAST_SERVICE_STRUCT_VAL ("word_size", PT_UNSIGNED_INT);
195 
196 
204 typedef struct BlastTask
205 {
210  const char *bt_name_s;
211 
215  const char *bt_description_s;
216 
217 } BlastTask;
218 
219 
220 
221 
222 
223 #ifdef __cplusplus
224 extern "C"
225 {
226 #endif
227 
239 BLAST_SERVICE_LOCAL bool AddQuerySequenceParams (BlastServiceData *data_p, ParameterSet *param_set_p, AddAdditionalParamsFn callback_fn, void *callback_data_p);
240 
241 
253 BLAST_SERVICE_LOCAL bool AddGeneralAlgorithmParams (BlastServiceData *data_p, ParameterSet *param_set_p, AddAdditionalParamsFn callback_fn, const void *callback_data_p);
254 
255 
267 BLAST_SERVICE_LOCAL bool AddProgramSelectionParameters (BlastServiceData *blast_data_p, ParameterSet *param_set_p, const BlastTask *tasks_p, const BlastTask *default_task_p, const size_t task_mem_size, const size_t num_tasks);
268 
269 
280 BLAST_SERVICE_LOCAL uint16 AddDatabaseParams (BlastServiceData *data_p, ParameterSet *param_set_p, DataResource *resource_p, const DatabaseType db_type);
281 
282 
292 
293 
294 
305 
306 
316 BLAST_SERVICE_LOCAL Parameter *SetUpOutputFormatParameters (const char **formats_ss, const uint32 num_formats, const uint32 default_format, const BlastServiceData *service_data_p, ParameterSet *param_set_p, ParameterGroup *group_p);
317 
318 
327 BLAST_SERVICE_LOCAL char *CreateGroupName (const char *server_s);
328 
329 
338 BLAST_SERVICE_LOCAL int8 GetOutputFormatCodeForString (const char *output_format_s);
339 
340 
341 
343 
344 
346 
347 
349 
350 
352 
353 
355 
356 
358 
359 
360 BLAST_SERVICE_LOCAL char *GetFullyQualifiedDatabaseName (const char *group_s, const char *db_s);
361 
362 
363 BLAST_SERVICE_LOCAL const char *GetLocalDatabaseName (const char *fully_qualified_db_s);
364 
365 
366 BLAST_SERVICE_LOCAL bool AddProteinGeneralAlgorithmParameters (BlastServiceData *data_p, ParameterSet *param_set_p, ParameterGroup *group_p, const void *callback_data_p);
367 
368 
369 
370 
371 #ifdef __cplusplus
372 }
373 #endif
374 
375 #endif /* SERVICES_BLAST_INCLUDE_BLAST_SERVICE_PARAMS_H_ */
Parameter
The datatype that stores all of the information about a Parameter.
Definition: parameter.h:121
BOF_ORGANISM_REPORT
Organism Report.
Definition: blast_service_params.h:100
BS_EXPECT_THRESHOLD
NamedParameterType BS_EXPECT_THRESHOLD
The Blast Service NamedParameterType for specifying the maximum number of e-value to use.
Definition: blast_service_params.h:169
GetDatabaseParameterTypeForNamedParameter
bool GetDatabaseParameterTypeForNamedParameter(BlastServiceData *data_p, const char *param_name_s, ParameterType *pt_p)
ParameterGroup
A datatype to tell the system that certain parameters should be grouped together in the client's user...
Definition: parameter_group.h:85
GetQuerySequenceParameterTypeForNamedParameter
bool GetQuerySequenceParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
BlastTask
This datatype is used for describing the algorithms that some of the BLAST tools allow the user to ch...
Definition: blast_service_params.h:204
BS_CUSTOM_OUTPUT_FORMAT
NamedParameterType BS_CUSTOM_OUTPUT_FORMAT
The Blast Service NamedParameterType for specifying any custom output format options to use.
Definition: blast_service_params.h:185
AddAdditionalParamsFn
bool(* AddAdditionalParamsFn)(BlastServiceData *data_p, ParameterSet *param_set_p, ParameterGroup *group_p, const void *callback_data_p)
A callback function used to amend a given ParameterSet.
Definition: blast_service.h:186
AddProgramSelectionParameters
bool AddProgramSelectionParameters(BlastServiceData *blast_data_p, ParameterSet *param_set_p, const BlastTask *tasks_p, const BlastTask *default_task_p, const size_t task_mem_size, const size_t num_tasks)
Add the program selection parameters for a Blast Service.
NamedParameterType
This is a datatype that stores a read-only c-style string along with a ParameterType.
Definition: parameter.h:85
ParameterType
ParameterType
The different types that a Parameter can take.
Definition: parameter_type.h:35
BOF_PAIRWISE
Pairwise.
Definition: blast_service_params.h:46
BOF_CSV
Comma-separated values.
Definition: blast_service_params.h:76
parameter_set.h
SetUpOutputFormatParameters
Parameter * SetUpOutputFormatParameters(const char **formats_ss, const uint32 num_formats, const uint32 default_format, const BlastServiceData *service_data_p, ParameterSet *param_set_p, ParameterGroup *group_p)
Create the Parameter for specifying the output format from a Blast search.
BlastServiceData
The configuration data for the Blast Service.
Definition: blast_service.h:143
PT_STRING
A c-style string.
Definition: parameter_type.h:58
BlastTask::bt_description_s
const char * bt_description_s
A user-friendly description of the algorithm.
Definition: blast_service_params.h:215
DataResource
A datatype representing a URI.
Definition: data_resource.h:40
DatabaseType
DatabaseType
An enumeration for differentiating between the different types of database that the BLAST algorithms ...
Definition: blast_service.h:42
GetGeneralAlgorithmParameterTypeForNamedParameter
bool GetGeneralAlgorithmParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
SetUpPreviousJobUUIDParameter
Parameter * SetUpPreviousJobUUIDParameter(const BlastServiceData *service_data_p, ParameterSet *param_set_p, ParameterGroup *group_p)
Create the Parameter for specifying the UUIDs for any previous Blast searches.
BOF_QUERY_ANCHORED_NO_IDENTITIES
Query-anchored no identities.
Definition: blast_service_params.h:52
BOF_FLAT_QUERY_ANCHORED_WITH_IDENTITIES
Flat query-anchored showing identities.
Definition: blast_service_params.h:55
CreateGroupName
char * CreateGroupName(const char *server_s)
Create the group name to use for available databases from a given named Server.
BOF_SEQUENCE_ALIGNMENT
Sequence Alignment/Map (SAM)
Definition: blast_service_params.h:97
GetLocalDatabaseGroupName
char * GetLocalDatabaseGroupName(GrassrootsServer *grassroots_p)
AddDatabaseParams
uint16 AddDatabaseParams(BlastServiceData *data_p, ParameterSet *param_set_p, DataResource *resource_p, const DatabaseType db_type)
Add the database parameters for a Blast Service.
blast_service_api.h
GetProgramSelectionParameterTypeForNamedParameter
bool GetProgramSelectionParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
AddGeneralAlgorithmParams
bool AddGeneralAlgorithmParams(BlastServiceData *data_p, ParameterSet *param_set_p, AddAdditionalParamsFn callback_fn, const void *callback_data_p)
Add the common general algorithm parameters for a Blast Service.
BOF_JSON_SEQALIGN
Seqalign (JSON)
Definition: blast_service_params.h:82
BOF_BINARY_ASN1
Seqalign (Binary ASN.1)
Definition: blast_service_params.h:73
BSP_OUTPUT_FORMATS_SS
const char * BSP_OUTPUT_FORMATS_SS[BOF_NUM_TYPES]
BLAST_SERVICE_LOCAL
#define BLAST_SERVICE_LOCAL
Definition: blast_service_api.h:48
PT_UNSIGNED_REAL
An unsigned real number.
Definition: parameter_type.h:55
GetLocalDatabaseName
const char * GetLocalDatabaseName(const char *fully_qualified_db_s)
AddProteinGeneralAlgorithmParameters
bool AddProteinGeneralAlgorithmParameters(BlastServiceData *data_p, ParameterSet *param_set_p, ParameterGroup *group_p, const void *callback_data_p)
BOF_MULTI_FILE_JSON_BLAST
Multiple-file BLAST JSON.
Definition: blast_service_params.h:85
BOF_GRASSROOTS
Grassroots JSON.
Definition: blast_service_params.h:103
BOF_TABULAR_WITH_COMMENTS
Tabular with comment lines.
Definition: blast_service_params.h:67
GetNumberOfDatabases
uint32 GetNumberOfDatabases(const BlastServiceData *data_p, const DatabaseType dt)
Get the number of databases of a given type that this BlastService has.
BOF_SINGLE_FILE_JSON_BLAST
Single-file BLAST JSON.
Definition: blast_service_params.h:91
BS_TASK
NamedParameterType BS_TASK
The Blast Service NamedParameterType for specifying the algorithm-specific task to use.
Definition: blast_service_params.h:147
BOF_XML_BLAST
BLAST XML.
Definition: blast_service_params.h:61
GrassrootsServer
Definition: grassroots_server.h:45
AddQuerySequenceParams
bool AddQuerySequenceParams(BlastServiceData *data_p, ParameterSet *param_set_p, AddAdditionalParamsFn callback_fn, void *callback_data_p)
Add the common query sequence parameters for a Blast Service.
BS_OUTPUT_FORMAT
NamedParameterType BS_OUTPUT_FORMAT
The Blast Service NamedParameterType for specifying the output format to use.
Definition: blast_service_params.h:177
BOF_SINGLE_FILE_XML2_BLAST
Single-file BLAST XML2.
Definition: blast_service_params.h:94
GetProteinGeneralAlgorithmParameterTypeForNamedParameter
bool GetProteinGeneralAlgorithmParameterTypeForNamedParameter(const char *param_name_s, ParameterType *pt_p)
BOF_TEXT_ASN1
Seqalign (Text ASN.1)
Definition: blast_service_params.h:70
BS_WORD_SIZE
NamedParameterType BS_WORD_SIZE
The Blast Service NamedParameterType for specifying the word size to use.
Definition: blast_service_params.h:194
BS_MAX_SEQUENCES
NamedParameterType BS_MAX_SEQUENCES
The Blast Service NamedParameterType for specifying the maximum number of sequences to return.
Definition: blast_service_params.h:161
BOF_FLAT_QUERY_ANCHORED_NO_IDENTITIES
Flat query-anchored no identities.
Definition: blast_service_params.h:58
blast_service.h
BOF_NUM_TYPES
The number of different output formats.
Definition: blast_service_params.h:106
BOF_QUERY_ANCHORED_WITH_IDENTITIES
Query-anchored showing identities.
Definition: blast_service_params.h:49
GetOutputFormatCodeForString
int8 GetOutputFormatCodeForString(const char *output_format_s)
Get the output format code corresponding to the given string representation.
BlastTask::bt_name_s
const char * bt_name_s
The name of the algorithm that will be passed to the BlastTool using the -task parameter.
Definition: blast_service_params.h:210
BOF_BLAST_ASN1
BLAST archive (ASN.1)
Definition: blast_service_params.h:79
BlastOutputFormat
BlastOutputFormat
The different available output formats.
Definition: blast_service_params.h:43
ParameterSet
A set of Parameters along with an optional name and description.
Definition: parameter_set.h:46
BOF_TABULAR
Tabular.
Definition: blast_service_params.h:64
GetFullyQualifiedDatabaseName
char * GetFullyQualifiedDatabaseName(const char *group_s, const char *db_s)
PT_FASTA
A string representing a FASTA sequence.
Definition: parameter_type.h:105
BS_SUBRANGE_TO
NamedParameterType BS_SUBRANGE_TO
The Blast Service NamedParameterType for specifying the end of a subrange.
Definition: blast_service_params.h:139
BOF_MULTI_FILE_XML2_BLAST
Multiple-file BLAST XML2.
Definition: blast_service_params.h:88
BS_JOB_ID
NamedParameterType BS_JOB_ID
The Blast Service NamedParameterType for specifying previous job UUIDs.
Definition: blast_service_params.h:122
BS_INPUT_QUERY
NamedParameterType BS_INPUT_QUERY
The Blast Service NamedParameterType for specifying the input query.
Definition: blast_service_params.h:154
BS_SUBRANGE_FROM
NamedParameterType BS_SUBRANGE_FROM
The Blast Service NamedParameterType for specifying the start of a subrange.
Definition: blast_service_params.h:132
PT_UNSIGNED_INT
A non-negative 32-bit integer.
Definition: parameter_type.h:44