initWF {systemPipeR} | R Documentation

## Workflow Project Initiation

### Description

Collection of functions to construct `SYSargsList` workflow control environment (S4 object). `initWF` function constructs `SYSargsList` S4 class objects from a script file. The latter is an `RMarkdown` file containing all the workflow steps. In the future, it will be accepting other formats, as `Rscript` and `bash`. This file is defined either by the `sysconfig` file or `script` argument. Internally, `initWF` function calls `initProject` function, which creates a storage folder for all the logs, and the output to stdout or stderr. This function also creates the `SYSconfig.yml` on the fly to register all the parameters of the workflow. This function checks the project structure, which by default is:

- `SYSproject/`

  - `data/`

  - `param/`

  - `results/`

The default structure of the project directories can be modified here.

### Usage

    initWF(sysconfig = NULL, subProj = FALSE, dir_str = "level0", dirName = "default",
    script, targets = NULL, silent = FALSE, overwrite = FALSE)

    initProject(projPath = "./", data = "data", param = "param", results = "results",
    script = NULL, targets = NULL, subProj = FALSE, filename = "SYSconfig.yml",
    overwrite = FALSE, silent = FALSE)

    SYSproject(projPath = "./", overwrite = FALSE, silent = FALSE, tempdir = FALSE)

### Arguments

`sysconfig` | a character vector of a full `sysconfig` file path name. Default is `NULL`, which the function understand that the `Rmd` will be provide.
`subProj` | is set TRUE, the project will be initialized and a new directory will be generated, at the same level as the current project, maintaining the directory structure. It will create an empty `results` folder, coping the `param` from the current project, and creating a symbolic link for the `data` folder.
`dir_str` | if `subProj` is set TRUE, it will create a directory on the same level of the current location.Default is `level0`.
`dirName` | if `subProj` is set TRUE, the directory name can be defined here.
`script` | a character vector of a full `script` file path name. This file containing all the information to run all the steps on the workflow analysis. The current format accepted is `Rmd`.
`targets` | a character vector of a full `sample annotation file` path name. Default is `NULL`. The targets file can be either a simple tabular or yml file. Also, it is possible to assign NULL to run the pipeline without the 'targets' file. This can be useful for running specific workflows that do not require input files.
`silent` | if set to TRUE, all messages returned by the function will be suppressed.
`overwrite` | if set to TRUE, existing files or directories of same name will be overwritten.
`projPath` | a character vector of a full project path name. Default is the current path.
`data` | a character vector of a `data` directory name. Default is `data`. This subdirectory in the project stores all the raw data, reference, and annotation files.
`param` | a character vector of a `param` directory name. Default is `param`. This subdirectory in the project stores all the parameter and configuration files.
`results` | a character vector of a `results` directory name. Default is `results`. This subdirectory in the project stores all the analysis results, including but not limited: alignment, variant, and peak files (BAM, VCF, BED); tabular result files; and image/plot files.
`filename` | name and path of the output file which will store all the project configuration information. Default is `SYSconfig.yml`.
`tempdir` | if set to TRUE, the temporary directory for the workflow management files will be created.

### Details

`SYSproject` function detects and creates the project directory to store all the flat files from the workflow management. If `overwrite` is TRUE, the previous folder will be deleted and replace for a new one. Also, the user can choose to store all this information on a temporary folder, setting `tempdir` = TRUE.

`initProject` function detects an existing project or creates a project structure on the path provide.

### Value

`SYSproject` will return a character vector containing the path name. `initProject` will return a list containing all the information in the `sysconfig` file. `initWF` will return a `SYSargsList` object.

### Author(s)

Daniela Cassol and Thomas Girke

### See Also

See also as `SYSargsList-class`.

### Examples

    ## Not run:
    ## Construct SYSargsList object from Rmd file
    library(systemPipeRdata)
    script <- system.file("extdata/workflows/rnaseq", "systemPipeRNAseq.Rmd", package="systemPipeRdata")
    targets <- system.file("extdata", "targets.txt", package="systemPipeR")
    dir_path <- tempdir()
    SYSconfig <- initProject(projPath=dir_path, targets=targets, script=script, overwrite = TRUE)
    sysargslist <- initWF(sysconfig ="SYSconfig.yml")

    ## End(Not run)

[Package systemPipeR version 1.24.6 Index]