output_update: Updates the output files paths in the 'SYSargs2' object

View source: R/sysargs2_utilities.R

output_updateR Documentation

Updates the output files paths in the SYSargs2 object


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.


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



object of class SYSargs2.


assign TRUE to update the location of the output files in the args object accordingly with the workflow name directory. Default is dir=FALSE.


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 the extension for selected output files in the args object. Default is replace=FALSE.


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").


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.


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.


SYSargs2 object with output location files updated.


Daniela Cassol and Thomas Girke

See Also

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


## 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_"))

## 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)

tgirke/systemPipeR documentation built on March 27, 2024, 11:31 p.m.