Main function
There is two important function in this package.
Function process_inputs()
This function takes as inputs a list of expected options with their default values, the argument string and different validation rules.
Parameter opt
This parameter should list all the different variable that you might use in the main script. You can set them to a default value or event directly initialize them with Nextflow variable such as:
Parameter args
The argument string correspond to ${task.ext.args} in
Nextflow and will be parsed with parse_arguments(). This
function expect all arguments to be in the form
--key value. Key only argument will be interpreted as
TRUE such as --is-test will give back
list("is-test" = "TRUE"). Beware that is is for the moment
a string value.
If you need spaces for one value, use bracket around it, such as
--key "value with space". All the key / value pairs will
then overwrite their counter part in the options list passe to
process_inputs().
Validation rules
The process_inputs() function will enforce the following
rules to the keys listed:
keys_to_nullify: will be set to RNULLvalue if is “null” or emptyexpected_files: these paths should be existing filesexpected_folders: these path should be existing folderexpected_double: these values will be converted withas.double()or should beNULLexpected_integer: these values will be converted withas.integer()or should beNULLexpected_boolean: these values will be converted to TRUE/FALSE or should beNULLaccepted values are:- TRUE: 1, yes, true
- FALSE: 0, no, false
required_opts: these keys should be non-null values
Function process_end()
This function will emit a versions.yml and a
R_sessionInfo.log file in the directory provided. The
version file will be populated with the R version, the version of
nfcore.utils and the version of the additional packages given.