output_update {systemPipeR} | R Documentation

## Updates the output files paths in the `SYSargs2` object

### Description

After executing all the command-lines by the `runCommadline` function, the output files can be created in specific directories rather then `results` in a particular directory. Also, the `runCommadline` function allows converting the SAM file outputs to sorted and indexed BAM files. Thus, the `output_update` function allows updating the location of these files in the output of the `SYSargs2` object.

### Usage

    output_update(args, dir = FALSE, dir.name = NULL, replace = FALSE, extension = NULL, make_bam=FALSE, del_sam=TRUE)

### Arguments

`args` | object of class `SYSargs2`.
`dir` | assign `TRUE` to update the location of the output files in the `args` object accordingly with the workflow name directory. Default is `dir=FALSE`.
`dir.name` | if the results directory name is not specified in the `input` file, it is possible to specify here the name. This argument is required if the path name return `NULL` from the `input` file. Default is `dir.name=NULL`.
`replace` | replace the extension for selected output files in the `args` object. Default is `replace=FALSE`.
`extension` | object of class `"character"` storing the current extension of the files and the respective replacement. For example, `runCommandline` function by default autodetects SAM file outputs in the `args` object and create the BAM files. In order to update the output of `args` object, the extension argument should be set: extension = c(`".sam"`, `".bam"`).
`make_bam` | Auto detects SAM file outputs and update them on the `SYSargs2` object for sorted and indexed BAM files. Default is `make_bam=FALSE`. This argument should be used in integration with `runCommandline` function.
`del_sam` | This option allows deleting the SAM files created when the `make_BAM` converts the SAM files to sorted and indexed BAM files. Default is `del_sam=TRUE`.

### Value

`SYSargs2` object with output location files updated.

### Author(s)

Daniela Cassol and Thomas Girke

### See Also

To check directory name in the `input` file: `yamlinput(WF)$results_path$path`.

### Examples

    ## Construct SYSargs2 object from CWl param, CWL input, and targets files
    targets <- system.file("extdata", "targets.txt", package="systemPipeR")
    dir_path <- system.file("extdata/cwl", package="systemPipeR")
    WF <- loadWorkflow(targets=targets, wf_file="hisat2/hisat2-mapping-se.cwl",
                      input_file="hisat2/hisat2-mapping-se.yml", dir_path=dir_path)
    WF <- renderWF(WF, inputvars=c(FileName="_FASTQ_PATH1_", SampleName="_SampleName_"))
    WF
    output(WF)

    ## Not run:
    runCommandline(args=WF, make_bam=TRUE)
    ## Output paths update
    WF <- output_update(WF, dir=FALSE, replace=TRUE, extension=c(".sam", ".bam"))

    runCommandline(args=WF, make_bam=TRUE, dir=TRUE)
    ## Output paths update
    WF <- output_update(WF, dir=TRUE, replace=TRUE, extension=c(".sam", ".bam"))

    ## End(Not run)

[Package systemPipeR version 2.0.8 Index]