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.
|
A class that will run Blast using an external application such as blastn rather than calling Blast library routines directly. More...
#include <external_blast_tool.hpp>
Public Member Functions | |
ExternalBlastTool (BlastServiceJob *job_p, const char *name_s, const char *factory_s, const BlastServiceData *data_p, const char *blast_program_name_s, const bool async_flag) | |
Create a ExternalBlastTool for a given ServiceJob. More... | |
ExternalBlastTool (BlastServiceJob *job_p, const BlastServiceData *data_p, const json_t *json_p) | |
Create a ExternalBlastTool for a given ServiceJob using the configuration details from a serialised JSON fragment. More... | |
virtual | ~ExternalBlastTool () |
The ExternalBlastTool destructor. More... | |
virtual bool | ParseParameters (ParameterSet *param_set_p, BlastAppParameters *app_params_p) |
Parse a ParameterSet to configure a ExternalBlastTool prior to it being ran. More... | |
virtual bool | SetInputFilename (const char *const filename_s) |
Set the input filename for the BlastTool to use. More... | |
virtual bool | SetUpOutputFile () |
Set the output file parameter. More... | |
virtual char * | GetResults (BlastFormatter *formatter_p) |
Get the results after the ExternalBlastTool has finished running. More... | |
virtual char * | GetLog () |
Get a copy of the log data from the run of this ExternalBlastTool's run. More... | |
Public Member Functions inherited from BlastTool | |
BlastTool (BlastServiceJob *job_p, const char *name_s, const char *factory_s, const BlastServiceData *data_p, const uint32 output_format, const char *custom_output_s) | |
Create a BlastTool for a given ServiceJob. More... | |
BlastTool (BlastServiceJob *job_p, const BlastServiceData *data_p, const json_t *json_p) | |
Create a BlastTool for a given ServiceJob. More... | |
virtual | ~BlastTool () |
The BlastTool destructor,. More... | |
uint32 | GetOutputFormat () const |
Get the output format code that this BlastTool will produce its results in. More... | |
virtual OperationStatus | Run ()=0 |
Run this BlastTool. More... | |
virtual bool | PreRun () |
Any custom functionality required before running a BlastTool. More... | |
virtual void | PostRun () |
Any custom functionality required after running a BlastTool. More... | |
virtual OperationStatus | GetStatus (bool update_flag=true) |
Get the status of a BlastTool. More... | |
virtual bool | AddErrorDetails () |
const uuid_t & | GetUUID () const |
Get the uuid for the ServiceJob that this BlastTool is linked with. More... | |
const char * | GetName () const |
Get the name asssociated with this BlastTool. More... | |
json_t * | GetAsJSON () |
Get the JSON-based persistent description of this BlastTool. More... | |
const char * | GetFactoryName () const |
Get the name of the BlastToolFactory that created this BlastTool. More... | |
bool | SetCustomOutputColumns (const char *custom_columns_s) |
void | FreeBlastTool (BlastTool *tool_p) |
Free a BlastTool. More... | |
OperationStatus | RunBlast (BlastTool *tool_p) |
Run Blast using the parameters that have been previously using ConvertArguments. More... | |
OperationStatus | GetBlastStatus (BlastTool *tool_p) |
Get the current OperationStatus of a BlastTool. More... | |
bool | IsBlastToolSynchronous (BlastTool *tool_p) |
Is the BlastTool going to run asynchronously? More... | |
Static Public Attributes | |
static const char *const | EBT_INPUT_SUFFIX_S |
This is the string that will get appended to each input file used by the ExternalBlastTool. More... | |
static const char *const | EBT_ASYNC_S |
This is the string that will get appended to each log file created when an ExternalBlastTool is ran. More... | |
Protected Member Functions | |
virtual ArgsProcessor * | GetArgsProcessor ()=0 |
Get the ArgsProcessor that this BlastTool will use to parse the input ParameterSet prior to running its job. More... | |
virtual bool | AddBlastArg (const char *const arg_s, const bool hyphen_flag) |
Add the argument to the command line arguments that this BlastTool will run with. More... | |
virtual bool | AddBlastArgsPair (const char *key_s, const char *value_s) |
Add a pair of arguments to the command line arguments that this BlastTool will run with. More... | |
char * | GetJobFilename (const char *const prefix_s, const char *const suffix_s) |
Create the filename to use for a ServiceJob. More... | |
virtual bool | AddToJSON (json_t *root_p) |
This method is used to serialise this ExternalBlastTool so that it can be recreated from another calling process when required. More... | |
Protected Attributes | |
char * | ebt_results_filename_s |
The filename which the Blast results will be written to if the job runs successfully. More... | |
char * | ebt_working_directory_s |
The working directory where all of the input, output and log files will be created. More... | |
char * | ebt_blast_s |
The name of the blast command line executable to use. More... | |
bool | ebt_async_flag |
If this is true , then the ExternalBlastTool will run asynchronously. More... | |
Protected Attributes inherited from BlastTool | |
uint32 | bt_output_format |
The output format code to use. More... | |
char * | bt_custom_output_columns_s |
Any custom columns for tabular output formats. More... | |
A class that will run Blast using an external application such as blastn rather than calling Blast library routines directly.
ExternalBlastTool | ( | BlastServiceJob * | job_p, |
const char * | name_s, | ||
const char * | factory_s, | ||
const BlastServiceData * | data_p, | ||
const char * | blast_program_name_s, | ||
const bool | async_flag | ||
) |
Create a ExternalBlastTool for a given ServiceJob.
job_p | The ServiceJob to associate with this ExternalBlastTool. |
name_s | The name to give to this ExternalBlastTool. |
factory_s | The name of the BlastToolFactory that is creating this ExternalBlastTool. |
data_p | The BlastServiceData for the Service that will run this ExternalBlastTool. |
blast_program_name_s | The name of blast command line executable that this ExternalBlastTool will call to run its blast job. |
ExternalBlastTool | ( | BlastServiceJob * | job_p, |
const BlastServiceData * | data_p, | ||
const json_t * | json_p | ||
) |
Create a ExternalBlastTool for a given ServiceJob using the configuration details from a serialised JSON fragment.
job_p | The ServiceJob to associate with this ExternalBlastTool. |
data_p | The BlastServiceData for the Service that will run this ExternalBlastTool. |
json_p | The JSON fragment to fill in the serialised values such as job name, etc. |
|
virtual |
The ExternalBlastTool destructor.
|
virtual |
Parse a ParameterSet to configure a ExternalBlastTool prior to it being ran.
param_set_p | The ParameterSet to parse. |
app_params_p | The BlastAppParameters to use process the values from the given ParameterSet. |
true
if the BlastTool was configured successfully and is ready to be ran, false
otherwise. Implements BlastTool.
Reimplemented in SystemBlastTool.
|
virtual |
|
virtual |
Set the output file parameter.
true
if the input filename was set successfully, false
otherwise. Implements BlastTool.
Reimplemented in DrmaaBlastTool.
|
virtual |
Get the results after the ExternalBlastTool has finished running.
formatter_p | The BlastFormatter to convert the results into a different format. If this is 0, then the results will be returned without any conversion. |
Implements BlastTool.
Reimplemented in AsyncSystemBlastTool, and ThreadedBlastTool.
|
virtual |
Get a copy of the log data from the run of this ExternalBlastTool's run.
0
upon error. If a valid value is returned, this will need to be freed by FreeCopiedString
to avoid a memory leak. Implements BlastTool.
|
protectedpure virtual |
Get the ArgsProcessor that this BlastTool will use to parse the input ParameterSet prior to running its job.
0
upon error. Implemented in DrmaaBlastTool, and SystemBlastTool.
|
protectedvirtual |
Add the argument to the command line arguments that this BlastTool will run with.
arg_s | The argument to add. |
hyphen_flag | If this is true then a hyphen will be prefixed the given value e.g. turning "foo" into "-foo" before being added, if this is false then the argument is added unaltered. |
true
if the argument was added successfully, false
otherwise. Reimplemented in DrmaaBlastTool.
|
protectedvirtual |
Add a pair of arguments to the command line arguments that this BlastTool will run with.
key_s | The first argument to add. |
value_s | The second argument to add. |
true
if the arguments were added successfully, false
otherwise.
|
protected |
Create the filename to use for a ServiceJob.
prefix_s | The prefix to use for the filename. |
suffix_s | The suffix to use from a set of constants. |
|
protectedvirtual |
This method is used to serialise this ExternalBlastTool so that it can be recreated from another calling process when required.
This is used to store the ExternalBlastTool in the JobsManager.
root_p | The json object to add the serialisation of this ExternalBlastTool to. |
true
if the ExternalBlastTool was serialised successfully, false
otherwise. Reimplemented from BlastTool.
Reimplemented in DrmaaBlastTool, and AsyncSystemBlastTool.
|
static |
This is the string that will get appended to each input file used by the ExternalBlastTool.
|
static |
This is the string that will get appended to each log file created when an ExternalBlastTool is ran.
This is the string identifier to use to set whether the ExternalBlastTool will run synchronously or asynchronously.
|
protected |
The filename which the Blast results will be written to if the job runs successfully.
|
protected |
The working directory where all of the input, output and log files will be created.
|
protected |
The name of the blast command line executable to use.
|
protected |
If this is true
, then the ExternalBlastTool will run asynchronously.
If it is false
, then the ExternalBlastTool will run synchronously.