Title: | An R interface to the Common Workflow Language |
---|---|
Description: | The Common Workflow Language (CWL) is an open standard for development of data analysis workflows that is portable and scalable across different tools and working environments. Rcwl provides a simple way to wrap command line tools and build CWL data analysis pipelines programmatically within R. It increases the ease of usage, development, and maintenance of CWL pipelines. |
Authors: | Qiang Hu [aut, cre], Qian Liu [aut] |
Maintainer: | Qiang Hu <[email protected]> |
License: | GPL-2 | file LICENSE |
Version: | 1.23.0 |
Built: | 2024-12-18 03:56:28 UTC |
Source: | https://github.com/bioc/Rcwl |
An R package to wrap command line tools and build pipelines with Common Workflow Language (CWL). _PACKAGE
requireDocker: If a workflow component should be run in a Docker container, this function specifies how to fetch or build the image.
requireJS: Indicates that the workflow platform must support inline Javascript expressions. If this requirement is not present, the workflow platform must not perform expression interpolatation.
requireSoftware: A list of software packages that should be configured in the environment of the defined process.
SoftwarePackage from anaconda.
InitialWorkDirRequirement: Define a list of files and subdirectories that must be created by the workflow platform in the designated output directory prior to executing the command line tool.
: Dirent: Define a file or subdirectory that must be placed in the designated output directory prior to executing the command line tool. May be the result of executing an expression, such as building a configuration file from a template.
Create manifest for configure files.
requireShellScript: create shell script to work dir.
CondaTool: create dockerfile for tools.
requireNetwork: Whether a process requires network access.
requireDocker( docker = NULL, Load = NULL, File = NULL, Import = NULL, ImageId = NULL, OutputDir = NULL ) requireJS(expressionLib = list()) requireSoftware(packages = list()) condaPackage(package, source = "bioconda", version = NULL) requireInitialWorkDir(listing = list()) Dirent(entryname = character(), entry, writable = FALSE) requireManifest(inputID, sep = "\\n") requireSubworkflow() requireScatter() requireMultipleInput() requireStepInputExpression() requireEnvVar(envlist) requireRscript(rscript) requireResource( coresMin = NULL, coresMax = NULL, ramMin = NULL, ramMax = NULL, tmpdirMin = NULL, tmpdirMax = NULL, outdirMin = NULL, outdirMax = NULL ) requireShellCommand() requireShellScript(script) ShellScript(shell = "bash", script = "script.sh") CondaTool(tools) requireNetwork(networkAccess = TRUE)
requireDocker( docker = NULL, Load = NULL, File = NULL, Import = NULL, ImageId = NULL, OutputDir = NULL ) requireJS(expressionLib = list()) requireSoftware(packages = list()) condaPackage(package, source = "bioconda", version = NULL) requireInitialWorkDir(listing = list()) Dirent(entryname = character(), entry, writable = FALSE) requireManifest(inputID, sep = "\\n") requireSubworkflow() requireScatter() requireMultipleInput() requireStepInputExpression() requireEnvVar(envlist) requireRscript(rscript) requireResource( coresMin = NULL, coresMax = NULL, ramMin = NULL, ramMax = NULL, tmpdirMin = NULL, tmpdirMax = NULL, outdirMin = NULL, outdirMax = NULL ) requireShellCommand() requireShellScript(script) ShellScript(shell = "bash", script = "script.sh") CondaTool(tools) requireNetwork(networkAccess = TRUE)
docker |
Character. Specify a Docker image to retrieve using docker pull. |
Load |
Character. Specify a HTTP URL from which to download a Docker image using docker load. |
File |
Character. Supply the contents of a Dockerfile which will be built using docker build. |
Import |
Character. Provide HTTP URL to download and gunzip a Docker images using 'docker import. |
ImageId |
Character. The image id that will be used for docker run. May be a human-readable image name or the image identifier hash. May be skipped if dockerPull is specified, in which case the dockerPull image id must be used. |
OutputDir |
Character. Set the designated output directory to a specific location inside the Docker container. |
expressionLib |
optional list. Additional code fragments that will also be inserted before executing the expression code. Allows for function definitions that may be called from CWL expressions. |
packages |
The list of software to be configured. |
package |
The software name. |
source |
The source of software in anaconda. 'bioconda' is used by default. |
version |
The version of software. |
listing |
The list of files or subdirectories that must be placed in the designated output directory prior to executing the command line tool. |
entryname |
Character or Expression. The name of the file or subdirectory to create in the output directory. The name of the file or subdirectory to create in the output directory. If entry is a File or Directory, the entryname field overrides the value of basename of the File or Directory object. Optional. |
entry |
Charactor or expression. Required. |
writable |
Logical. If true, the file or directory must be writable by the tool. Changes to the file or directory must be isolated and not visible by any other CommandLineTool process. Default is FALSE (files and directories are read-only). Optional. |
inputID |
The input ID from corresponding 'InputParam'. |
sep |
The separator of the input files in the manifest config. |
envlist |
A list of environment variables. |
rscript |
An R script to run. |
coresMin |
Minimum reserved number of CPU cores (default is 1). |
coresMax |
Maximum reserved number of CPU cores. |
ramMin |
Minimum reserved RAM in mebibytes (2**20) (default is 256). |
ramMax |
Maximum reserved RAM in mebibytes (2**20) |
tmpdirMin |
Minimum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20) (default is 1024). |
tmpdirMax |
Maximum reserved filesystem based storage for the designated temporary directory, in mebibytes (2**20). |
outdirMin |
Minimum reserved filesystem based storage for the designated output directory, in mebibytes (2**20) (default is 1024). |
outdirMax |
Maximum reserved filesystem based storage for the designated output directory, in mebibytes (2**20). |
script |
script.sh |
shell |
Default shell. |
tools |
A character vector for tools to install by conda. |
networkAccess |
TRUE or FALSE. |
More details about 'requireDocker', see: https://www.commonwl.org/v1.0/CommandLineTool.html#DockerRequirement
More details about 'requireJS', see: https://www.commonwl.org/v1.0/CommandLineTool.html#InlineJavascriptRequirement
More details about 'requireSoftware', see: https://www.commonwl.org/v1.0/CommandLineTool.html#SoftwareRequirement
More details about 'requireSoftware', see: https://www.commonwl.org/v1.0/CommandLineTool.html#SoftwarePackage
More details about 'requireInitialWorkDir', See: https://www.commonwl.org/v1.0/CommandLineTool.html#InitialWorkDirRequirement
More details about 'Dirent', See:https://www.commonwl.org/v1.0/CommandLineTool.html#Dirent
requireDocker: A list of docker requirement to fetch or build the image.
requireJS: A list of inline Javascript requirement.
requireSoftware: A list of software requirements.
A list of software package.
requireInitialWorkDir: A list of initial work directory requirements.
Dirent: A list.
requireSubworkflow: A SubworkflowFeatureRequirement list.
rquireScatter: A ScatterFeatureRequirement list.
requireMultipleInput: A MultipleInputFeatureRequirement list.
requireStepInputExpression: A StepInputExpressionRequirement list.
requireEnvVar: A EnvVarRequirementlist.
A requirement list with Rscript as manifest entry.
ResourceRequirement: A ResourceRequirement list.
ShellCommandRequirement: A ShellCommandRequirement list.
requireShellScript: Initial directory with shell script.
baseCommand for shell script
CondaTool: Dockerfile
requireNetwork: a list of NetworkAccess requirement.
p1 <- InputParam(id = "ifiles", type = "File[]?", position = -1) CAT <- cwlProcess(baseCommand = "cat", requirements = list(requireDocker("alpine"), requireManifest("ifiles"), requireJS()), arguments = list("ifiles"), inputs = InputParamList(p1))
p1 <- InputParam(id = "ifiles", type = "File[]?", position = -1) CAT <- cwlProcess(baseCommand = "cat", requirements = list(requireDocker("alpine"), requireManifest("ifiles"), requireJS()), arguments = list("ifiles"), inputs = InputParamList(p1))
The main CWL parameter class and constructor for command tools. More details: https://www.commonwl.org/v1.0/CommandLineTool.html
cwlProcess( cwlVersion = "v1.0", cwlClass = "CommandLineTool", baseCommand = character(), requirements = list(), hints = list(), arguments = list(), id = character(), label = character(), doc = character(), inputs = InputParamList(), outputs = OutputParamList(), stdout = character(), stdin = character(), expression = character(), extensions = list(), intent = list() )
cwlProcess( cwlVersion = "v1.0", cwlClass = "CommandLineTool", baseCommand = character(), requirements = list(), hints = list(), arguments = list(), id = character(), label = character(), doc = character(), inputs = InputParamList(), outputs = OutputParamList(), stdout = character(), stdin = character(), expression = character(), extensions = list(), intent = list() )
cwlVersion |
CWL version |
cwlClass |
"CommandLineTool" |
baseCommand |
Specifies the program or R function to execute |
requirements |
A list of requirements that apply to either the runtime environment or the workflow engine that must be met in order to execute this process. |
hints |
Any or a list for the workflow engine. |
arguments |
Command line bindings which are not directly associated with input parameters. |
id |
The unique identifier for this process object. |
label |
A short, human-readable label of this process object. |
doc |
A documentation string for this object, or an array of strings which should be concatenated. |
inputs |
A object of 'InputParamList'. |
outputs |
A object of 'OutputParamList'. |
stdout |
Capture the command's standard output stream to a file written to the designated output directory. |
stdin |
A path to a file whose contents must be piped into the command's standard input stream. |
expression |
Javascripts for ExpressionTool class. |
extensions |
A list of extensions and metadata |
intent |
An identifier for the type of computational operation, of this Process. |
https://www.commonwl.org/v1.0/CommandLineTool.html
A 'cwlProcess' class object.
input1 <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1))
input1 <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1))
Some useful methods for 'cwlProcess' objects.
'$': Extract input values for 'cwlProcess' object. (Can auto-complete the input names using tab)
'$<-': Set input values for 'cwlProcess' object by name.
outputs: The outputs of a 'cwlProcess' object.
stdOut: stdout of 'cwlProcess' object.
extensions: Extensions and metadata of 'cwlProcess' object.
short: The function to show a short summary of 'cwlProcess' or 'cwlWorkflow' object.
cwlVersion(cwl) cwlVersion(cwl) <- value cwlClass(cwl) cwlClass(cwl) <- value baseCommand(cwl) baseCommand(cwl) <- value arguments(cwl, step = NULL) arguments(cwl, step = NULL) <- value hints(cwl) hints(cwl) <- value requirements(cwl, step = NULL) requirements(cwl, step = NULL) <- value inputs(cwl) ## S4 method for signature 'cwlProcess' x$name ## S4 replacement method for signature 'cwlProcess' x$name <- value outputs(cwl) stdOut(cwl) stdOut(cwl) <- value extensions(cwl) extensions(cwl) <- value short(cwl)
cwlVersion(cwl) cwlVersion(cwl) <- value cwlClass(cwl) cwlClass(cwl) <- value baseCommand(cwl) baseCommand(cwl) <- value arguments(cwl, step = NULL) arguments(cwl, step = NULL) <- value hints(cwl) hints(cwl) <- value requirements(cwl, step = NULL) requirements(cwl, step = NULL) <- value inputs(cwl) ## S4 method for signature 'cwlProcess' x$name ## S4 replacement method for signature 'cwlProcess' x$name <- value outputs(cwl) stdOut(cwl) stdOut(cwl) <- value extensions(cwl) extensions(cwl) <- value short(cwl)
cwl |
A 'cwlProcess' (or 'cwlWorkflow') object. |
value |
To assign a list of 'requirements' value. |
step |
To specifiy a step ID when 'cwl' is a workflow. |
x |
A 'cwlProcess' object. |
name |
One of input list. |
cwlVersion: cwl document version
cwlClass: CWL class of 'cwlProcess' or 'cwlWorkflow' object.
baseCommand: base command for the 'cwlProcess' object.
arguments: CWL arguments.
hints: CWL hints.
requirements: CWL requirments.
inputs: A list of 'InputParam'.
'$': the 'InputParam' value for 'cwlProcess' object.
outputs: A list of 'OutputParam'.
stdOut: CWL stdout.
extensions: A list of extensions or metadata.
short: A short summary of an object of 'cwlProcess' or 'cwlWorkflow'.
ip <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(ip)) cwlVersion(echo) cwlClass(echo) baseCommand(echo) hints(echo) requirements(echo) inputs(echo) outputs(echo) stdOut(echo) extensions(echo) s1 <- cwlWorkflow() runs(s1) s1 short(s1)
ip <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(ip)) cwlVersion(echo) cwlClass(echo) baseCommand(echo) hints(echo) requirements(echo) inputs(echo) outputs(echo) stdOut(echo) extensions(echo) s1 <- cwlWorkflow() runs(s1) s1 short(s1)
Function to generate shiny app automaticlly for a 'cwlProcess' object.
cwlShiny(cwl, inputList = list(), upload = FALSE, ...)
cwlShiny(cwl, inputList = list(), upload = FALSE, ...)
cwl |
A cwlProcess object. |
inputList |
a list of choices for the inputs of cwl object. The name of the list must match the inputs of the cwl object. |
upload |
Whether to upload file. If FALSE, the upload field will be text input (file path) instead of file input. |
... |
More options for 'runCWL'. |
A shiny webapp.
input1 <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) echoApp <- cwlShiny(echo)
input1 <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) echoApp <- cwlShiny(echo)
Constructor function for 'cwlStep' object.
cwlStep( id, run = cwlProcess(), In = list(), Out = list(), scatter = character(), scatterMethod = character(), label = character(), doc = character(), requirements = list(), hints = list(), when = character() )
cwlStep( id, run = cwlProcess(), In = list(), Out = list(), scatter = character(), scatterMethod = character(), label = character(), doc = character(), requirements = list(), hints = list(), when = character() )
id |
A user-defined unique identifier for this workflow step. |
run |
A 'cwlProcess' object for command line tool, or path to a CWL file. |
In |
A list of input parameters which will be constructed into 'stepInParamList'. |
Out |
A list of outputs. |
scatter |
character or a list. The inputs to be scattered. |
scatterMethod |
required if scatter is an array of more than one element. It can be one of "dotproduct", "nested_crossproduct" and "flat_crossproduct". |
label |
A short, human-readable label of this object. |
doc |
A documentation string for this object, or an array of strings which should be concatenated. |
requirements |
Requirements that apply to either the runtime environment or the workflow engine. |
hints |
Hints applying to either the runtime environment or the workflow engine. |
when |
If defined, only run the step when the expression evaluates to true. If false the step is skipped. |
For more details: https://www.commonwl.org/v1.0/Workflow.html#WorkflowStep
An object of class 'cwlStep'.
s1 <- cwlStep(id = "s1")
s1 <- cwlStep(id = "s1")
The constructor function for 'cwlWorkflow' object, which connects multiple command line steps into a workflow.
steps: Function to extract and assign workflow step slots.
cwlWorkflow( cwlVersion = "v1.0", cwlClass = "Workflow", requirements = list(), id = character(), label = character(), doc = character(), intent = list(), hints = list(), arguments = list(), extensions = list(), inputs = InputParamList(), outputs = OutputParamList(), steps = cwlStepList() ) ## S4 method for signature 'cwlWorkflow,cwlStep' e1 + e2 steps(cwl) steps(cwl) <- value
cwlWorkflow( cwlVersion = "v1.0", cwlClass = "Workflow", requirements = list(), id = character(), label = character(), doc = character(), intent = list(), hints = list(), arguments = list(), extensions = list(), inputs = InputParamList(), outputs = OutputParamList(), steps = cwlStepList() ) ## S4 method for signature 'cwlWorkflow,cwlStep' e1 + e2 steps(cwl) steps(cwl) <- value
cwlVersion |
CWL version |
cwlClass |
"Workflow". |
requirements |
Requirements that apply to either the runtime environment or the workflow engine. |
id |
A user-defined unique identifier for this workflow. |
label |
A short, human-readable label of this object. |
doc |
A documentation string for this object. |
intent |
An identifier for the type of computational operation, of this Process. |
hints |
Any or a list for the workflow engine. |
arguments |
Command line bindings which are not directly associated with input parameters. |
extensions |
A list of extensions and metadata. |
inputs |
An object of 'InputParamList'. |
outputs |
An object of 'OutputParamList'. |
steps |
A list of 'cwlStepList'. |
e1 |
A 'cwlWorkflow' object. |
e2 |
A 'cwlStep' object. |
cwl |
A 'cwlWorkflow' object. |
value |
A list of 'cwlSteps' to assign. |
cwlWorkflow: An object of class 'cwlWorkflow'.
steps: A list of 'cwlStep' objects.
input1 <- InputParam(id = "sth") echo1 <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) input2 <- InputParam(id = "sthout", type = "File") echo2 <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input2), stdout = "out.txt") i1 <- InputParam(id = "sth") o1 <- OutputParam(id = "out", type = "File", outputSource = "echo2/output") wf <- cwlWorkflow(inputs = InputParamList(i1), outputs = OutputParamList(o1)) s1 <- cwlStep(id = "echo1", run = echo1, In = list(sth = "sth")) s2 <- cwlStep(id = "echo2", run = echo2, In = list(sthout = "echo1/output")) wf <- wf + s1 + s2
input1 <- InputParam(id = "sth") echo1 <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) input2 <- InputParam(id = "sthout", type = "File") echo2 <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input2), stdout = "out.txt") i1 <- InputParam(id = "sth") o1 <- OutputParam(id = "out", type = "File", outputSource = "echo2/output") wf <- cwlWorkflow(inputs = InputParamList(i1), outputs = OutputParamList(o1)) s1 <- cwlStep(id = "echo1", run = echo1, In = list(sth = "sth")) s2 <- cwlStep(id = "echo2", run = echo2, In = list(sthout = "echo1/output")) wf <- wf + s1 + s2
runs: The function to access all runs of a 'cwlWorkflow' object.
runs(object)
runs(object)
object |
A 'cwlWorkflow' object. |
'cwlProcess' objects or paths of CWL file.
s1 <- cwlWorkflow() runs(s1) s1 short(s1)
s1 <- cwlWorkflow() runs(s1) s1 short(s1)
Rcwl conda envrionment to install 'cwltool' by basilisk.
env_Rcwl
env_Rcwl
An object of class BasiliskEnvironment
of length 1.
InputArrayParam: Parameters for array inputs. To specify an array parameter, the array definition is nested under the type field with 'type: array' and items defining the valid data types that may appear in the array.
InputParam: parameter for a command line tool.
InputParamList: A list of 'InputParam' objects.
OutputArrayParam: Parameters for array outputs.
OutputParam: An output parameter for a Command Line Tool.
OutputParamList: A list of 'InputParam' objects.
stepInParam: The input parameter of a workflow step.
stepInParamList: A list of 'stepInParam' objects.
cwlStepList: A list of 'cwlStep' objects.
InputArrayParam( label = "", doc = character(), name = character(), type = "array", items = character(), prefix = "", separate = TRUE, itemSeparator = character(), valueFrom = character() ) InputParam( id, label = "", type = "string", doc = character(), secondaryFiles = character(), streamable = logical(), format = character(), loadListing = character(), loadContents = logical(), position = 0L, prefix = "", separate = TRUE, itemSeparator = character(), valueFrom = character(), shellQuote = logical(), default = character(), value = character() ) InputParamList(...) OutputArrayParam( label = character(), doc = character(), name = character(), type = "array", items = character() ) OutputParam( id = "output", label = character(), doc = character(), type = "stdout", format = character(), secondaryFiles = character(), streamable = logical(), glob = character(), loadContents = logical(), loadListing = character(), outputEval = character(), outputSource = character(), linkMerge = character(), pickValue = character() ) OutputParamList(out = OutputParam(), ...) stepInParam( id, source = character(), linkMerge = character(), pickValue = character(), loadContents = logical(), loadListing = character(), default = character(), valueFrom = character() ) stepInParamList(...) cwlStepList(...)
InputArrayParam( label = "", doc = character(), name = character(), type = "array", items = character(), prefix = "", separate = TRUE, itemSeparator = character(), valueFrom = character() ) InputParam( id, label = "", type = "string", doc = character(), secondaryFiles = character(), streamable = logical(), format = character(), loadListing = character(), loadContents = logical(), position = 0L, prefix = "", separate = TRUE, itemSeparator = character(), valueFrom = character(), shellQuote = logical(), default = character(), value = character() ) InputParamList(...) OutputArrayParam( label = character(), doc = character(), name = character(), type = "array", items = character() ) OutputParam( id = "output", label = character(), doc = character(), type = "stdout", format = character(), secondaryFiles = character(), streamable = logical(), glob = character(), loadContents = logical(), loadListing = character(), outputEval = character(), outputSource = character(), linkMerge = character(), pickValue = character() ) OutputParamList(out = OutputParam(), ...) stepInParam( id, source = character(), linkMerge = character(), pickValue = character(), loadContents = logical(), loadListing = character(), default = character(), valueFrom = character() ) stepInParamList(...) cwlStepList(...)
label |
A short, human-readable label of this object. |
doc |
A documentation string for this object, or an array of strings which should be concatenated. |
name |
The identifier for this type. |
type |
Specify valid types of data that may be assigned to this parameter. |
items |
Defines the type of the array elements. |
prefix |
Command line prefix to add before the value. |
separate |
If true (default), then the prefix and value must be added as separate command line arguments; if false, prefix and value must be concatenated into a single command line argument. |
itemSeparator |
Join the array elements into a single string with the elements separated by by itemSeparator. |
valueFrom |
value from string or expression. |
id |
A unique identifier for this workflow input parameter. |
secondaryFiles |
Provides a pattern or expression specifying files or directories. Only valid when type: File or is an array of items: File. |
streamable |
A value of true indicates that the file is read or written sequentially without seeking. Only valid when type: File or is an array of items: File. |
format |
Only valid when type: File or is an array of items: File. This is the file format that will be assigned to the output File object. |
loadListing |
Only valid when type: Directory or is an array of items: Directory. "no_listing", "shallow_listing" or "deep_listing". |
loadContents |
Only valid when type: File or is an array of items: File. |
position |
The position for this parameter. |
shellQuote |
If ShellCommandRequirement is in the requirements for the current command, this controls whether the value is quoted on the command line (default is true). |
default |
The default value for this parameter to use if either there is no source field, or the value produced by the source is null. |
value |
Assigned value for this parameter |
... |
A list of 'cwlStep' objects. |
glob |
Pattern to find files relative to the output directory. |
outputEval |
Evaluate an expression to generate the output value. |
outputSource |
Specifies one or more workflow parameters that supply the value of to the output parameter. |
linkMerge |
The method to use to merge multiple inbound links into a single array. |
pickValue |
The method to use to choose non-null elements among multiple sources. "first_non_null", "the_only_non_null", or "all_non_null". |
out |
The default stdout parameter. |
source |
Specifies one or more workflow parameters that will provide input to the underlying step parameter. |
More details of 'InputArrayParam', see: https://www.commonwl.org/v1.0/CommandLineTool.html#CommandInputArraySchema
More details for 'InputParam', see: https://www.commonwl.org/v1.0/CommandLineTool.html#CommandInputParameter
More details for 'OutputArrayParam', see: https://www.commonwl.org/v1.0/CommandLineTool.html#CommandOutputArraySchema
More details for 'OutputParam', see: https://www.commonwl.org/v1.0/CommandLineTool.html#CommandOutputParameter
More details for 'stepInParam', see: https://www.commonwl.org/v1.0/Workflow.html#WorkflowStepInput
InputArrayParam: An object of class 'InputArrayParam'.
An object of class 'InputParam'.
InputParamList: An object of class 'InputParamList'.
An object of class 'OutputArrayParam'.
OutputParam: An object of class 'OutputParam'.
OutputParamList: An object of class 'OutputParamList'.
stepInParam: An object of class 'stepInParam'.
An object of class 'stepInParamList'.
cwlStepList: An object of class 'cwlStepList'.
InputArrayParam(items = "string", prefix="-B=", separate = FALSE) input1 <- InputParam(id = "sth") InputParamList(input1) OutputParam(id = "b", type = OutputArrayParam(items = "File"), glob = "*.txt") o1 <- OutputParam(id = "file", type = "File", glob = "*.txt") o1 o1 <- OutputParam(id = "file", type = "File", glob = "*.txt") OutputParamList(o1) s1 <- stepInParam(id = "s1") s1 <- stepInParam(id = "s1") stepInParamList(s1) s1 <- cwlStep(id = "s1") cwlStepList(s1)
InputArrayParam(items = "string", prefix="-B=", separate = FALSE) input1 <- InputParam(id = "sth") InputParamList(input1) OutputParam(id = "b", type = OutputArrayParam(items = "File"), glob = "*.txt") o1 <- OutputParam(id = "file", type = "File", glob = "*.txt") o1 o1 <- OutputParam(id = "file", type = "File", glob = "*.txt") OutputParamList(o1) s1 <- stepInParam(id = "s1") s1 <- stepInParam(id = "s1") stepInParamList(s1) s1 <- cwlStep(id = "s1") cwlStepList(s1)
To download and install cwltool using basilisk
install_cwltool()
install_cwltool()
To download and install udocker for python3.
install_udocker(version = "1.3.4")
install_udocker(version = "1.3.4")
version |
The version of udocker. |
addMeta Add or change meta information for a cwl recipe.
meta(cwl) meta(cwl) <- value addMeta( cwl, label = character(), doc = character(), inputLabels = character(), inputDocs = character(), outputLabels = character(), outputDocs = character(), stepLabels = character(), stepDocs = character(), extensions = list() )
meta(cwl) meta(cwl) <- value addMeta( cwl, label = character(), doc = character(), inputLabels = character(), inputDocs = character(), outputLabels = character(), outputDocs = character(), stepLabels = character(), stepDocs = character(), extensions = list() )
cwl |
'cwlProcess' object for data or tool recipe. 'cwlWorkflow' object for a pipeline recipe. |
value |
A list of meta information to add to 'cwl'. |
label |
Character string specifying a label for the recipe. E.g., "bwa align", "gencode annotation". |
doc |
Character string describing the recipe. E.g, "Align reads to reference genome". |
inputLabels |
Vector of character string, specifying labels for each input parameter. |
inputDocs |
Vector of character string as descriptions for each input parameter. |
outputLabels |
Vector of character string, specifying labels for each output parameter. |
outputDocs |
Vector of character string as descriptions for each output parameter. |
stepLabels |
Vector of character string, specifying labels for each step. Use only if 'cwl' is a 'cwlWorkflow' object. |
stepDocs |
Vector of character string as description for each step. Use only if 'cwl' is a 'cwlWorkflow' object. |
extensions |
A list of character strings. Can be used to add meta information about the recipe. Generally, add fields of information that does not require execution as part of the recipe evaluation. for information about "author", "url", "date", "example", use the exact names as list names as shown in examples, so that they can be correctly passed into corresponding fields in markdown file when using 'meta2md'. Other information can be added as a list element with arbitrary names. |
'meta()': return a list of all available meta information for the 'cwl' object.
'addMeta()': 'cwlProcess' or 'cwlWorkflow' object, with added meta information, which can be returned using 'meta(cwl)'. Meta information can be converted into markdown file with 'meta2md' function.
## Not run: library(RcwlPipelines) cwlSearch(c("bwa", "align")) bwaAlign <- RcwlPipelines::cwlLoad("pl_bwaAlign") bwaAlign <- addMeta( cwl = bwaAlign, label = "align", doc = "align reads to reference genome", inputLabels = c("threads", "readgroup", "reference", "read1", "read2"), inputDocs = c("number of threads", "read groups", "reference genome", "read pair1", "read pair2"), outputLabels = c("Bam", "Idx"), outputDocs = c("outputbam file", "index file"), stepLabels = c(bwa = "bwa"), stepDocs = c(bwa = "bwa alignment")) cat(meta2md(bwaAlign)) ## End(Not run) ## Not run: rcp <- ReUseData::recipeLoad("gencode_annotation") meta(rcp) rcp1 <- addMeta( cwl = rcp, label = "", doc = "An empty description line", inputLabels = c("input label1", "input label2"), inputDocs = c("input description 1", "input description 2"), outputLabels = c("output label1"), outputDocs = c("output description 1"), extensions = list( author = "recipe author's name", url = "http://ftp.ebi.ac.uk/pub/databases/gencode/", date = as.character(Sys.Date()), example = "An example")) meta(rcp1) cat(meta2md(rcp1)) ## End(Not run)
## Not run: library(RcwlPipelines) cwlSearch(c("bwa", "align")) bwaAlign <- RcwlPipelines::cwlLoad("pl_bwaAlign") bwaAlign <- addMeta( cwl = bwaAlign, label = "align", doc = "align reads to reference genome", inputLabels = c("threads", "readgroup", "reference", "read1", "read2"), inputDocs = c("number of threads", "read groups", "reference genome", "read pair1", "read pair2"), outputLabels = c("Bam", "Idx"), outputDocs = c("outputbam file", "index file"), stepLabels = c(bwa = "bwa"), stepDocs = c(bwa = "bwa alignment")) cat(meta2md(bwaAlign)) ## End(Not run) ## Not run: rcp <- ReUseData::recipeLoad("gencode_annotation") meta(rcp) rcp1 <- addMeta( cwl = rcp, label = "", doc = "An empty description line", inputLabels = c("input label1", "input label2"), inputDocs = c("input description 1", "input description 2"), outputLabels = c("output label1"), outputDocs = c("output description 1"), extensions = list( author = "recipe author's name", url = "http://ftp.ebi.ac.uk/pub/databases/gencode/", date = as.character(Sys.Date()), example = "An example")) meta(rcp1) cat(meta2md(rcp1)) ## End(Not run)
Function to plot cwlWorkflow object.
plotCWL(cwl, output = "graph", layout = "tree", ...)
plotCWL(cwl, output = "graph", layout = "tree", ...)
cwl |
A cwlWorkflow object to plot |
output |
A string specifying the output type. An option inherits from 'render_graph' and can also be "mermaid". |
layout |
Layout from 'render_graph'. |
... |
other parameters from 'mermaid' or 'render_graph' function |
A workflow plot.
input1 <- InputParam(id = "sth") echo1 <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) input2 <- InputParam(id = "sthout", type = "File") echo2 <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input2), stdout = "out.txt") i1 <- InputParam(id = "sth") o1 <- OutputParam(id = "out", type = "File", outputSource = "echo2/output") wf <- cwlWorkflow(inputs = InputParamList(i1), outputs = OutputParamList(o1)) s1 <- cwlStep(id = "echo1", run = echo1, In = list(sth = "sth")) s2 <- cwlStep(id = "echo2", run = echo2, In = list(sthout = "echo1/output")) wf <- wf + s1 + s2 plotCWL(wf)
input1 <- InputParam(id = "sth") echo1 <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) input2 <- InputParam(id = "sthout", type = "File") echo2 <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input2), stdout = "out.txt") i1 <- InputParam(id = "sth") o1 <- OutputParam(id = "out", type = "File", outputSource = "echo2/output") wf <- cwlWorkflow(inputs = InputParamList(i1), outputs = OutputParamList(o1)) s1 <- cwlStep(id = "echo1", run = echo1, In = list(sth = "sth")) s2 <- cwlStep(id = "echo2", run = echo2, In = list(sthout = "echo1/output")) wf <- wf + s1 + s2 plotCWL(wf)
Read CWL Function to read CWL command or workflow files.
readCWL(cwlfile)
readCWL(cwlfile)
cwlfile |
The cwl file to read. |
A object of class 'cwlProcess' or 'cwlWorkflow'.
input1 <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) tf <- writeCWL(echo) readCWL(tf[1])
input1 <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) tf <- writeCWL(echo) readCWL(tf[1])
Execute a cwlProcess object with assigned inputs.
runCWL( cwl, outdir = ".", cwlRunner = "cwltool", cachedir = NULL, cwlTemp = NULL, cwlArgs = character(), stdout = TRUE, stderr = TRUE, showLog = FALSE, docker = TRUE, conda = FALSE, yml_prefix = deparse(substitute(cwl)), yml_outdir = tempfile(), ... )
runCWL( cwl, outdir = ".", cwlRunner = "cwltool", cachedir = NULL, cwlTemp = NULL, cwlArgs = character(), stdout = TRUE, stderr = TRUE, showLog = FALSE, docker = TRUE, conda = FALSE, yml_prefix = deparse(substitute(cwl)), yml_outdir = tempfile(), ... )
cwl |
A 'cwlProcess' or 'cwlWorkflow' object. |
outdir |
Output directory, default is current working directory. |
cwlRunner |
The path to the 'cwltool' or 'cwl-runner'. If not exists, the cwltool package will be installed by 'reticulate'. |
cachedir |
Directory to cache intermediate workflow outputs to avoid recomputing steps. |
cwlTemp |
File path to keep intermediate files. If a directory path is given, the intermediate files will be kept in the directory. Default is NULL to remove all intermediate files. |
cwlArgs |
The arguments for 'cwltool' or 'cwl-runner'. For example, "–debug" can work with 'cwltool' to show debug information. |
stdout |
standard output from 'system2'. |
stderr |
standard error from 'system2'. By setting it to "", the detailed running logs will return directly. |
showLog |
Whether to show log details to standard out. i.e. stderr = "". |
docker |
Whether to use docker, or "sigularity" if use Singularity runtime to run container. |
conda |
Whether to install packages using conda if 'SoftwareRequirement' is defined. |
yml_prefix |
The prefix of '.cwl' and '.yml' files that are to be internally executed. |
yml_outdir |
The output directory for the '.cwl' and '.yml' files. |
... |
The other options from 'writeCWL' and 'system2'. |
A list of outputs from tools and logs from cwltool.
input1 <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) echo$sth <- "Hello World!" ## res <- runCWL(echo)
input1 <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) echo$sth <- "Hello World!" ## res <- runCWL(echo)
run CWL with batchtools
runCWLBatch( cwl, outdir = getwd(), inputList, paramList = list(), BPPARAM = BatchtoolsParam(workers = lengths(inputList)[1]), ... )
runCWLBatch( cwl, outdir = getwd(), inputList, paramList = list(), BPPARAM = BatchtoolsParam(workers = lengths(inputList)[1]), ... )
cwl |
A 'cwlProcess' or 'cwlWorkflow' object. |
outdir |
Directory to output results |
inputList |
An input list to run in parallel. The list names must be in the inputs of cwl. Jobs will be submitted in parallel for each element in the list. The output directory of each job will be made using the name of each element under the 'outdir'. |
paramList |
A parameter list for the cwl. The list names must be in the inputs of cwl. |
BPPARAM |
The options for 'BiocParallelParam'. |
... |
The options from runCWL. |
Results from computing nodes and logs from cwltool.
Submit one CWL object with assigned values with BiocParallel.
runCWLBP(cwl, outdir, BPPARAM, ...)
runCWLBP(cwl, outdir, BPPARAM, ...)
cwl |
cwl A 'cwlProcess' or 'cwlWorkflow' object. |
outdir |
Directory for output results |
BPPARAM |
The options for 'BiocParallelParam'. |
... |
The other options from runCWL. |
Results from computing nodes and logs from cwltool.
prepare inputs for workflow from 'cwlStep' objects
stepInputs(stepList)
stepInputs(stepList)
stepList |
a list of 'cwlStep' objects. |
InputParamList.
prepare outputs for workflow from 'cwlStep' objects
stepOutputs(stepList)
stepOutputs(stepList)
stepList |
a list of 'cwlStep' objects. |
OutputParamList.
write 'cwlProcess' to cwl and yml.
writeCWL( cwl, prefix = deparse(substitute(cwl)), outdir = tempfile(), docker = TRUE, libPaths = TRUE, ... )
writeCWL( cwl, prefix = deparse(substitute(cwl)), outdir = tempfile(), docker = TRUE, libPaths = TRUE, ... )
cwl |
A 'cwlProcess' or 'cwlWorkflow' object. |
prefix |
The prefix of '.cwl' and '.yml' files to be generated. |
outdir |
The output directory for the '.cwl' and '.yml' files. |
docker |
Whether to use docker. |
libPaths |
Whether to add local R libaray paths to R script. |
... |
Other options from 'yaml::write_yaml'. |
A CWL file and A YML file.
input1 <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) writeCWL(echo)
input1 <- InputParam(id = "sth") echo <- cwlProcess(baseCommand = "echo", inputs = InputParamList(input1)) writeCWL(echo)