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.h File Reference
#include "blast_app_parameters.h"
#include "blast_formatter.h"
#include "blast_service_api.h"
#include "parameter_set.h"
#include "temp_file.hpp"
#include "async_tasks_manager.h"
Include dependency graph for blast_service.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  DatabaseInfo
 A datatype describing the details of each database available to search against. More...
 
struct  BlastServiceData
 The configuration data for the Blast Service. More...
 

Macros

#define BS_DEFAULT_OUTPUT_FORMAT   (11)
 The default output format as a number to use. More...
 
#define BS_GROUP_ALIAS_PREFIX_S   "blast"
 The prefix to use for Blast Service aliases. More...
 

Typedefs

typedef 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. More...
 

Enumerations

enum  DatabaseType { DT_NUCLEOTIDE, DT_PROTEIN, DT_NUM_TYPES }
 An enumeration for differentiating between the different types of database that the BLAST algorithms can be used with. More...
 
enum  BlastServiceType { BST_BLASTN, BST_BLASTP, BST_BLASTX, BST_NUM_TYPES }
 An enumeration for differentiating between the differentBLAST algorithms that can be used. More...
 

Functions

ServicesArrayGetServices (User *user_p, GrassrootsServer *grassroots_p)
 Get the Services available for running BLAST jobs. More...
 
void ReleaseServices (ServicesArray *services_p)
 Free the ServicesArray and its associated BLAST Services. More...
 
ServiceJobSetRunBlastService (Service *service_p, ParameterSet *param_set_p, User *user_p, ProvidersStateTable *providers_p, BlastAppParameters *app_params_p)
 Run a Blast Service. More...
 
bool CloseBlastService (Service *service_p)
 Close a Blast Service. More...
 
ParameterSetIsResourceForBlastService (Service *service_p, DataResource *resource_p, Handler *handler_p)
 Check whether a given Resource is suitable for running a Blast Service for and if so return the partially-completed ParameterSet. More...
 
bool AddBaseBlastServiceParameters (Service *blast_service_p, ParameterSet *param_set_p, DataResource *resource_p, const DatabaseType db_type, AddAdditionalParamsFn query_sequence_callback_fn, void *callback_data_p)
 Add the common Blast Service parameters to a given ParameterSet. More...
 
bool GetBaseBlastServiceParameterTypeForNamedParameter (const Service *service_p, const char *param_name_s, ParameterType *pt_p)
 
void ReleaseBlastServiceParameters (Service *service_p, ParameterSet *params_p)
 Free a ParameterSet of Blast Service parameters. More...
 
bool DetermineBlastResult (struct BlastServiceJob *job_p)
 Get the results of a given BlastServiceJob and store them within it. More...
 
OperationStatus GetBlastServiceStatus (Service *service_p, const uuid_t service_id)
 Get the OperationStatus for a BlastServiceJob with the given job id. More...
 
TempFileGetInputTempFile (const ParameterSet *params_p, const char *working_directory_s, const uuid_t job_id)
 Get the TempFile detailing the query for a given BlastServiceJob UUID. More...
 
char * GetBlastResultByUUID (const BlastServiceData *data_p, const uuid_t job_id, const uint32 output_format_code, const char *output_format_params_s)
 Get the result of a previously ran BlastServiceJob in a given output format. More...
 
char * GetBlastResultByUUIDString (const BlastServiceData *data_p, const char *job_id_s, const uint32 output_format_code, const char *output_format_params_s)
 Get the result of a previously ran BlastServiceJob in a given output format. More...
 
ServiceJobSetGetPreviousJobResults (LinkedList *ids_p, BlastServiceData *blast_data_p, const uint32 output_format_code, const char *output_format_params_s)
 Get the results of previously ran BlastServiceJobs in a given output format. More...
 
ServiceJobSetCreateJobsForPreviousResults (ParameterSet *params_p, const char *ids_s, BlastServiceData *blast_data_p)
 Get the results of previously ran BlastServiceJobs in a given output format. More...
 
void PrepareBlastServiceJobs (const DatabaseInfo *db_p, const ParameterSet *const param_set_p, Service *service_p, BlastServiceData *data_p)
 Prepare a ServiceJobSet of BlastServiceJobs prior to running them. More...
 
ServiceJobBuildBlastServiceJob (struct Service *service_p, const json_t *service_job_json_p)
 Create a BlastServiceJob from a JSON-based serialisation. More...
 
json_t * BuildBlastServiceJobJSON (Service *service_p, ServiceJob *service_job_p, bool omit_results_flag)
 Get the JSON representation of a BlastServiceJob. More...
 
