SYSargsList-class: Class '"SYSargsList"'

Description Usage Arguments Objects from the Class Slots Methods Author(s) See Also Examples

Description

S4 class container for storing parameters and information of command-line- or R-based workflow.

SYSargsList instances are constructed by the SYSargsList function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
## Constructor

SYSargsList(sysargs = NULL, step_name = "default", 
            targets = NULL, wf_file = NULL, input_file = NULL, dir_path = ".", 
            id = "SampleName",
            inputvars = NULL, rm_targets_col = NULL, 
            dir = TRUE, dependency = "", 
            run_step = "mandatory",
            run_session = "rsession",
            silent = FALSE, 
            projPath = getOption("projPath", getwd()))

## Accessors

stepsWF(x)
statusWF(x)
targetsWF(x)
outfiles(x)
SE(x)
dependency(x)
projectInfo(x)
runInfo(x)

## Methods

baseCommand(x, ...)
SampleName(x, ...)
stepName(x)
targetsheader(x, ...)
yamlinput(x, ...)
cmdlist(x, ...)
codeLine(x, ...)
copyEnvir(x, list = character(), new.env = globalenv(), silent = FALSE)
viewEnvir(x)

## Subset Methods

subset(x, ...)
getColumn(x, step, position = c("outfiles", "targetsWF"), column = 1, 
          names = SampleName(x, step))



## Replacement

dependency(x, step, ...) <- value
appendStep(x, after = length(x), ...) <- value
replaceStep(x, step, step_name = "default") <- value
renameStep(x, step, ...) <- value
yamlinput(x, paramName, ...) <- value
appendCodeLine(x, after = length(x), ...) <- value
replaceCodeLine(x, line, ...) <- value
updateColumn(x, step, position = c("outfiles", "targetsWF")) <- value

Arguments

sysargs

SYSargs2 object.

step_name

character with the step index name.

targets

the path to targets file. The targets file can be either a simple tabular or yml file. Also, it is possible to assign NULL to run the pipeline without the 'targets' file. This can be useful for running specific workflows that do not require input files.

wf_file

name and path to CWL parameters file.

input_file

name and path to input parameters file.

dir_path

full path to the directory with the CWL parameters and input files.

id

A column from targets file, which will be used as an id for each one of the samples. It is required to be unique.

inputvars

variables list defined in the input file that matches the column names defined in the targets file.

rm_targets_col

targets file colunms to be removed.

dir

This option allows creating an exclusive results folder for each step in the workflow. All the outfiles and log files for the particular step will be created in the respective folders. Default is dir=TRUE.

dependency

character. Dependency tree, required when appending this step to the workflow. Character name of a previous step in the workflow. Default is empty string "".

run_step

character. If the step has "mandatory" or "optional" flag for the execution.

run_session

character. If the step has "rsession" or "cluster" flag for the execution.

silent

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

projPath

a character vector of a full project path name. Default is the current path.

x

An instance of class SYSargsList.

step

character or numeric. Step name or index.

list

a character vector naming objects to be copyied from the enviroment.

new.env

An environment to copy to. Default is globalenv().

position

character. Options are "outfiles" or "targetsWF" slots.

column

character or numeric. Which column will be replaces from the position argument.

names

character vector. Names of the new column.

after

A subscript, after which the values are to be appended.

paramName

character. Input name from yamlinput(x), which value should be replaced.

line

An instance of class LineWise.

value

object containing the values to be replaced to x. Values may be of the same class as the orginal values. For updateColumn<-a dataframe that must have the same rows as the modifying dataframe. However, if there is no column in the original dataframe. This new df will replace the empty one. If there is a non-empty dataframe, any existing columns with the same name as this new df will be replaced. Any columns that do not exist in the original column but this new df will be added to the original data.frame.

...

object containing the values to be replaced to x. Values may be of the same class as the orginal values.

Objects from the Class

Objects can be created by calls of the form new("SYSargsList", ...).

Slots

stepsWF:

Object of class "list" storing all the SYSargs2 objects of the workflow

statusWF:

Object of class "list" storing all the success and failure of each step in the workflow

targetsWF:

Object of class "list" storing all the targets files for each step in the workflow

outfiles:

Object of class "list" storing all the output files in the workflow

SE:

Object of class "list" storing all the SummarizedExperiment objects in the workflow

dependency:

