writeTargetsout | R Documentation |
Convenience write function for generating targets files with updated
FileName
columns containing the paths to files generated
by input/output processes. These processes can be commandline- or R-based software.
Typically, the paths to the inputs are stored in the targets infile
(targetsin(args)
for SYSargs
objects or targets.as.df(targets(WF))
for SYSargs2
objects) and the outputs are stored in the targets outfile
(targetsout(args)
for SYSargs
objects or output(WF)
) for
SYSargs2
objects. Note: by default the function cannot overwrite
any existing files. If a file exists then the user has to explicitly
remove it or set overwrite=TRUE
.
writeTargetsout(x, file = "default", silent = FALSE, overwrite = FALSE, step = NULL, new_col=NULL, new_col_output_index=NULL, remove=FALSE, ...)
x |
Object of class |
file |
Name and path of the output file. If set to "default" then the name of the output file will have the pattern 'targets_<software>.txt', where <software> will be what |
silent |
If set to |
overwrite |
If set to |
step |
Name or numeric position of the step in the workflow to write the output files. The names can be check running |
new_col |
A vector of character strings of the new column name to add to target file. |
new_col_output_index |
A vector of numeric index positions of the file in |
remove |
To remove the original columns. Default is |
... |
To pass on additional arguments. |
Writes tabular targes files containing the header/comment lines from targetsheader(x)
and the columns from targetsout(x)
.
Daniela Cassol and Thomas Girke
writeTargetsRef
##########################################
## Examples with \code{SYSargs2} object ##
##########################################
## Construct SYSargs2 object
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
## Write targets out file
names(WF$clt)
writeTargetsout(x=WF, file="default", step=1, new_col=c("sam_file"), new_col_output_index=c(1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.