SYSargs2-class: Class '"SYSargs2"'

SYSargs2-classR Documentation

Class "SYSargs2"

Description

SYSargs2 class stores all the information and instructions needed for processing a set of input files with a specific command-line or a series of command-line within a workflow. The SYSargs2 S4 class object is created from the loadWF and renderWF function, which populates all the command-line for each sample in each step of the particular workflow. Each sample level input/outfile operation uses its own SYSargs2 instance. The output of SYSargs2 define all the expected output files for each step in the workflow, which usually it is the sample input for the next step in an SYSargs2 instance. By chaining several SYSargs2 steps together one can construct complex workflows involving many sample-level input/output file operations with any combination of command-line or R-based software.

Objects from the Class

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

Slots

targets:

Object of class "list" storing data from each sample from targets file

targetsheader:

Object of class "list" storing header/comment lines of targets file

modules:

Object of class "list" storing software versions from module system

wf:

Object of class "list" storing data from Workflow CWL parameters file

clt:

Object of class "list" storing data from each CommandLineTool substep in the Workflow or the single CommandLineTool CWL parameters file

yamlinput:

Object of class "list" storing data from input (*.yml) file

cmdlist:

Object of class "list" storing all command-line used to execute external software

input:

Object of class "list" storing data from each target defined in inputvars

output:

Object of class "list" paths to final outputs files

files:

Object of class "list" paths to input and CWL parameters files

inputvars:

Object of class "list" storing data from each inputvars

cmdToCwl:

Object of class "list" storing data from each cmdToCwl

status:

Object of class "list" storing data from each status

internal_outfiles:

Object of class "list" storing raw data from each output

Methods

[

Subsetting of class with bracket operator.

[[

Subsetting of class with bracket operator.

[[<-

Replacement method for "SYSargs2" class.

$

Extracting slots elements by name.

length

Extracts number of samples.

names

Extracts slot names.

show

Summary view of SYSargs2 objects.

coerce

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

coerce

signature(from = "SYSargs2", to = "list")as(SYSargs2, "list")

coerce

signature(from = "SYSargs2", to = "DataFrame"): as(x, "DataFrame"); for targets slot.

sysargs2

Coerce back to list as(SYSargs2, "list")

targets

Extract data from targets slot.

targetsheader

Extracts data from targetsheader slot.

modules

Extracts data from modules slot.

wf

Extracts data from wf slot.

clt

Extracts data from clt slot.

yamlinput

Extracts data from yamlinput slot.

cmdlist

Extracts data from cmdlist slot.

input

Extracts data from input slot.

output

Extracts data from cmdlist slot.

files

Extracts data from files slot.

inputvars

Extracts data from inputvars slot.

cmdToCwl

Extracts data from cmdToCwl slot.

status

Extracts data from status slot.

infile1

extracting paths to first FASTQ file.

infile2

extracting paths to second FASTQ file if data is PE.

baseCommand

Extracts baseCommand from command-line used to execute external software.

SampleName

Extracts all samples names.

yamlinput<-

Replacement method for yamlinput slot input.

Author(s)

Daniela Cassol and Thomas Girke

See Also

loadWF and renderWF and runCommandline and clusterRun

Examples

showClass("SYSargs2")

## Construct SYSargs2 object from CWl param, CWL input, and targets files 
targetspath <- system.file("extdata/cwl/example/targets_example.txt", package="systemPipeR")
dir_path <- system.file("extdata/cwl", package="systemPipeR")
WF <- loadWorkflow(targets=targetspath, 
                  wf_file="example/workflow_example.cwl", 
                  input_file="example/example.yml", 
                  dir_path=dir_path)
WF <- renderWF(WF, inputvars=c(Message = "_STRING_", SampleName = "_SAMPLE_"))
WF

## Methods
names(WF)
length(WF)
baseCommand(WF)
SampleName(WF)

## Accessors
targets(WF)
targetsheader(WF)
modules(WF)
yamlinput(WF)
cmdlist(WF)
input(WF)
output(WF)
files(WF)
inputvars(WF)
cmdToCwl(WF)
status(WF)

## The subsetting operator '[' allows to select specific command-line/sample
WF2 <- WF[1:2]

## Not run: 
## Execute SYSargs2 on single machine
WF2 <- runCommandline(WF2)

## End(Not run)
## Not run: 
## Execute SYSargs2 on multiple machines of a compute cluster. The following
## example uses the conf and template files for the Slurm scheduler. Please 
## read the instructions on how to obtain the corresponding files for other schedulers.  
file.copy(system.file("extdata", ".batchtools.conf.R", package="systemPipeR"), ".")
file.copy(system.file("extdata", "batchtools.slurm.tmpl", package="systemPipeR"), ".")
resources <- list(walltime=120, ntasks=1, ncpus=4, memory=1024) 
reg <- clusterRun(WF, FUN = runCommandline, conffile=".batchtools.conf.R", 
                  template="batchtools.slurm.tmpl", Njobs=2, runid="01", resourceList=resources)

## Monitor progress of submitted jobs
getStatus(reg=reg)


## End(Not run)

tgirke/systemPipeR documentation built on March 27, 2024, 11:31 p.m.