const char * GetMatchingDatabaseFilename (const BlastServiceData *data_p, const char *name_s)
 For a given service-configured name, find the corresponding BLAST database filename. More...
 
const char * GetMatchingDatabaseName (const BlastServiceData *data_p, const char *filename_s)
 For a given BLAST database filename, find the corresponding service-configured name. More...
 
ServiceMetadataGetGeneralBlastServiceMetadata (Service *service_p)
 
const DatabaseInfoGetMatchingDatabaseByFilename (const BlastServiceData *data_p, const char *filename_s)
 For a given BLAST database filename, find the corresponding DatabaseInfo object. More...
 
void ReleaseBlastService (Service *service_p)
 
json_t * GetBlastIndexingData (Service *service_p)
 

Variables

const char * BS_INPUT_SUFFIX_S = ".input"
 The suffix to use for Blast Service input files. More...
 
const char * BS_OUTPUT_SUFFIX_S = ".output"
 The suffix to use for Blast Service output files. More...
 
const char * BS_LOG_SUFFIX_S = ".log"
 The suffix to use for Blast Service log files. More...
 
const char * BS_DEFAULT_OUTPUT_FORMAT_S = "11"
 The default output format as a string to use. More...
 
const char * BS_DATABASE_GROUP_NAME_S = "Available Databases"
 The prefix to use for the ParameterGroup names for available databases from all of the connected servers. More...
 
const char * BS_DATABASES_S = "databases"
 
const char * BS_TOOL_TYPE_NAME_S = "blast_tool"
 The configuration key used to declare which type of BlastTool to use. More...
 
const char * BS_COMMAND_NAME_S = "blast_command"
 The configuration key used to declare the Blast executable file to use. More...
 
const char * BS_APP_NAME_S = "blast_app_type"
 The configuration key used to declare the type of Blast application to use. More...
 

Macro Definition Documentation

◆ BS_DEFAULT_OUTPUT_FORMAT

#define BS_DEFAULT_OUTPUT_FORMAT   (11)

The default output format as a number to use.

See also
BS_DEFAULT_OUTPUT_FORMAT_S

◆ BS_GROUP_ALIAS_PREFIX_S

#define BS_GROUP_ALIAS_PREFIX_S   "blast"

The prefix to use for Blast Service aliases.

Typedef Documentation

◆ AddAdditionalParamsFn

typedef 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.

Parameters
data_pThe configuration data for the Blast Service.
param_set_pThe ParameterSet that the callback function's Parameters will be added to.
group_pThe optional ParameterGroup to add the generated Parameter to. This can be NULL.
Returns
true if the callback function's parameters were added successfully, false otherwise.

Function Documentation

◆ GetBaseBlastServiceParameterTypeForNamedParameter()

bool GetBaseBlastServiceParameterTypeForNamedParameter ( const Service service_p,
const char *  param_name_s,
ParameterType pt_p 
)

◆ GetGeneralBlastServiceMetadata()

ServiceMetadata* GetGeneralBlastServiceMetadata ( Service service_p)

◆ ReleaseBlastService()

void ReleaseBlastService ( Service service_p)

◆ GetBlastIndexingData()

json_t* GetBlastIndexingData ( Service service_p)

Variable Documentation

◆ BS_INPUT_SUFFIX_S

const char* BS_INPUT_SUFFIX_S = ".input"

The suffix to use for Blast Service input files.

◆ BS_OUTPUT_SUFFIX_S

const char* BS_OUTPUT_SUFFIX_S = ".output"

The suffix to use for Blast Service output files.

◆ BS_LOG_SUFFIX_S

const char* BS_LOG_SUFFIX_S = ".log"

The suffix to use for Blast Service log files.

◆ BS_DEFAULT_OUTPUT_FORMAT_S

const char* BS_DEFAULT_OUTPUT_FORMAT_S = "11"

The default output format as a string to use.

See also
BS_DEFAULT_OUTPUT_FORMAT

◆ BS_DATABASE_GROUP_NAME_S

const char* BS_DATABASE_GROUP_NAME_S = "Available Databases"

The prefix to use for the ParameterGroup names for available databases from all of the connected servers.

◆ BS_DATABASES_S

const char* BS_DATABASES_S = "databases"

◆ BS_TOOL_TYPE_NAME_S

const char* BS_TOOL_TYPE_NAME_S = "blast_tool"

The configuration key used to declare which type of BlastTool to use.

◆ BS_COMMAND_NAME_S

const char* BS_COMMAND_NAME_S = "blast_command"

The configuration key used to declare the Blast executable file to use.

◆ BS_APP_NAME_S

const char* BS_APP_NAME_S = "blast_app_type"

The configuration key used to declare the type of Blast application to use.