runWF: Execute SYSargsList

View source: R/sysargslist_utilities.R

runWFR Documentation

Execute SYSargsList

Description

Function to execute all the code list specified in SYSargsList object.

Usage

runWF(sysargs, steps = NULL, targets = NULL,
                  force = FALSE, saveEnv = TRUE,
                  run_step = "ALL", ignore.dep = FALSE,
                  warning.stop = FALSE, error.stop = TRUE, silent = FALSE, ...)

Arguments

sysargs

object of class SYSargsList.

steps

character or numeric. Step name or index. If NULL, all the steps will be executed.

targets

This option allows selecting which targets file and, by consequence which command line will be executed for each SYSargs2 class step. Default is NULL, in which all command lines will be executed.

force

Internally, the option checks if the expected output files exist, and it skips the command lines when the respective files exist. If the argument force is set to TRUE, the command line will be executed and the files overwrite. Default is force=FALSE.

saveEnv

If set to TRUE, the environment will be saved to an RDS file. To check the RDS file location, please use projectInfo(sysargs)[["envir"]].

run_step

character. If the step has "mandatory" or "optional" flag for the execution. When ALL, all the steps will be executed.

ignore.dep

logical. This option allow to igonore the dependency tree, when TRUE.

warning.stop

If set to TRUE, the process will be interrupted when a warning is detected.

error.stop

If set to TRUE, the process will be interrupted when a error is detected.

silent

If set to TRUE, all messages returned by the function will be suppressed.

...

Additional arguments to pass on from runCommandline().

Value

It will return an SYSargsList updated.

Author(s)

Daniela Cassol and Thomas Girke

See Also

See also as SYSargsList-class.

Examples

## Construct SYSargsList object from Rmd file
sal <- SPRproject(overwrite=TRUE)
targetspath <- system.file("extdata/cwl/example/targets_example.txt", package="systemPipeR")

## Constructor and `appendStep<-`
appendStep(sal) <- SYSargsList(step_name = "echo", 
                               targets=targetspath, dir=TRUE,
                               wf_file="example/workflow_example.cwl", input_file="example/example.yml", 
                               dir_path = system.file("extdata/cwl", package="systemPipeR"),
                               inputvars = c(Message = "_STRING_", SampleName = "_SAMPLE_"))
appendStep(sal) <- LineWise(code = {
                            hello <- lapply(getColumn(sal, step=1, 'outfiles'), function(x) yaml::read_yaml(x))
                            }, 
                            step_name = "R_read", 
                            dependency = "echo")
## Not run: 
sal <- runWF(sal)

## End(Not run)

tgirke/systemPipeR documentation built on Aug. 30, 2022, 10 p.m.