createWF: Constructs SYSargs2 object and creates CWL param files

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/AllClasses2.R

Description

The constructor function creates an SYSargs2 S4 class object from three input files: a CWL param and input files, and one simple tabular files, a targets file. The latter is optional for workflow steps lacking input files. Also, the function creates and saves theCWL param files. The latest storages all the parameters required for running command-line software, following the standard and specification defined on Common Workflow Language (CWL).

Usage

1
createWF(targets = NULL, commandLine, results_path = "./results", module_load = "baseCommand", file = "default", overwrite = FALSE, cwlVersion = "v1.0", class = "CommandLineTool")

Arguments

targets

Path to targets file. Assign NULL to run the pipeline without 'targets' file. This can be useful for running specific workflows which do not require input files.

commandLine

Object of class list, which provides all the parameters required for running command-line software.

results_path

Path to the results folder.

module_load

Name of software to load as character. Default is "default", which creates a subfolder and two files: *.cwl and *.yml at ./param/cwl/.

file

Default is "default", which creates a subfolder and two files: *.cwl and *.yml at ./param/cwl/. If a different location and names are required, the names of the files can be specified as a character vector.

overwrite

If set to TRUE, existing files of the same name will be overwritten.

cwlVersion

version of the Common Workflow Language. More information here: https://www.commonwl.org/.

class

Names of Common Workflow Language Specification. The following switches are accepted: CommandLineTool and Workflow.

Value

SYSargs2 object

Author(s)

Daniela Cassol and Thomas Girke

References

For more details on CWL, please consult the following page: https://www.commonwl.org/

See Also

loadWorkflow renderWF showClass("SYSargs2")

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
# "hisat2 -S ./results/_SampleName_.sam  -x ./data/tair10.fasta  -k 1  --min-intronlen 30  --max-intronlen 3000 --threads 4 -U _FASTQ_PATH1_ "
## Provide a list with all the arguments
baseCommand <- list(baseCommand="hisat2")
inputs <- list(
  "S"=list(type="File", preF="-S", yml="./results/_SampleName_.sam"),
  "x"=list(type="File", preF="-x", yml="./data/tair10.fasta"),
  "k"= list(type="int", preF="-k", yml= 1L),
  "threads"= list(type="int", preF="-threads", yml=4L),
  "min-intronlen"= list(type="int", preF="--min-intronlen", yml= 30L),
  "max-intronlen"= list(type="int", preF="--max-intronlen", yml=3000L),
  "U"=list(type="File", preF="-U", yml="./data/_FASTQ_PATH1_") )
outputs <- list("hisat2_sam"=list(type="File", "./results/_SampleName_.sam"))
commandLine <- list(baseCommand=baseCommand, inputs=inputs, outputs=outputs)
## Not run: 
## Create a SYSargs2 object and populate all the command-line
## Note: the following expects a 'param/cwl' directory within the present working directory of a user's R session.
targets <- system.file("extdata", "targets.txt", package="systemPipeR")
WF <- createWF(targets=targets, commandLine, results_path="./results", module_load="baseCommand", file = "default", overwrite = FALSE, cwlVersion = "v1.0", class = "CommandLineTool")
WF <- renderWF(WF, inputvars=c(FileName="_FASTQ_PATH1_", SampleName="_SampleName_"))
  
## End(Not run)

systemPipeR documentation built on Jan. 26, 2021, 2 a.m.