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.
BlastTool Class Referenceabstract

The base class for running Blast. More...

#include <blast_tool.hpp>

Inheritance diagram for BlastTool:
[legend]

Public Member Functions

 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 ParseParameters (ParameterSet *param_set_p, BlastAppParameters *app_params_p)=0
 Parse a ParameterSet to configure a BlastTool prior to it being ran. More...
 
virtual bool SetInputFilename (const char *const filename_s)=0
 Set the input filename for the BlastTool to use. More...
 
virtual bool SetUpOutputFile ()=0
 Set the output file parameter. 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 char * GetResults (BlastFormatter *formatter_p)=0
 Get the results after the ExternalBlastTool has finished running. More...
 
virtual char * GetLog ()=0
 Get the log after the BlastTool has finished running. More...
 
virtual bool AddErrorDetails ()
 
const uuid_tGetUUID () 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...
 

Protected Member Functions

virtual bool AddToJSON (json_t *root_p)
 This method is used to serialise this BlastTool so that it can be recreated from another calling process when required. More...
 

Protected Attributes

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

Detailed Description

The base class for running Blast.

Constructor & Destructor Documentation

◆ BlastTool() [1/2]

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.

Parameters
job_pThe ServiceJob to associate with this BlastTool.
name_sThe name to give to this BlastTool.
data_pThe BlastServiceData for the Service that will run this BlastTool.
factory_sThe name of the BlastToolFactory that created this BlastTool.
output_formatThe output format that this BlastTool will produce its results in.
See also
BlastServiceJob

◆ BlastTool() [2/2]

BlastTool ( BlastServiceJob job_p,
const BlastServiceData data_p,
const json_t *  json_p 
)

Create a BlastTool for a given ServiceJob.

Parameters
job_pThe ServiceJob to associate with this BlastTool.
data_pThe BlastServiceData for the Service that will run this BlastTool.
json_pThe JSON fragment representing a serialised version of the BlastTool.
See also
BlastServiceJob

◆ ~BlastTool()

virtual ~BlastTool ( )
virtual

The BlastTool destructor,.

Member Function Documentation

◆ GetOutputFormat()

uint32 GetOutputFormat ( ) const

Get the output format code that this BlastTool will produce its results in.

Returns
The output format code.

◆ Run()

virtual OperationStatus Run ( )
pure virtual

Run this BlastTool.

Returns
The OperationStatus of this BlastTool after it has started running.

Implemented in DrmaaBlastTool, SystemBlastTool, AsyncSystemBlastTool, and ThreadedBlastTool.

◆ ParseParameters()

virtual bool ParseParameters ( ParameterSet param_set_p,
BlastAppParameters app_params_p 
)
pure virtual

Parse a ParameterSet to configure a BlastTool prior to it being ran.

Parameters
param_set_pThe ParameterSet to parse.
app_params_pThe BlastAppParameters to use process the values from the given ParameterSe
Returns
true if the BlastTool was configured successfully and is ready to be ran, false otherwise.

Implemented in SystemBlastTool, and ExternalBlastTool.

◆ SetInputFilename()

virtual bool SetInputFilename ( const char *const  filename_s)
pure virtual

Set the input filename for the BlastTool to use.

Parameters
filename_sThe filename.
Returns
true if the input filename was set successfully, false otherwise.

Implemented in ExternalBlastTool.

◆ SetUpOutputFile()

virtual bool SetUpOutputFile ( )
pure virtual

Set the output file parameter.

Returns
true if the input filename was set successfully, false otherwise.

Implemented in DrmaaBlastTool, and ExternalBlastTool.

◆ PreRun()

virtual bool PreRun ( )
virtual

Any custom functionality required before running a BlastTool.

Reimplemented in AsyncSystemBlastTool.

◆ PostRun()

virtual void PostRun ( )
virtual

Any custom functionality required after running a BlastTool.

◆ GetStatus()

virtual OperationStatus GetStatus ( bool  update_flag = true)
virtual

Get the status of a BlastTool.

Parameters
update_flagif this is true then the BlastTool will check the status of its running jobs if necessary, if this is false it will return the last cached value.
Returns
The OperationStatus of this BlastTool.

Reimplemented in DrmaaBlastTool, AsyncSystemBlastTool, SystemBlastTool, and ThreadedBlastTool.

◆ GetResults()

virtual char* GetResults ( BlastFormatter formatter_p)
pure virtual

Get the results after the ExternalBlastTool has finished running.

Parameters
formatter_pThe BlastFormatter to convert the results into a different format. If this is 0, then the results will be returned without any conversion.
Returns
The results as a c-style string or 0 upon error.

Implemented in ExternalBlastTool, AsyncSystemBlastTool, and ThreadedBlastTool.

◆ GetLog()

virtual char* GetLog ( )
pure virtual

Get the log after the BlastTool has finished running.

Returns
The results as a c-style string or 0 upon error.

Implemented in ExternalBlastTool.

◆ AddErrorDetails()

virtual bool AddErrorDetails ( )
virtual

◆ GetUUID()

const uuid_t& GetUUID ( ) const

Get the uuid for the ServiceJob that this BlastTool is linked with.

Returns
The uuid of the corresponding ServiceJob for this BlastTool.

◆ GetName()

const char* GetName ( ) const

Get the name asssociated with this BlastTool.

Returns
The name.

◆ GetAsJSON()

json_t* GetAsJSON ( )

Get the JSON-based persistent description of this BlastTool.

This allows the BlastTool to be recreated in another process or thread.

Returns
The json_t description of this BlastTool or 0 upon error.

◆ GetFactoryName()

const char* GetFactoryName ( ) const

Get the name of the BlastToolFactory that created this BlastTool.

Returns
The name of the BlastToolFactory.

◆ SetCustomOutputColumns()

bool SetCustomOutputColumns ( const char *  custom_columns_s)

◆ AddToJSON()

virtual bool AddToJSON ( json_t *  root_p)
protectedvirtual

This method is used to serialise this BlastTool so that it can be recreated from another calling process when required.

This is used to store the BlastTool in the JobsManager.

Parameters
root_pThe json object to add the serialisation of this BlastTool to.
Returns
true if the BlastTool was serialised successfully, false otherwise.

Reimplemented in ExternalBlastTool, DrmaaBlastTool, and AsyncSystemBlastTool.

◆ FreeBlastTool()

void FreeBlastTool ( BlastTool tool_p)

Free a BlastTool.

Parameters
tool_pThe BlastTool to deallocate.

◆ RunBlast()

OperationStatus RunBlast ( BlastTool tool_p)

Run Blast using the parameters that have been previously using ConvertArguments.

Parameters
tool_pThe BlastTool to use.
Returns
true if the tool completed successfully, false otherwise.

◆ GetBlastStatus()

OperationStatus GetBlastStatus ( BlastTool tool_p)

Get the current OperationStatus of a BlastTool.

Parameters
tool_pThe BlastTool to check.
Returns
The current OperationStatus.

◆ IsBlastToolSynchronous()

bool IsBlastToolSynchronous ( BlastTool tool_p)

Is the BlastTool going to run asynchronously?

Parameters
tool_pThe BlastTool to check.
Returns
true if the tool will run asynchronously, false otherwise.

Field Documentation

◆ bt_output_format

uint32 bt_output_format
protected

The output format code to use.

◆ bt_custom_output_columns_s

char* bt_custom_output_columns_s
protected

Any custom columns for tabular output formats.


The documentation for this class was generated from the following file: