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.
The BLAST Services Module

Services for the BLAST suite of tools. More...

Data Structures

class  ArgsProcessor
 An ArgsProcessor is a class to abstract out how a particular BlastTool stores a value when an argument is passed to it. More...
 
class  AsyncSystemBlastTool
 A class that will run Blast as an asynchronous system process. More...
 
struct  BlastAppParameters
 This datatype is used to parse a given ParameterSet in a method suitable for a particular BLAST configuration. More...
 
class  BlastFormatter
 This class is for converting the output of a blast job between the available different formats. More...
 
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...
 
struct  BlastServiceJob
 This datatype stores the ServiceJob and its associated BlastTool. More...
 
struct  BlastTask
 This datatype is used for describing the algorithms that some of the BLAST tools allow the user to choose to optimise the search procedure. More...
 
class  BlastTool
 The base class for running Blast. More...
 
class  BlastToolFactory
 The base class for generating blast tools. More...
 
class  ByteBufferArgsProcessor
 An ArgsProcessor that adds all of its values to a given ByteBuffer. More...
 
class  DrmaaBlastTool
 A class that will run Blast as a drmaa process. More...
 
class  DrmaaBlastToolFactory
 The base class for generating DrmaaBlastTools. More...
 
class  DrmaaToolArgsProcessor
 An ArgsProcessor that adds all of its values to a given DrmaaTool. More...
 
class  ExternalBlastTool
 A class that will run Blast using an external application such as blastn rather than calling Blast library routines directly. More...
 
class  ExternalBlastToolFactory
 The base class for running blast tools as a separate process. More...
 
class  StringsArgsProcessor
 An ArgsProcessor that adds all of its values to an array of strings. More...
 
class  SystemBlastTool
 A class that will run Blast as a system process. More...
 
class  SystemBlastToolFactory
 The base class for generating system blast tools. More...
 
class  ThreadedBlastTool
 A class that will run Blast within a pthread. 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...
 
enum  BlastOutputFormat {
  BOF_PAIRWISE, BOF_QUERY_ANCHORED_WITH_IDENTITIES, BOF_QUERY_ANCHORED_NO_IDENTITIES, BOF_FLAT_QUERY_ANCHORED_WITH_IDENTITIES,
  BOF_FLAT_QUERY_ANCHORED_NO_IDENTITIES, BOF_XML_BLAST, BOF_TABULAR, BOF_TABULAR_WITH_COMMENTS,
  BOF_TEXT_ASN1, BOF_BINARY_ASN1, BOF_CSV, BOF_BLAST_ASN1,
  BOF_JSON_SEQALIGN, BOF_MULTI_FILE_JSON_BLAST, BOF_MULTI_FILE_XML2_BLAST, BOF_SINGLE_FILE_JSON_BLAST,
  BOF_SINGLE_FILE_XML2_BLAST, BOF_SEQUENCE_ALIGNMENT, BOF_ORGANISM_REPORT, BOF_GRASSROOTS,
  BOF_NUM_TYPES
}
 The different available output formats. 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...
 
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...
 
const DatabaseInfoGetMatchingDatabaseByFilename (const BlastServiceData *data_p, const char *filename_s)
 For a given BLAST database filename, find the corresponding DatabaseInfo object. More...
 
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. More...
 
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. More...
 
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. More...
 
uint16 AddDatabaseParams (BlastServiceData *data_p, ParameterSet *param_set_p, DataResource *resource_p, const DatabaseType db_type)
 Add the database parameters for a Blast Service. More...
 
uint32 GetNumberOfDatabases (const BlastServiceData *data_p, const DatabaseType dt)
 Get the number of databases of a given type that this BlastService has. More...
 
ParameterSetUpPreviousJobUUIDParameter (const BlastServiceData *service_data_p, ParameterSet *param_set_p, ParameterGroup *group_p)
 Create the Parameter for specifying the UUIDs for any previous Blast searches. More...
 
