| SYSargsList-class {systemPipeR} | R Documentation |
"SYSargsList"SYSargsList S4 class is a list-like container where each instance stores
all the input/output paths and parameter components required for a particular
data analysis step based on command-line- or R-based software.
SYSargsList instances are constructed by the SYSargsList function.
## Accessors
stepsWF(x)
statusWF(x)
targetsWF(x)
outfiles(x)
SE(x, ...)
dependency(x)
projectInfo(x)
runInfo(x)
## Methods
cmdlist(x, ...)
codeLine(x, ...)
SampleName(x, ...)
stepName(x)
baseCommand(x, ...)
targetsheader(x, ...)
yamlinput(x, ...)
viewEnvir(x, silent = FALSE)
copyEnvir(x, list = character(), new.env = globalenv(), silent = FALSE)
addResources(x, step, resources)
## Subset Methods
subset(x, ...)
getColumn(x, step, position = c("outfiles", "targetsWF"), column = 1,
names = SampleName(x, step))
## Replacement
appendStep(x, after = length(x), ...) <- value
yamlinput(x, paramName, ...) <- value
replaceStep(x, step, step_name = "default") <- value
renameStep(x, step, ...) <- value
dependency(x, step, ...) <- value
appendCodeLine(x, after = length(x), ...) <- value
replaceCodeLine(x, line, ...) <- value
updateColumn(x, step, position = c("outfiles", "targetsWF")) <- value
x |
An instance of class |
step |
character or numeric. Workflow step name or position index. |
silent |
If set to |
list |
a character vector naming objects to be copyied from the enviroment. |
new.env |
An environment to copy to. Default is |
resources |
|
position |
character. Options are |
column |
character or numeric. Which column will be subset from the |
names |
character vector. Names of the workflow step. |
after |
A subscript, after which the values are to be appended. |
paramName |
character. Input name from |
step_name |
character with the new step name. Default value will automatically give a name:
|
line |
numeric. Index position of the code line to be added or replaced. |
value |
object containing the values to be replaced to |
... |
Further arguments to be passed to or from other methods. |
Objects can be created by calls of the form new("SYSargsList", ...).
stepsWF:Object of class "list" storing all the
steps objects of the workflow. Each step can either be SYSargs2 or
LineWise.
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 DataFrame for each step in the workflow. For the
LineWise steps, a DataFrame with 0 rows and 0 columns will
be displayed.
outfiles:Object of class "list" storing all the
output DataFrame for each step in the workflow. For the
LineWise steps, a DataFrame with 0 rows and 0 columns will be
displayed.
SE:Object of class "list" storing all the
SummarizedExperiment objects in the workflow.
dependency:Object of class "list" storing all the
dependency graphs 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 each step in the workflow.
targets_connection:Object of class "list" storing all
targets files connection in the workflow.
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"):
extracting slots elements by name
signature(from = "list", to = "SYSargsList"):
as(list, "SYSargsList")
signature(from = "SYSargsList", to = "list"):
as(SYSargsList, "list")
signature(x = "SYSargsList"): Coerce back to
list as(SYSargsList, "list")
signature(x = "SYSargsList"): extracts number of
SYSargsList steps
signature(x = "SYSargsList"): extracts slot names
signature(object = "SYSargsList"): summary view of
SYSargsList steps
signature(x = "SYSargsList"): extract data from
stepsWF slot
signature(x = "SYSargsList"): extract data from
statusWF slot
signature(x = "SYSargsList"): extract data from
targetsWF slot
signature(x = "SYSargsList"): extract data from
outfiles slot
signature(x = "SYSargsList"): extract data from
SE slot
signature(x = "SYSargsList"): extract data from
dependency slot
signature(x = "SYSargsList"): extract data from
projectInfo slot
signature(x = "SYSargsList"): extract data from
runInfo slot
signature(x = "SYSargsList", ...):
extracts data from cmdlist slot for each SYSargs2
step
signature(x = "SYSargsList", step):
extracts data from codeLine slot for LineWise
step
signature(x = "SYSargsList", step):
extracts Sample ID from SYSargs2 instance step
signature(x = "SYSargsList"):
extracts steps names from workflow instance
signature(x = "SYSargsList", step):
extracts baseCommand from SYSargs2 instance step
signature(x = "SYSargsList", step):
extracts targetsheader from SYSargs2 instance step
signature(x = "SYSargsList", step):
extracts data from yamlinput slot for each SYSargs2
step
signature(x = "SYSargsList", silent = FALSE):
return a vector of character strings giving the names of the
objects in the SYSargsList environment
signature(x = "SYSargsList", list = character(),
new.env = globalenv(), silent = FALSE):
copy of the contents or select objects from SYSargsList
environment and place them into new.env
signature(x = "SYSargsList", step, resources):
Adds the computing resources for one or multiple steps in the workflow.
If the particular step(s) is set to be executed "management section,"
when the resources is added, the step(s) will be executed on the
"compute section."
signature(x = "SYSargsList", i = "ANY", j = "ANY", value = "ANY"):
replacement method for SYSargsList class
signature(x = "SYSargsList", after = length(x)):
insert the SYSargsList or LineWise object onto x at
the position given by after
signature(x = "SYSargsList", step, paramName ):
replace a value in the yamlinput slot for a specific step instance
signature(x = "SYSargsList", step, step_name = "default"):
replace a specific step in the workflow instance
signature(x = "SYSargsList"):
rename a stepName in the workflow instance
signature(x = "SYSargsList", step):
replace dependency graph for a specific step instance
signature(x = "SYSargsList", step, after = length(x)):
insert the R code in a specific step at the position given by after
signature(x = "SYSargsList", step, line):
replace the R code in a specific step at the position given by line
signature(x = "SYSargsList", step,
position = c("outfiles", "targetsWF")):
update or add a new column in targetsWF or outfiles slots
Daniela Cassol and Thomas Girke
SYSargs2, LineWise, and SPRproject
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")
sal
length(sal)
names(sal)
## Accessors
stepsWF(sal)
statusWF(sal)
targetsWF(sal)
outfiles(sal)
SE(sal)
dependency(sal)
projectInfo(sal)
runInfo(sal)
## Methods
cmdlist(sal, step=1, targets=1:2) ## SYSargs2 step
codeLine(sal, step=2) ## LineWise step
SampleName(sal, step="echo")
stepName(sal)
baseCommand(sal, 1) ## SYSargs2 step
targetsheader(sal, step=1) ## SYSargs2 step
yamlinput(sal, step=1) ## SYSargs2 step
viewEnvir(sal)
copyEnvir(sal, list = character(), new.env = globalenv())
resources <- list(conffile= system.file("extdata/.batchtools.conf.R",
package="systemPipeR"),
template= system.file("extdata/batchtools.slurm.tmpl",
package="systemPipeR"),
Njobs=3, ## Usually, the samples number
walltime=60, ## minutes
ntasks=1,
ncpus=4,
memory=1024 ## Mb
)
addResources(sal, 1, resources= resources)
## Subset Methods
sal_sub <- subset(sal, subset_steps=1, input_targets=1:2, keep_steps = TRUE)
sal_sub
targetsIn <- getColumn(sal, step=1, position = c("outfiles"))
targetsIn
## 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")
codeLine(sal)
yamlinput(sal, step=1, paramName="results_path") <- list(results_path=list(
class="Directory", path="./data"))
cmdlist(sal, step = 1, targets = 1)
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)