The CoreEngine
R6 class is used internally for harmonizing the different data specific engines. Users
should not use this class directly.
Note
If there are ProcessingSettings
objects with the same method names it is better to use run_workflow()
.
The engine data is saved in an rds file and loaded in the app. If save file is defined in the engine it
is used, otherwise the save file name is automatically set to the engine class name and the date in the format
rds. Changes made in the app can be saved in the rds file and then loaded to continue working on the
engine by scripting.
Active bindings
headers
ProjectHeaders
S7 class object.
workflow
Workflow
S7 class object.
analyses
Analyses
S7 class object.
results
List of results in the analyses.
file
An EngineSaveFile
S7 class object. When setting the value it
can also be a character with an sqlite
or rds
file path to save the engine.
audit_trail
AuditTrail S7 class object.
Methods
Method new()
Creates a CoreEngine
R6 class object.
Usage
CoreEngine$new(
file = NULL,
headers = NULL,
workflow = NULL,
analyses = NULL,
...
)
Arguments
file
Character of length one with the full path to the sqlite
or rds
save file of the engine.
headers
A named list with headers or a ProjectHeaders
object. Each list element must have length one. There
is no type restrictions except for name (must be type character), author (must be type character character) and date
(must be class POSIXct or class POSIXt).
workflow
A Workflow
S7 class object or a list of ProcessingSettings
S7 class objects.
analyses
An Analyses
child class or a data specific analyses input.
See each data specific engine for details.
...
Additional data specific engine arguments.
Prints a summary to the console.
Prints the headers.
Usage
CoreEngine$print_headers()
Method print_analyses()
Prints the analyses.
Usage
CoreEngine$print_analyses()
Method print_workflow()
Prints the workflow.
Usage
CoreEngine$print_workflow()
Saves the engine data as an sqlite or rds file.
Usage
CoreEngine$save(file = NA_character_)
Arguments
file
A string with the full file path of the sqlite or rds file. If NA
(the default) and
no save file is defined in the engine, the file name is automatically created with the engine class name and the
date in the headers in the rds format.
Loads the engine data from an sqlite or rds file.
Usage
CoreEngine$load(file = NA_character_)
Arguments
file
A string with the full file path of the sqlite or rds file containing the engine data saved.
Method add_analyses()
Adds analyses. Note that when adding new analyses, any existing results are removed.
Usage
CoreEngine$add_analyses(analyses = NULL)
Arguments
analyses
An engine specific analysis object or a list of engine specific analysis input. See each data
specific engine for details.
Details
By adding analyses to the engine the results are removed as data reprocessing must be done. The
analyses object can be a specific engine analysis object or a file path to a engine specific format.
Method remove_analyses()
Removes analyses.
Usage
CoreEngine$remove_analyses(analyses = NULL)
Arguments
analyses
A string or a vector of strings with the name/s or numeric with indices of the analyses to remove.
Method has_settings()
Checks if there are processing settings, returning TRUE
or FALSE
.
Usage
CoreEngine$has_settings()
Method has_analyses()
Checks if analyses are present, returning TRUE
or FALSE
.
Usage
CoreEngine$has_analyses()
Method has_results()
Checks if results are present, returning TRUE
or FALSE
.
Usage
CoreEngine$has_results(names = NULL)
Arguments
names
A string or a vector of strings with the name/s of the
results data. The actual names depends of the applied algorithms. For
instance, when algorithms via patRoon are used, the name of the module
data is patRoon.
Method run()
Runs a processing method according to the provided settings.
Usage
CoreEngine$run(settings = NULL)
Arguments
settings
A ProcessingSettings
object or a character
string with the method name of a previously added
ProcessingSettings
in the engine.
Method run_workflow()
Runs all processing methods in workflow.
Usage
CoreEngine$run_workflow()
Exports the headers as json (the default) or rds.
Usage
CoreEngine$export_headers(file = "headers.json")
Arguments
file
A character vector of length one with full file path.
Method export_workflow()
Exports the workflow as json (the default) or rds.
Usage
CoreEngine$export_workflow(file = "workflow.json")
Arguments
file
A character vector of length one with full file path.
Method export_analyses()
Exports the analyses as json (the default) or rds.
Usage
CoreEngine$export_analyses(file = "analyses.json")
Arguments
file
A character vector of length one with full file path.
Imports headers from an rds or json file.
Usage
CoreEngine$import_headers(file = NA_character_)
Method import_workflow()
Imports workflow from an rds or json file.
Usage
CoreEngine$import_workflow(file = NA_character_)
Method import_analyses()
Imports analyses from an rds or json file.
Usage
CoreEngine$import_analyses(file = NA_character_)
Runs a Shiny app to explore and manage the engine.
Method clone()
The objects of this class are cloneable with this method.
Usage
CoreEngine$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.