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.
async_system_polymarker_tool.hpp
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 */
26 #ifndef SERVER_SRC_SERVICES_POLYMARKER_INCLUDE_SYSTEM_POLYMARKER_TOOL_HPP_
27 #define SERVER_SRC_SERVICES_POLYMARKER_INCLUDE_SYSTEM_POLYMARKER_TOOL_HPP_
28 
29 #include "polymarker_tool.hpp"
30 #include "temp_file.hpp"
31 
32 
34 {
35 public:
37 
38  AsyncSystemPolymarkerTool (PolymarkerServiceJob *job_p, const PolymarkerSequence *seq_p, const PolymarkerServiceData *data_p, const json_t *root_p);
39 
40  virtual ~AsyncSystemPolymarkerTool ();
41 
42  virtual bool PreRun ();
43 
44  virtual bool PostRun ();
45 
46  virtual char *GetLog ();
47 
48  virtual char *GetResults (PolymarkerFormatter *formatter_p);
49 
50 
51  virtual OperationStatus Run ();
52 
53  virtual OperationStatus GetStatus (bool update_flag);
54 
55  virtual bool ParseParameters (const ParameterSet * const param_set_p);
56 
57 
58  virtual bool AddToJSON (json_t *root_p);
59 
60  virtual PolymarkerToolType GetToolType () const;
61 
62 
63 protected:
64  const char *aspt_executable_s;
66 
67  bool CreateArgs (const char *input_s, char *output_s, char *contigs_s);
68  TempFile *GetInputFile (const char *gene_id_s, const char *target_chromosome_s, const char *sequence_s);
69  char *GetOutputFolder ();
70  bool GetStringParameter (const ParameterSet * const params_p, const char *param_name_s, char **param_value_ss);
71  void FreeCommandLineArgs ();
72 
73  bool SetExecutable (const PolymarkerServiceData *data_p);
74 
75 
76 private:
77  static uint32 SPT_NUM_ARGS;
78 
79  static const char * const ASPT_ASYNC_S;
80  static const char * const ASPT_LOGFILE_S;
81  static const char * const ASPT_EXECUTABLE_S;
82 
83  char *aspt_async_logfile_s;
84  SystemAsyncTask *aspt_task_p;
85 };
86 
87 
88 
89 #endif /* SERVER_SRC_SERVICES_POLYMARKER_INCLUDE_SYSTEM_POLYMARKER_TOOL_HPP_ */
PolymarkerTool::GetStatus
virtual OperationStatus GetStatus(bool update_flag)=0
Get the OperationStatus for the ServiceJob that this PolymarkerTool is running.
polymarker_tool.hpp
polymarker_tool.hpp
PolymarkerFormatter
Definition: polymarker_formatter.hpp:33
AsyncSystemPolymarkerTool
Definition: async_system_polymarker_tool.hpp:33
PolymarkerSequence
A datatype that stores the information of sequence data that the PolymarkerService can run with.
Definition: polymarker_service.h:106
PolymarkerTool::GetToolType
virtual PolymarkerToolType GetToolType() const =0
Get the PolymarkerToolType for this PolymarkerTool.
PolymarkerToolType
PolymarkerToolType
An enum listing the different types of PolymarkerTool that are available.
Definition: polymarker_service.h:86
PolymarkerTool::PreRun
virtual bool PreRun()
The function that will be called before trying to run this PolymarkerTool.
PolymarkerServiceData
The ServiceData used for the PolymarkerService.
Definition: polymarker_service.h:129
PolymarkerServiceJob
A datatype for storing a ServiceJob for the PolymarkerService with its extra associated fields.
Definition: polymarker_service_job.h:40
AsyncSystemPolymarkerTool::aspt_command_line_args_s
char * aspt_command_line_args_s
Definition: async_system_polymarker_tool.hpp:65
OperationStatus
OperationStatus
The current status of an Operation.
Definition: operation.h:96
TempFile
Create a temporary file to read and write data to.
Definition: blast/include/temp_file.hpp:46
PolymarkerTool::PostRun
virtual bool PostRun()=0
The function that will be called after running this PolymarkerTool.
PolymarkerTool::GetResults
virtual char * GetResults(PolymarkerFormatter *formatter_p)=0
Get the results from the run of this PolymarkerTool.
temp_file.hpp
AsyncSystemPolymarkerTool::aspt_executable_s
const char * aspt_executable_s
Definition: async_system_polymarker_tool.hpp:64
PolymarkerTool::ParseParameters
virtual bool ParseParameters(const ParameterSet *const param_set_p)=0
Parse a ParameterSet to set the variables that the PolymarkerTool's ServiceJob will run with.
PolymarkerTool::AddToJSON
virtual bool AddToJSON(json_t *root_p)
Add the required information for this PolymarkerTool to be serialised to JSON and deserialised again.
PolymarkerTool::GetLog
virtual char * GetLog()=0
Get the log after the PolymarkerTool has finished running.
PolymarkerTool::Run
virtual OperationStatus Run()=0
POLYMARKER_SERVICE_LOCAL
#define POLYMARKER_SERVICE_LOCAL
Definition: polymarker_service.h:48
ParameterSet
A set of Parameters along with an optional name and description.
Definition: parameter_set.h:46
SystemAsyncTask
A datatype to allow the running of command-line applications in a separate task.
Definition: system_async_task.h:44
PolymarkerTool
The base class for the object that will actually run the Polymarker application.
Definition: polymarker_tool.hpp:42