ParameterSetUpOutputFormatParameters (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. More...
 
char * CreateGroupName (const char *server_s)
 Create the group name to use for available databases from a given named Server. More...
 
int8 GetOutputFormatCodeForString (const char *output_format_s)
 Get the output format code corresponding to the given string representation. More...
 
ServiceGetBlastNService (GrassrootsServer *grassroots_p)
 Get a Service capable of running BlastN searches. More...
 
ServiceGetBlastPService (GrassrootsServer *grassroots_p)
 Get a Service capable of running BlastP searches. More...
 
ServiceGetBlastXService (GrassrootsServer *grassroots_p)
 Get a Service capable of running BlastX searches. More...
 
ServiceGetMagicBlastService (GrassrootsServer *grassroots_p)
 Get a Service capable of running Magic-Blast searches. More...
 
bool AddPairedServiceParameters (Service *service_p, ParameterSet *internal_params_p)
 Add the parameters for all PairedServices of a given Service to given ParameterSet. More...
 
char * GetPreviousRemoteBlastServiceJob (const char *local_job_id_s, const uint32 output_format_code, const BlastServiceData *blast_data_p)
 Try to get the results of a previously run BlastServiceJob on a remote server. More...
 
bool SaveRemoteBlastJobDetails (RemoteServiceJob *job_p, const ServiceData *blast_data_p)
 Save the results of a RemoteServiceJob to a local file for ease of access. More...
 
bool GetBlastServiceConfig (BlastServiceData *data_p)
 Check whether the required configuration details contain the required information for a Blast Service to be used. More...
 
bool GetAndAddBlastArgs (const ParameterSet *param_set_p, const char *param_name_s, bool required_flag, ArgsProcessor *ap_p)
 Get the named Parameter from a ParameterSet and add it to an ArgsProcessor. More...
 
bool AddBlastArgs (const Parameter *param_p, ArgsProcessor *ap_p)
 Add an argument derived from the current value of a Parameter to an ArgsProcessor. More...
 
bool AddArgsPair (const char *key_s, const char *value_s, ArgsProcessor *ap_p)
 Add a pair of arguments to the command line arguments stored in a ByteBuffer. More...
 
bool AddArgsPairFromIntegerParameter (const ParameterSet *params_p, const char *const param_name_s, const char *key_s, ArgsProcessor *ap_p, const bool unsigned_flag, const bool required_flag)
 Get the value of an integer-based Parameter and add it as key-value pair to the command line arguments accessed by an ArgsProcessor. More...
 
bool AddArgsPairFromStringParameter (const ParameterSet *params_p, const char *const param_name_s, const char *key_s, ArgsProcessor *ap_p, const bool required_flag)
 Get the value of an string-based Parameter and add it as key-value pair to the command line arguments accessed by an ArgsProcessor. More...
 

Variables

NamedParameterType BS_JOB_ID { .npt_name_s = "job_id" , .npt_type = PT_STRING }
 The Blast Service NamedParameterType for specifying previous job UUIDs. More...
 
NamedParameterType BS_SUBRANGE_FROM { .npt_name_s = "subrange_from" , .npt_type = PT_UNSIGNED_INT }
 The Blast Service NamedParameterType for specifying the start of a subrange. More...
 
NamedParameterType BS_SUBRANGE_TO { .npt_name_s = "subrange_to" , .npt_type = PT_UNSIGNED_INT }
 The Blast Service NamedParameterType for specifying the end of a subrange. More...
 
NamedParameterType BS_TASK { .npt_name_s = "task" , .npt_type = PT_STRING }
 The Blast Service NamedParameterType for specifying the algorithm-specific task to use. More...
 
NamedParameterType BS_INPUT_QUERY { .npt_name_s = "query" , .npt_type = PT_FASTA }
 The Blast Service NamedParameterType for specifying the input query. More...
 
NamedParameterType BS_MAX_SEQUENCES { .npt_name_s = "max_target_seqs" , .npt_type = PT_UNSIGNED_INT }
 The Blast Service NamedParameterType for specifying the maximum number of sequences to return. More...
 
NamedParameterType BS_EXPECT_THRESHOLD { .npt_name_s = "evalue" , .npt_type = PT_UNSIGNED_REAL }
 The Blast Service NamedParameterType for specifying the maximum number of e-value to use. More...
 
NamedParameterType BS_OUTPUT_FORMAT { .npt_name_s = "outfmt" , .npt_type = PT_UNSIGNED_INT }
 The Blast Service NamedParameterType for specifying the output format to use. More...
 
NamedParameterType BS_CUSTOM_OUTPUT_FORMAT { .npt_name_s = "custom_outfmt" , .npt_type = PT_STRING }
 The Blast Service NamedParameterType for specifying any custom output format options to use. More...
 
NamedParameterType BS_WORD_SIZE { .npt_name_s = "word_size" , .npt_type = PT_UNSIGNED_INT }
 The Blast Service NamedParameterType for specifying the word size to use. More...
 

Detailed Description

Services for the BLAST suite of tools.

This Module performs BLAST searches on both nucleotide and protein databases. It currently offers the functionality given by blastn, blastp and blastx. The BLAST jobs can be run locally or also on a computing cluster using DRMAA. General information can be found in the blast_services_guide documentation.

Enumeration Type Documentation

◆ DatabaseType

An enumeration for differentiating between the different types of database that the BLAST algorithms can be used with.

Enumerator
DT_NUCLEOTIDE 

The database is a nucleotide sequence.

DT_PROTEIN 

The database is a protein sequence.

DT_NUM_TYPES 

The number of different database types.

◆ BlastServiceType

An enumeration for differentiating between the differentBLAST algorithms that can be used.

Enumerator
BST_BLASTN 

A search using the BlastN program.

BST_BLASTP 

A search using the BlastP program.

BST_BLASTX 

A search using the BlastX program.

BST_NUM_TYPES 

The number of different Blast service types.

◆ BlastOutputFormat

The different available output formats.

Enumerator
BOF_PAIRWISE 

Pairwise.

BOF_QUERY_ANCHORED_WITH_IDENTITIES 

Query-anchored showing identities.

BOF_QUERY_ANCHORED_NO_IDENTITIES 

Query-anchored no identities.

BOF_FLAT_QUERY_ANCHORED_WITH_IDENTITIES 

Flat query-anchored showing identities.

BOF_FLAT_QUERY_ANCHORED_NO_IDENTITIES 

Flat query-anchored no identities.

BOF_XML_BLAST 

BLAST XML.

BOF_TABULAR 

Tabular.

BOF_TABULAR_WITH_COMMENTS 

Tabular with comment lines.

BOF_TEXT_ASN1 

Seqalign (Text ASN.1)

BOF_BINARY_ASN1 

Seqalign (Binary ASN.1)

BOF_CSV 

Comma-separated values.

BOF_BLAST_ASN1 

BLAST archive (ASN.1)

BOF_JSON_SEQALIGN 

Seqalign (JSON)

BOF_MULTI_FILE_JSON_BLAST 

Multiple-file BLAST JSON.

BOF_MULTI_FILE_XML2_BLAST 

Multiple-file BLAST XML2.

BOF_SINGLE_FILE_JSON_BLAST 

Single-file BLAST JSON.

BOF_SINGLE_FILE_XML2_BLAST 

Single-file BLAST XML2.

BOF_SEQUENCE_ALIGNMENT 

Sequence Alignment/Map (SAM)

BOF_ORGANISM_REPORT 

Organism Report.

BOF_GRASSROOTS 

Grassroots JSON.

BOF_NUM_TYPES 

The number of different output formats.

Function Documentation

◆ GetServices()

ServicesArray* GetServices ( User user_p,
GrassrootsServer grassroots_p 
)

Get the Services available for running BLAST jobs.

Parameters
user_pThe details for the user accessing the BLAST Services.
Returns
The ServicesArray containing all of the BLAST Services or NULL upon error.

◆ ReleaseServices()

void ReleaseServices ( ServicesArray services_p)

Free the ServicesArray and its associated BLAST Services.

Parameters
services_pThe ServicesArray to free.

◆ RunBlastService()

ServiceJobSet* RunBlastService ( Service service_p,
ParameterSet param_set_p,
User user_p,
ProvidersStateTable providers_p,
BlastAppParameters app_params_p 
)

Run a Blast Service.

Parameters
service_pThe Blast Service to run.
param_set_pThe ParameterSet specifying the Parameters to use.
user_pThe User of the user requesting to run the Service.
providers_pThe details of ExternalServers for any paired or external Blast Services.
app_params_pThe parser used for the current type of BlastTool.
Returns
The ServiceJobSet with the BlastServiceJobs or NULL upon error.

◆ CloseBlastService()

bool CloseBlastService ( Service service_p)

Close a Blast Service.

Parameters
service_pThe Blast Service to close.
Returns
true if the Blast Service was closed successfully, false otherwise.

◆ IsResourceForBlastService()

ParameterSet* IsResourceForBlastService ( 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.

Parameters
service_pThe Blast Service to check.
resource_pThe given Resource to check for.
handler_pThe appropriate Handler for accessing the given Resource.
Returns
The partially-completed ParameterSet if the Resource is an appropriate one or NULL if it is not valid for running a Blast search against.

◆ AddBaseBlastServiceParameters()

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.

Parameters
blast_service_pThe Blast Service to add the Parameters for.
param_set_pThe ParameterSet to add the common Parameters to.
resource_pAny data passed by the user's request.
db_typeThe type of databases that the given Blast Service will run against.
add_additional_params_fnIf a Blast Service wishes to add additional parameters this optional callback function can be used.
Returns
true if the Parameters were added successfully, false otherwise.

◆ ReleaseBlastServiceParameters()

void ReleaseBlastServiceParameters ( Service service_p,
ParameterSet params_p 
)

Free a ParameterSet of Blast Service parameters.

Parameters
service_pThe BlastService of the same type that allocated the given ParameterSet.
params_pThe ParameterSet to free.

◆ DetermineBlastResult()

bool DetermineBlastResult ( struct BlastServiceJob job_p)

Get the results of a given BlastServiceJob and store them within it.

Parameters
job_pThe BlastServiceJob to get the results for.
Returns
true if the results were added successfully, false otherwise.

◆ GetBlastServiceStatus()

OperationStatus GetBlastServiceStatus ( Service service_p,
const uuid_t  service_id 
)

Get the OperationStatus for a BlastServiceJob with the given job id.

Parameters
service_pThe Blast Service of the type which ran the BlastServiceJob.
service_idThe UUID for the given BlastServiceJob.
Returns
The OperationStatus for the given BlastServiceJob.

◆ GetInputTempFile()

TempFile* GetInputTempFile ( 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.

Parameters
params_pThe ParameterSet used to run the ServiceJob.
working_directory_sThe working directory specified in the Blast Service configuration.
job_idThe UUID of the BlastServiceJob to check.
Returns
A newly-allocated TempFile with the relevant values or NULL upon error.

◆ GetBlastResultByUUID()

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.

Parameters
data_pThe BlastServiceData of the Blast Service that ran the job.
job_idThe ServiceJob identifier to get the results for.
output_format_codeThe required output format code.
Returns
A newly-allocated string containing the results in the requested format or NULL upon error.
See also
GetBlastResultByUUIDString

◆ GetBlastResultByUUIDString()

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.

Parameters
data_pThe BlastServiceData of the Blast Service that ran the job.
job_id_sThe ServiceJob identifier, as a string, to get the results for.
output_format_codeThe required output format code.
Returns
A newly-allocated string containing the results in the requested format or NULL upon error.
See also
GetBlastResultByUUID

◆ GetPreviousJobResults()

ServiceJobSet* GetPreviousJobResults ( 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.

Parameters
ids_pA LinkedList of StringListNodes each containing the UUIDs for the required ServiceJobs.
blast_data_pThe BlastServiceData of the Blast Service that ran the job.
output_format_codeThe required output format code.
Returns
A newly-allocated ServiceJobSet containing the results in the requested format or NULL upon error.
See also
GetBlastResultByUUIDString
CreateJobsForPreviousResults

◆ CreateJobsForPreviousResults()

ServiceJobSet* CreateJobsForPreviousResults ( ParameterSet params_p,
const char *  ids_s,
BlastServiceData blast_data_p 
)

Get the results of previously ran BlastServiceJobs in a given output format.

Parameters
params_pThe ParameterSet to get the output format from.
ids_sA string containing UUIDs separated by whitespace.
blast_data_pThe Blast Service configuration data.
Returns
The ServiceJobSet containing the results in the requested output format or NULL upon error.
See also
GetPreviousJobResults

◆ PrepareBlastServiceJobs()

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.

Parameters
db_pThe list of available databases terminated by NULL.
param_set_pThe ParameterSet for specifying the configuration of the BlastServiceJobs.
service_pThe BlastService.
data_pThe Blast Service configuration data.

◆ BuildBlastServiceJob()

ServiceJob* BuildBlastServiceJob ( struct Service service_p,
const json_t *  service_job_json_p 
)

Create a BlastServiceJob from a JSON-based serialisation.

Parameters
service_pThe type of Blast Service that previously created the BlastServiceJob.
service_job_json_pThe JSON fragment representing the BlastServiceJob.
Returns
The BlastServiceJob or NULL upon error.

◆ BuildBlastServiceJobJSON()

json_t* BuildBlastServiceJobJSON ( Service service_p,
ServiceJob service_job_p,
bool  omit_results_flag 
)

Get the JSON representation of a BlastServiceJob.

Parameters
service_pThe Service that ran the BlastServiceJob.
service_job_pThe BlastServiceJob to serialise.
omit_results_flagIf this is true then just the minimal status information for the ServiceJob will be returned. If it is false then the job results will be included too if possible.
Returns
The JSON fragment representing the BlastServiceJob or NULL upon error.

◆ GetMatchingDatabaseFilename()

const char* GetMatchingDatabaseFilename ( const BlastServiceData data_p,
const char *  name_s 
)

For a given service-configured name, find the corresponding BLAST database filename.

Parameters
data_pThe BlastServiceData with the service configuration details.
name_sThe service-configured name.
Returns
The corresponding BLAST database filename or NULL if it could not be found.

◆ GetMatchingDatabaseName()

const char* GetMatchingDatabaseName ( const BlastServiceData data_p,
const char *  filename_s 
)

For a given BLAST database filename, find the corresponding service-configured name.

Parameters
data_pThe BlastServiceData with the service configuration details.
filename_sThe BLAST database filename.
Returns
The corresponding service-configured name or NULL if it could not be found.

◆ GetMatchingDatabaseByFilename()

const DatabaseInfo* GetMatchingDatabaseByFilename ( const BlastServiceData data_p,
const char *  filename_s 
)

For a given BLAST database filename, find the corresponding DatabaseInfo object.

Parameters
data_pThe BlastServiceData with the service configuration details.
filename_sThe BLAST database filename.
Returns
The corresponding DatabaseInfo object or NULL if it could not be found.

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

Parameters
data_pThe configuration data for the Blast Service.
param_set_pThe ParameterSet that the query sequence parameters will be added to.
callback_fnIf the Blast Service wants to add extra Parameters to the query sequence group of Parameters, it can do so via this callback_fn. This can be NULL
Returns
true if the query sequence parameters were added successfully, false otherwise.

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

Parameters
data_pThe configuration data for the Blast Service.
param_set_pThe ParameterSet that the general algorithm parameters will be added to.
callback_fnIf the Blast Service wants to add extra Parameters to the general algorithm group of Parameters, it can do so via this callback_fn. This can be NULL
Returns
true if the general algorithm parameters were added successfully, false otherwise.

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

Parameters
blast_data_pThe configuration data for the Blast Service.
param_set_pThe ParameterSet that the general algorithm parameters will be added to.
tasks_pAn optional array of BlastTasks that be can be chosen to alter the search.
num_tasksThe number of BlastTasks in the array pointed to by tasks_p.
Returns
true if the general algorithm parameters were added successfully, false otherwise.

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

Parameters
data_pThe configuration data for the Blast Service.
param_set_pThe ParameterSet that the general algorithm parameters will be added to.
resource_pThe Resource detailing any data sent by the user's request.
db_typeThe type of databases to add.
Returns
The number of database parameters added.

◆ GetNumberOfDatabases()

uint32 GetNumberOfDatabases ( const BlastServiceData data_p,
const DatabaseType  dt 
)

Get the number of databases of a given type that this BlastService has.

Parameters
data_pThe configuration data for the BlastService to check.
dtThe type of database to check.
Returns
The number of available databases of the given type.

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

Parameters
service_data_pThe configuration data for the Blast Service.
param_set_pThe ParameterSet that the UUID Parameter will be added to.
group_pThe optional ParameterGroup to add the generated Parameter to. This can be NULL.
Returns
The UUID Parameter or NULL upon error.

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

Parameters
service_data_pThe configuration data for the Blast Service.
param_set_pThe ParameterSet that the output format Parameter will be added to.
group_pThe optional ParameterGroup to add the generated Parameter to. This can be NULL.
Returns
The output format Parameter or NULL upon error.

◆ CreateGroupName()

char* CreateGroupName ( const char *  server_s)

Create the group name to use for available databases from a given named Server.

Parameters
server_sThe name of the Server.
Returns
The newly-allocated group name that will need to be freed with FreeCopiedString to avoid a memory leak or NULL upon error.

◆ GetOutputFormatCodeForString()

int8 GetOutputFormatCodeForString ( const char *  output_format_s)

Get the output format code corresponding to the given string representation.

Parameters
output_format_sThe output format string.
Returns
Upon success the BlastOutputFormat cast to an int8. -1 if the string did not represent a valid output format string.

◆ GetBlastNService()

Service* GetBlastNService ( GrassrootsServer grassroots_p)

Get a Service capable of running BlastN searches.

Returns
The BlastN Service or NULL upon error.

◆ GetBlastPService()

Service* GetBlastPService ( GrassrootsServer grassroots_p)

Get a Service capable of running BlastP searches.

Returns
The BlastP Service or NULL upon error.

◆ GetBlastXService()

Service* GetBlastXService ( GrassrootsServer grassroots_p)

Get a Service capable of running BlastX searches.

Returns
The BlastX Service or NULL upon error.

◆ GetMagicBlastService()

Service* GetMagicBlastService ( GrassrootsServer grassroots_p)

Get a Service capable of running Magic-Blast searches.

Returns
The Magic-Blast Service or NULL upon error.

◆ AddPairedServiceParameters()

bool AddPairedServiceParameters ( Service service_p,
ParameterSet internal_params_p 
)

Add the parameters for all PairedServices of a given Service to given ParameterSet.

Parameters
service_pThe Blast Service whose PairedService Parameters will be added.
internal_params_pThe ParameterSet to add the PairedService Parameters to.
Returns
true if the PairedServices were added successfully, false otherwise.

◆ GetPreviousRemoteBlastServiceJob()

char* GetPreviousRemoteBlastServiceJob ( const char *  local_job_id_s,
const uint32  output_format_code,
const BlastServiceData blast_data_p 
)

Try to get the results of a previously run BlastServiceJob on a remote server.

Parameters
local_job_id_sThe uuid as a c-style string on the local Server.
output_format_codeThe output format to convert the result to.
blast_data_pThe configuration data for the local BlastService.
Returns
The previous result or NULL upon error.

◆ SaveRemoteBlastJobDetails()

bool SaveRemoteBlastJobDetails ( RemoteServiceJob job_p,
const ServiceData blast_data_p 
)

Save the results of a RemoteServiceJob to a local file for ease of access.

Parameters
job_pThe RemoteServiceJob whose results will be saved.
blast_data_pThe Service configuration data.
Returns
true if the results were saved successfully, false otherwise.

◆ GetBlastServiceConfig()

bool GetBlastServiceConfig ( BlastServiceData data_p)

Check whether the required configuration details contain the required information for a Blast Service to be used.

Parameters
data_pThe BlastServcieData to check.
Returns
true if the configuration details are sufficient, false otherwise.

◆ GetAndAddBlastArgs()

bool GetAndAddBlastArgs ( const ParameterSet param_set_p,
const char *  param_name_s,
bool  required_flag,
ArgsProcessor ap_p 
)

Get the named Parameter from a ParameterSet and add it to an ArgsProcessor.

Parameters
param_set_pThe ParameterSet to search for the named Parameter in.
param_name_sThe name of the Parameter to search for.
required_flagtrue if the parameter refers to a required variable, false if it is optional.
ap_pThe ArgsProcessor to use.
Returns
true if the value was successfully added to the ArgsProcessor or if the value could not be found and the required_flag was false. false otherwise.

◆ AddBlastArgs()

bool AddBlastArgs ( const Parameter param_p,
ArgsProcessor ap_p 
)

Add an argument derived from the current value of a Parameter to an ArgsProcessor.

This will use the datatype of the current value (e.g. string, integer, etc.) when deciding how to add it to the ArgsProcessor

Parameters
param_pThe Parameter to get the current value from.
ap_pThe ArgsProcessor to use.
Returns
true if the value was successfully added to the ArgsProcessor, false otherwise.

◆ AddArgsPair()

bool AddArgsPair ( const char *  key_s,
const char *  value_s,
ArgsProcessor ap_p 
)

Add a pair of arguments to the command line arguments stored in a ByteBuffer.

Parameters
ap_pThe ArgsProcessor to use to store the argument.
key_sThe first argument to add.
value_sThe second argument to add.
Returns
true if the arguments were added successfully, false otherwise.

◆ AddArgsPairFromIntegerParameter()

bool AddArgsPairFromIntegerParameter ( const ParameterSet params_p,
const char *const  param_name_s,
const char *  key_s,
ArgsProcessor ap_p,
const bool  unsigned_flag,
const bool  required_flag 
)

Get the value of an integer-based Parameter and add it as key-value pair to the command line arguments accessed by an ArgsProcessor.

Parameters
params_pThe ParameterSet to get the Parameter from.
param_name_sThe name of the desired Parameter.
key_sThe key to use when creating the command line arguments.
ap_pThe ArgsProcessor to use to store the argument.
unsigned_flagIs the parameter value unsigned or not?
required_flagIf this is true then failure to find the Parameter will cause this function to return false. If the value is optional, then set this to false.
Returns
true if the arguments were added successfully, false otherwise.

◆ AddArgsPairFromStringParameter()

bool AddArgsPairFromStringParameter ( const ParameterSet params_p,
const char *const  param_name_s,
const char *  key_s,
ArgsProcessor ap_p,
const bool  required_flag 
)

Get the value of an string-based Parameter and add it as key-value pair to the command line arguments accessed by an ArgsProcessor.

Parameters
params_pThe ParameterSet to get the Parameter from.
param_name_sThe name of the desired Parameter.
key_sThe key to use when creating the command line arguments.
ap_pThe ArgsProcessor to use to store the argument.
required_flagIf this is true then failure to find the Parameter will cause this function to return false. If the value is optional, then set this to false.
Returns
true if the arguments were added successfully, false otherwise.

Variable Documentation

◆ BS_JOB_ID

NamedParameterType BS_JOB_ID { .npt_name_s = "job_id" , .npt_type = PT_STRING }

The Blast Service NamedParameterType for specifying previous job UUIDs.

◆ BS_SUBRANGE_FROM

NamedParameterType BS_SUBRANGE_FROM { .npt_name_s = "subrange_from" , .npt_type = PT_UNSIGNED_INT }

The Blast Service NamedParameterType for specifying the start of a subrange.

◆ BS_SUBRANGE_TO

NamedParameterType BS_SUBRANGE_TO { .npt_name_s = "subrange_to" , .npt_type = PT_UNSIGNED_INT }

The Blast Service NamedParameterType for specifying the end of a subrange.

◆ BS_TASK

NamedParameterType BS_TASK { .npt_name_s = "task" , .npt_type = PT_STRING }

The Blast Service NamedParameterType for specifying the algorithm-specific task to use.

◆ BS_INPUT_QUERY

NamedParameterType BS_INPUT_QUERY { .npt_name_s = "query" , .npt_type = PT_FASTA }

The Blast Service NamedParameterType for specifying the input query.

◆ BS_MAX_SEQUENCES

NamedParameterType BS_MAX_SEQUENCES { .npt_name_s = "max_target_seqs" , .npt_type = PT_UNSIGNED_INT }

The Blast Service NamedParameterType for specifying the maximum number of sequences to return.

◆ BS_EXPECT_THRESHOLD

NamedParameterType BS_EXPECT_THRESHOLD { .npt_name_s = "evalue" , .npt_type = PT_UNSIGNED_REAL }

The Blast Service NamedParameterType for specifying the maximum number of e-value to use.

◆ BS_OUTPUT_FORMAT

NamedParameterType BS_OUTPUT_FORMAT { .npt_name_s = "outfmt" , .npt_type = PT_UNSIGNED_INT }

The Blast Service NamedParameterType for specifying the output format to use.

See also
BlastOutputFormat

◆ BS_CUSTOM_OUTPUT_FORMAT

NamedParameterType BS_CUSTOM_OUTPUT_FORMAT { .npt_name_s = "custom_outfmt" , .npt_type = PT_STRING }

The Blast Service NamedParameterType for specifying any custom output format options to use.

See also
BlastOutputFormat

◆ BS_WORD_SIZE

NamedParameterType BS_WORD_SIZE { .npt_name_s = "word_size" , .npt_type = PT_UNSIGNED_INT }

The Blast Service NamedParameterType for specifying the word size to use.

See also
BlastOutputFormat