SYSargs-class {systemPipeR} | R Documentation

## Class `"SYSargs"`

### Description

S4 class container for storing parameters of command-line- or R-based software. `SYSargs` instances are constructed by the `systemArgs` function from two simple tablular files: a `targets` file and a `param` file. The latter is optional for workflow steps lacking command-line software. Typically, a `SYSargs` instance stores all sample-level inputs as well as the paths to the corresponding outputs generated by command-line- or R-based software generating sample-level output files. Each sample level input/outfile operation uses its own `SYSargs` instance. The outpaths of `SYSargs` usually define the sample inputs for the next `SYSargs` instance. This connectivity is achieved by writing the outpaths with the `writeTargetsout` function to a new targets file that serves as input to the next `systemArgs` call. By chaining several `SYSargs` steps together one can construct complex workflows involving many sample-level input/output file operations with any combinaton of command-line or R-based software.

### Objects from the Class

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

### Slots

`targetsin`:

  Object of class `"data.frame"` storing tabular data from targets input file

`targetsout`:

  Object of class `"data.frame"` storing tabular data from targets output file

`targetsheader`:

  Object of class `"character"` storing header/comment lines of targets file

`modules`:

  Object of class `"character"` storing software versions from module system

`software`:

  Object of class `"character"` name of executable of command-line software

`cores`:

  Object of class `"numeric"` number of CPU cores to use

`other`:

  Object of class `"character"` additional arguments

`reference`:

  Object of class `"character"` path to reference genome file

`results`:

  Object of class `"character"` path to results directory

`infile1`:

  Object of class `"character"` paths to first FASTQ file

`infile2`:

  Object of class `"character"` paths to second FASTQ file if data is PE

`outfile1`:

  Object of class `"character"` paths to output files generated by command-line software

`sysargs`:

  Object of class `"character"` full commands used to execute external software

`outpaths`:

  Object of class `"character"` paths to final outputs including postprocessing by `Rsamtools`

### Methods

SampleName

  `signature(x = "SYSargs")`: extracts sample names

[

  `signature(x = "SYSargs")`: subsetting of class with bracket operator

coerce

  `signature(from = "list", to = "SYSargs")`: `as(list, "SYSargs")`

cores

  `signature(x = "SYSargs")`: extracts data from `cores` slot

infile1

  `signature(x = "SYSargs")`: extracts data from `infile1` slot

infile2

  `signature(x = "SYSargs")`: extracts data from `infile2` slot

modules

  `signature(x = "SYSargs")`: extracts data from `modules` slot

names

  `signature(x = "SYSargs")`: extracts slot names

length

  `signature(x = "SYSargs")`: extracts number of samples

other

  `signature(x = "SYSargs")`: extracts data from `other` slot

outfile1

  `signature(x = "SYSargs")`: extracts data from `outfile1` slot

outpaths

  `signature(x = "SYSargs")`: extracts data from `outpath` slot

reference

  `signature(x = "SYSargs")`: extracts data from `reference` slot

results

  `signature(x = "SYSargs")`: extracts data from `results` slot

show

  `signature(object = "SYSargs")`: summary view of `SYSargs` objects

software

  `signature(x = "SYSargs")`: extracts data from `software` slot

targetsheader

  `signature(x = "SYSargs")`: extracts data from `targetsheader` slot

targetsin

  `signature(x = "SYSargs")`: extracts data from `targetsin` slot

targetsout

  `signature(x = "SYSargs")`: extracts data from `targetsout` slot

### Author(s)

Thomas Girke

### See Also

`systemArgs` and `runCommandline`

### Examples

    showClass("SYSargs")
    ## Construct SYSargs object from param and targets files
    param <- system.file("extdata", "tophat.param", package="systemPipeR")
    targets <- system.file("extdata", "targets.txt", package="systemPipeR")
    args <- systemArgs(sysma=param, mytargets=targets)
    args
    names(args); targetsin(args); targetsout(args); targetsheader(args);
    software(args); modules(args); cores(args); outpaths(args)
    sysargs(args); other(args); reference(args); results(args); infile1(args)
    infile2(args); outfile1(args); SampleName(args)

    ## Return sample comparisons
    readComp(args, format = "vector", delim = "-")

    ## The subsetting operator '[' allows to select specific samples
    args[1:4]

    ## Not run:
    ## Execute SYSargs on single machine
    runCommandline(args=args)

    ## Execute SYSargs on multiple machines
    qsubargs <- getQsubargs(queue="batch", Nnodes="nodes=1", cores=cores(args), memory="mem=10gb", time="walltime=20:00:00")
    qsubRun(appfct="runCommandline(args=args)", appargs=args, qsubargs=qsubargs, Nqsubs=1, submitdir="results", package="systemPipeR")

    ## Write outpaths to new targets file for next SYSargs step
    writeTargetsout(x=args, file="default")

    ## End(Not run)

[Package systemPipeR version 1.16.1 Index]