SYSargs2
objectoutput_update.Rd
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.
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_"))
WF
#> Instance of 'SYSargs2':
#> Slot names/accessors:
#> targets: 18 (M1A...V12B), targetsheader: 4 (lines)
#> modules: 1
#> wf: 0, clt: 1, yamlinput: 7 (inputs)
#> input: 18, output: 18
#> cmdlist: 18
#> Sub Steps:
#> 1. hisat2-mapping-se (rendered: TRUE)
#>
#>
output(WF)
#> $M1A
#> $M1A$`hisat2-mapping-se`
#> [1] "./results/M1A.sam"
#>
#>
#> $M1B
#> $M1B$`hisat2-mapping-se`
#> [1] "./results/M1B.sam"
#>
#>
#> $A1A
#> $A1A$`hisat2-mapping-se`
#> [1] "./results/A1A.sam"
#>
#>
#> $A1B
#> $A1B$`hisat2-mapping-se`
#> [1] "./results/A1B.sam"
#>
#>
#> $V1A
#> $V1A$`hisat2-mapping-se`
#> [1] "./results/V1A.sam"
#>
#>
#> $V1B
#> $V1B$`hisat2-mapping-se`
#> [1] "./results/V1B.sam"
#>
#>
#> $M6A
#> $M6A$`hisat2-mapping-se`
#> [1] "./results/M6A.sam"
#>
#>
#> $M6B
#> $M6B$`hisat2-mapping-se`
#> [1] "./results/M6B.sam"
#>
#>
#> $A6A
#> $A6A$`hisat2-mapping-se`
#> [1] "./results/A6A.sam"
#>
#>
#> $A6B
#> $A6B$`hisat2-mapping-se`
#> [1] "./results/A6B.sam"
#>
#>
#> $V6A
#> $V6A$`hisat2-mapping-se`
#> [1] "./results/V6A.sam"
#>
#>
#> $V6B
#> $V6B$`hisat2-mapping-se`
#> [1] "./results/V6B.sam"
#>
#>
#> $M12A
#> $M12A$`hisat2-mapping-se`
#> [1] "./results/M12A.sam"
#>
#>
#> $M12B
#> $M12B$`hisat2-mapping-se`
#> [1] "./results/M12B.sam"
#>
#>
#> $A12A
#> $A12A$`hisat2-mapping-se`
#> [1] "./results/A12A.sam"
#>
#>
#> $A12B
#> $A12B$`hisat2-mapping-se`
#> [1] "./results/A12B.sam"
#>
#>
#> $V12A
#> $V12A$`hisat2-mapping-se`
#> [1] "./results/V12A.sam"
#>
#>
#> $V12B
#> $V12B$`hisat2-mapping-se`
#> [1] "./results/V12B.sam"
#>
#>
if (FALSE) {
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"))
}