createParam | R Documentation |
The constructor function creates an SYSargs2
S4 class object from
command-line string. Also, the function creates and saves the CWL 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).
createParamFiles(commandline, cwlVersion = "v1.1", class = "CommandLineTool",
results_path = "./results", module_load = "baseCommand",
file = "default", syntaxVersion = "v1",
writeParamFiles = TRUE, confirm = FALSE,
overwrite = FALSE, silent = FALSE)
writeParamFiles(sysargs, file = "default", overwrite = TRUE, silent = FALSE,
syntaxVersion = "v1")
commandline |
string. Original command-line to create the CWL files from. Please see
|
cwlVersion |
string. The version of the Common Workflow Language. More information here: https://www.commonwl.org/. |
class |
character. Name of Common Workflow Language Description class. The following
is accepted: |
results_path |
Path to the results folder. Default is |
module_load |
string, Name of software to load by Environment Modules system. Default is
"baseCommand", which creates a subfolder and two files: *.cwl and *.yml
at |
file |
character. Name and path of output files. If set to "default" then the name of
the output files will have the pattern |
syntaxVersion |
character. One of |
writeParamFiles |
logical. If set to TRUE, it will write to file the content of the CWL
files: |
confirm |
If set to |
overwrite |
logical. If set to TRUE, existing files of the same name will be overwritten.
Default is |
silent |
logical. If set to TRUE, all messages returned by the function will be
suppressed. Default is |
sysargs |
Object of class |
- First line of the command-line object will be treated as the
baseCommand
;
- For argument lines (starting from the second line), any word before the first
space with leading '-' or '–' in each will be treated as a prefix, like
-S
or --min
. Any line without this first word will be treated
as no prefix;
- All defaults are placed inside <...>
;
- First argument is the input argument type. F
for "File", int
for integer, string
for string;
- Optional: use the keyword out
followed the type with a ,
comma
separation to indicate if this argument is also a CWL output;
- Then, use :
to separate keywords and default values, any non-space
value after the :
will be treated as the default value;
- If any argument has no default value, just a flag, like --verbose
,
there no need to add any <...>
.
- The \
is not required, however for consistency it is recommended to add.
- First line of the command-line object will be treated as the
baseCommand
;
- Each line specifies one argument and its default value.
- Each line is composed with exact 2 ;
to seprate 3 columns.
- Text before first ;
will be will used as prefix/names.
If it starts with keyword "p:
", anything after "p:
"
and before the first ;
will be used as prefix, and the name
of this position will be the prefix but with leading dash(s) "-
",
"-
" removed. If there is any duplication, a number index will be
added to the end. If there is no keyword "p:
" before first ;
,
all text before first ;
will be the name.
- If there is keyword "p:
" before first ;
but nothing before
and after the second ;
, this position will be treated as CWL argument
instead of input.
- Text between first and second ;
is type. Must be one of File, Directory,
string, int, double, float, long, boolean.
- Text after second ;
and before \
or end of the line is the
default value. If it starts with keyword "out
" or "stdout
", this
position will also be added to outputs or standard output.
- There is only 1 position with "stdout
" allowed and usually it is the
last position arguement.
- Ending with "\
" is recommended but not required.
SYSargs2
object
Le Zhang and Daniela Cassol
For more details on CWL
, please consult the following
page: https://www.commonwl.org/
writeParamFiles
printParam
subsetParam
replaceParam
renameParam
appendParam
loadWorkflow
renderWF
showClass("SYSargs2")
## syntax version 1 example
command <- "
hisat2 \
-S <F, out: ./results/M1A.sam> \
-x <F: ./data/tair10.fasta> \
-k <int: 1> \
-min-intronlen <int: 30> \
-max-intronlen <int: 3000> \
-threads <int: 4> \
-U <F: ./data/SRR446027_1.fastq.gz> \
--verbose
"
cmd <- createParam(command, writeParamFiles=FALSE)
cmdlist(cmd)
## syntax version 2 example
command2 <- '
mycmd2 \
p: -s; File; sample1.txt \
p: -s; File; sample2.txt \
p: --c; ; \
p: -o; File; out: myout.txt \
ref_genome; File; a.fasta \
p: --nn; int; 12 \
mystdout; File; stdout: abc.txt
'
cmd2 <- createParam(command2, syntaxVersion = "v2", writeParamFiles=FALSE)
cmdlist(cmd2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.