subsetWF: Subsetting SYSargs2 class slots

View source: R/sysargs2_utilities.R

subsetWFR Documentation

Subsetting SYSargs2 class slots


Return subsets of character for the input, output or the list of command-line for each workflow step.


subsetWF(args, slot, subset=NULL, index=NULL, delete=FALSE)



object of class SYSargs2.


three options available: type="input" returns input slot from SYSargs2 object; type="output" returns output slot from SYSargs2 object; and type="step" returns all the command-line for each workflow step from SYSargs2 object.


name or numeric position of the values to be subsetting in the slot. If slot="input", the subset are the variables defined in the param.yml file. If slot="step", the subset is the command line defined on the SYSargs2 object for all the steps of the workflow. If slot="output", the subset is the path for the expected output files for all the steps in the workflow. Default is subset=NULL


A numeric index positions of the file in SYSargs2 object, slot output. It requires a subset to be defined. Default is index=NULL.


allows to delete a subset of files in the case of slot="output". Default is delete=NULL.


Daniela Cassol and Thomas Girke

See Also

loadWorkflow renderWF


## Construct SYSargs2 object 
targets <- system.file("extdata", "targets.txt", package="systemPipeR")
dir_path <- system.file("extdata/cwl", package="systemPipeR")
WF <- loadWorkflow(targets=targets, wf_file="hisat2/hisat2-mapping-se.cwl", 
                  input_file="hisat2/hisat2-mapping-se.yml", dir_path=dir_path)
WF <- renderWF(WF, inputvars=c(FileName="_FASTQ_PATH1_", SampleName="_SampleName_"))

## Testing subset_wf function
input <- subsetWF(WF, slot="input", subset='FileName')
output <- subsetWF(WF, slot="output", subset=1, index=1)
step.cmd <- subsetWF(WF, slot="step", subset=1) ## subset all the HISAT2 commandline 
# subsetWF(WF, slot="output", subset=1, index=1, delete=TRUE) ## in order to delete the subset files list

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