Object of class "list" storing all the dependency steps in the workflow

targets_connection:

Object of class "list" storing all targets files connection in the workflow

projectInfo:

Object of class "list" storing all the projectInfo information of the workflow

runInfo:

Object of class "list" storing all the runInfo information of the workflow

Methods

[

signature(x = "SYSargsList", i = "ANY", j = "ANY", drop = "ANY"): subsetting of class with bracket operator

[[

signature(x = "SYSargsList", i = "ANY", j = "ANY"): subsetting of class with bracket operator

[[<-

signature(x = "SYSargsList", i = "ANY", j = "ANY", value = "ANY"): replacement method for SYSargsList class

$

signature(x = "SYSargsList"): extracting slots elements by name

coerce

signature(from = "list", to = "SYSargsList"): as(list, "SYSargsList")

coerce

signature(from = "SYSargsList", to = "list"): as(SYSargsList, "list")

length

signature(x = "SYSargsList"): extracts number of SYSargs2 objects

names

signature(x = "SYSargsList"): extracts slot names

show

signature(object = "SYSargsList"): summary view of SYSargsList steps

stepsWF

signature(x = "SYSargsList"): extract data from stepsWF slot

statusWF

signature(x = "SYSargsList"): extract data from statusWF slot

dependency

signature(x = "SYSargsList"): extract data from dependency slot

projectInfo

signature(x = "SYSargsList"): extract data from projectInfo slot

runInfo

signature(x = "SYSargsList"): extract data from runInfo slot

targetsWF

signature(x = "SYSargsList"): extract data from targetsWF slot

sysargslist

signature(x = "SYSargsList"): Coerce back to list as(SYSargsList, "list")

SE

signature(x = "SYSargsList"): extract data from SE slot

cmdlist

signature(x = "SYSargsList", sample=NULL): extracts data from cmdlist slot for each step

appendStep<-

signature(x = "SYSargsList"): replacement method for append a step

appendStep<-

signature(x = "SYSargsList"): replacement method for append a step

replaceStep<-

signature(x = "SYSargsList"): replacement method for replace a step

renameStep<-

signature(x = "SYSargsList"): replacement method for rename a step

yamlinput<-

signature(x = "SYSargsList"): replacement method for yamlinput slot for each step

dependency<-

signature(x = "SYSargsList"): replacement method for dependency slot for each step

updateStatus<-

signature(x = "SYSargsList"): updateStatus method for update a step status

Author(s)

Daniela Cassol and Thomas Girke

See Also

SYSargs2, LineWise, and SPRproject

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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")
                   
## Accessors

stepsWF(sal)
statusWF(sal)
targetsWF(sal)
outfiles(sal)
SE(sal)
dependency(sal)
projectInfo(sal)
runInfo(sal)

## Methods

baseCommand(sal, 1) ## SYSargs2 step
SampleName(sal, step="echo")
stepName(sal)
targetsheader(sal, step=1) ## SYSargs2 step
yamlinput(sal, step=1) ## SYSargs2 step
cmdlist(sal, step=1, targets=1:2) ## SYSargs2 step
codeLine(sal, step=2) ## SYSargs2 step
copyEnvir(sal, list = character(), new.env = globalenv())
viewEnvir(sal)

## Subset Methods

sal_sub <- subset(sal, subset_steps=1, input_targets=1:2, keep_steps = TRUE)
targetsIn <- getColumn(sal, step=1, position = c("outfiles"))

## Replacement
renameStep(sal, step=1) <- "new_echo"
dependency(sal, step=2) <- "new_echo"
updateColumn(sal, step=2, position = c("targetsWF")) <- data.frame(targetsIn)
targetsWF(sal)

replaceStep(sal, step=2) <- LineWise(code = {
                            hello <- "Printing a new message"
                            }, 
                            step_name = "R_hello", 
                            dependency = "new_echo")
#yamlinput(sal, step=1, paramName="results_path") <- list(results_path=list(
#                                            class="Directory", path="./data"))
appendCodeLine(sal, step=2, after = 0) <- "log <- log(10)"
codeLine(sal, 2)
replaceCodeLine(sal, step=2, line=1) <- LineWise(code = {
                            log <- log(50)
                            })
codeLine(sal, 2)

tgirke/systemPipeR documentation built on Sept. 18, 2021, 12:03 p.m.