Note
Removes all results if present in the engine as may be affected but modified correspondence.
Removes all results if present in the engine as may be affected but modified correspondence.
If there are ProcessingSettings objects with the same call names it is better to use run_workflow()
.
The engine data is saved in an sqlite 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. Changes made
in the app can be saved in the sqlite file and then loaded for scripting.
Methods
Method new()
Creates an R6 CoreEngine class object.
Usage
CoreEngine$new(
headers = NULL,
settings = NULL,
analyses = NULL,
results = NULL
)
Arguments
headers
A named list with headers or a ProjectHeaders S3 class object.
Each list element must have length one. There is no type restrictions
except for name (must be type character length 1), author (must be type
character length 1), file (must be type character length 1) and date (must
be class POSIXct or class POSIXt length 1). See more information in
?ProjectHeaders
.
settings
A named list of ProcessingSettings objects or a
single ProcessingSettings object. The list names should match
the call name of each ProcessingSettings object. Alternatively, a named
list with call name, algorithm and parameters to be transformed and added
as ProcessingSettings object.
analyses
An Analysis S3 class object or a list with Analysis S3 class objects as elements
(see ?Analysis
for more information).
results
A named list of objects from processing methods.
Prints a summary to the console.
Prints the headers list.
Usage
CoreEngine$print_headers()
Method print_analyses()
Prints the analyses.
Usage
CoreEngine$print_analyses()
Method print_workflow()
Prints the order of processing methods for all added processing settings.
Usage
CoreEngine$print_workflow()
Method print_results()
Prints the data results added to the engine.
Usage
CoreEngine$print_results()
Gets the headers list.
Usage
CoreEngine$get_headers(value = NULL)
Arguments
value
A character vector with the name/s of the header elements. When NULL
(the default), the entire
headers list is returned.
Method get_history()
Gets the object history (audit trail) as a data.table.
Method get_analyses()
Gets the list of analyses.
Usage
CoreEngine$get_analyses(analyses = NULL)
Arguments
analyses
A numeric/character vector with the number/name of the analyses.
Method get_number_analyses()
Gets the number of analyses.
Usage
CoreEngine$get_number_analyses()
Method get_overview()
Gets an overview data.table with all the analysis names,replicates, associated blank replicates,
and full file paths.
Usage
CoreEngine$get_overview()
Method get_analysis_names()
Gets the analysis names.
Usage
CoreEngine$get_analysis_names(analyses = NULL)
Arguments
analyses
A numeric/character vector with the number/name of the analyses.
Method get_replicate_names()
Gets the analysis replicate names.
Usage
CoreEngine$get_replicate_names(analyses = NULL)
Arguments
analyses
A numeric/character vector with the number/name of the analyses.
Method get_blank_names()
Gets the analysis blank replicate names.
Usage
CoreEngine$get_blank_names(analyses = NULL)
Arguments
analyses
A numeric/character vector with the number/name of the analyses.
Method get_files()
Gets the full file paths of each analysis.
Usage
CoreEngine$get_files(analyses = NULL)
Arguments
analyses
A numeric/character vector with the number/name of the analyses.
Gets the file format of each analysis.'
Usage
CoreEngine$get_formats(analyses = NULL)
Arguments
analyses
A numeric/character vector with the number/name of the analyses.
Method get_types()
Gets the type of each analysis.
Usage
CoreEngine$get_types(analyses = NULL)
Arguments
analyses
A numeric/character vector with the number/name of the analyses.
Method get_settings()
Gets the processing settings list.
Usage
CoreEngine$get_settings(call = NULL)
Arguments
call
A string or a vector of strings with the name/s of the processing method/s.
Method get_settings_names()
Gets the call names of all processing methods in added processing settings as a character vector.
Usage
CoreEngine$get_settings_names()
Method get_workflow_overview()
A data.table
with the overview of all processing methods from added processing settings.
Usage
CoreEngine$get_workflow_overview()
Method get_results_names()
Gets names of present results data.
Usage
CoreEngine$get_results_names()
Method get_results()
Gets the list of results data.
Usage
CoreEngine$get_results(results = NULL)
Arguments
results
A character vector with the name of the module/s.
Adds headers. If an argument or element "name" is given, it must be type character. If an argument
or element path is given, it must be type character and exist. If an argument or element date is given, it must
be class POSIXct or POSIXt. If given date is character, conversion to class POSIXct or POSIXt is attempted.
See ?ProjectHeaders
for more information.
Usage
CoreEngine$add_headers(...)
Arguments
...
Arguments to be added as headers. Note that all given arguments
must be of length one. There is no type limitations. The name of the argument
becomes the name of the header entry. Alternatively, a single list argument
with the headers (all length one) can be given.
Method add_settings()
Adds processing settings.
Usage
CoreEngine$add_settings(settings = NULL, replace = FALSE)
Arguments
settings
A named list of ProcessingSettings objects or a
single ProcessingSettings object. The list names should match
the call name of each ProcessingSettings object. Alternatively, a named
list with call name, algorithm and parameters to be transformed and added
as ProcessingSettings object.
replace
Logical of length one. When TRUE
, existing settings are
replaced by the new settings with the same call name, except settings for
methods that can be applied more than once. The default is FALSE
.
Method add_analyses()
Adds analyses.
Usage
CoreEngine$add_analyses(analyses = NULL)
Arguments
analyses
An Analysis S3 class object or a list with Analysis S3 objects as elements.
Method add_replicate_names()
Adds or redefines the analysis replicate names.
Usage
CoreEngine$add_replicate_names(value = NULL)
Arguments
value
A character vector with the analysis replicate names. Must be of the same length as the number of analyses.
Method add_blank_names()
Adds or redefines the analysis blank replicate names.
Usage
CoreEngine$add_blank_names(value = NULL)
Arguments
value
A character vector with the analysis blank replicate names. Must be of the same length as the number of analyses.
Adds metadata to analyses.
Usage
CoreEngine$add_metadata(value = NULL)
Arguments
value
A data.frame or data.table with metadata for the analyses.
The data.frame or data.table must have an analysis column and the same
number of rows as the number of analyses in the engine. Metadata is added
using any extra columns of the data.frame or data.table.
Method add_results()
Adds data from results to the engine.
Usage
CoreEngine$add_results(value = NULL)
Arguments
value
A named list with data from results.
Removes headers entries. Note that the name, path and date headers cannot be removed only changed.
Usage
CoreEngine$remove_headers(value = NULL)
Arguments
value
A character vector with the name/s of the elements in headers to be removed.
Method remove_settings()
Removes settings.
Usage
CoreEngine$remove_settings(call = NULL)
Arguments
call
A string or a vector of strings with the name/s of the processing method/s to be removed.
Alternatively, an integer vector with the index/es of the settings to be removed. When call
is
NULL
all settings are removed.
Method remove_analyses()
Removes analyses.
Usage
CoreEngine$remove_analyses(analyses = NULL)
Arguments
analyses
A numeric/character vector with the number/name of the analyses.
Method remove_results()
Removes results data.
Usage
CoreEngine$remove_results(results)
Arguments
results
A named list of objects from processing methods.
Method subset_analyses()
Subsets on analyses returning a new cloned object with only the analyses to keep.
Usage
CoreEngine$subset_analyses(analyses = NULL)
Arguments
analyses
A numeric/character vector with the number/name of the analyses.
Method has_settings()
Checks if there are processing settings, returning TRUE
or FALSE
.
Usage
CoreEngine$has_settings(call = NULL)
Arguments
call
A string or a vector of strings with the name/s of the processing method/s.
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 process()
Runs a processing method with the provided settings.
Usage
CoreEngine$process(settings = NULL)
Arguments
settings
A ProcessingSettings object or a character string with the call name of a previously added
ProcessingSettings in the engine.
Method run_workflow()
Runs all processing results represented by added processing settings.
Usage
CoreEngine$run_workflow()
Saves the engine data as sqlite file.
Usage
CoreEngine$save(file = NA_character_)
Arguments
file
A string with the full file path of the sqlite file. If NA
(the default) and no file
header is defined in the engine, the file name is automatically created with the engine class name and the date.
Loads the engine data from an sqlite file.
Usage
CoreEngine$load(file = NA_character_)
Arguments
file
A string with the full file path of the sqlite file. If NA
(the default) and no file
header is defined in the engine, the file name is automatically created with the engine class name and the date.
Exports the headers as json (the default) or rds.
Usage
CoreEngine$export_headers(format = "json", name = "headers", path = getwd())
Arguments
format
A string. Possible values are json
and rds
for saving as JSON or RDS formats, respectively.
name
String with the name of the file to be saved.
path
String with the directory of the file to be saved.
Method export_settings()
Exports the settings as json (the default) or rds.
Usage
CoreEngine$export_settings(
call = NULL,
format = "json",
name = "settings",
path = getwd()
)
Arguments
call
A string or a vector of strings with the name/s of the processing method/s to be exported.
When call
is NULL
all settings are saved.
format
A string. Possible values are json
and rds
for saving as JSON or RDS formats, respectively.
name
String with the name of the file to be saved.
path
String with the directory of the file to be saved.
Method export_analyses()
Exports the analyses as json (the default) or rds.
Usage
CoreEngine$export_analyses(
analyses = NULL,
format = "json",
name = "analyses",
path = getwd()
)
Arguments
analyses
A numeric/character vector with the number/name of the analyses.
format
A string. Possible values are json
and rds
for saving as JSON or RDS formats, respectively.
name
String with the name of the file to be saved.
path
String with the directory of the file to be saved.
Method export()
Exports the engine data as as json (the default) or rds.
Usage
CoreEngine$export(format = "json", name = "EngineData", path = getwd())
Arguments
format
A string. Possible values are json
and rds
for saving as JSON or RDS formats, respectively.
name
String with the name of the file to be saved.
path
String with the directory of the file to be saved.
Imports headers from an rds or json file.
Usage
CoreEngine$import_headers(file = NA_character_)
Arguments
file
A json or rds file to be imported.
Method import_settings()
Imports settings from an rds or json file.
Usage
CoreEngine$import_settings(file = NA_character_, replace = TRUE)
Arguments
file
A json or rds file to be imported.
replace
Logical. When TRUE
, existing settings are replaced by the new settings with the same call name.
Method import_analyses()
Imports analyses from an rds or json file.
Usage
CoreEngine$import_analyses(file = NA_character_)
Arguments
file
A json or rds file to be imported.
Method import()
Imports a CoreEngine saved as json or rds.
Usage
CoreEngine$import(file = NA_character_)
Arguments
file
A json or rds file representing a CoreEngine.
Method run_app()
Runs a Shiny app to explore and manage the engine.
Method processing_methods()
Data.table with available data processing methods.
Usage
CoreEngine$processing_methods()
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.