preprocessReads.Rd
Applies custom read preprocessing functions to single-end or paired-end FASTQ
files. The function uses the FastqStreamer
function from the ShortRead
package to stream through large files in a memory-efficient manner.
preprocessReads(args = NULL,
FileName1 = NULL, FileName2 = NULL,
outfile1 = NULL, outfile2 = NULL,
Fct, batchsize = 100000, overwrite = TRUE, ...)
Object of class SYSargs
or SYSargs2
.
Path to input forward fastq file. Defaul is NULL
.
Path to input reverse fastq file. Defaul is NULL
Path to output forward fastq file. Defaul is NULL
Path to output reverse fastq file. Defaul is NULL
character
string of custom read preprocessing function call where both the
input and output needs to be an object of class ShortReadQ
. The name of the
input ShortReadQ
object needs to be fq
.
Number of reads to process in each iteration by the internally used FastqStreamer
function.
If TRUE
existing file will be overwritten.
To pass on additional arguments to the internally used writeFastq
function.
Writes to files in FASTQ format. Their names are specified by outpaths(args)
.
FastqStreamer
## Preprocessing of single-end reads
dir_path <- system.file("extdata/cwl/preprocessReads/trim-se", package="systemPipeR")
targetspath <- system.file("extdata", "targets.txt", package="systemPipeR")
trim <- loadWorkflow(targets=targetspath, wf_file="trim-se.cwl", input_file="trim-se.yml", dir_path=dir_path)
trim <- renderWF(trim, inputvars=c(FileName="_FASTQ_PATH1_", SampleName="_SampleName_"))
if (FALSE) {
preprocessReads(args=trim[1], Fct="trimLRPatterns(Rpattern='GCCCGGGTAA', subject=fq)", batchsize=100000, overwrite=TRUE, compress=TRUE)
}
## Preprocessing of paired-end reads
dir_path <- system.file("extdata/cwl/preprocessReads/trim-pe", package="systemPipeR")
targetspath <- system.file("extdata", "targetsPE.txt", package="systemPipeR")
trim <- loadWorkflow(targets=targetspath, wf_file="trim-pe.cwl", input_file="trim-pe.yml", dir_path=dir_path)
trim <- renderWF(trim, inputvars=c(FileName1="_FASTQ_PATH1_", FileName2="_FASTQ_PATH2_", SampleName="_SampleName_"))
trim
#> Instance of 'SYSargs2':
#> Slot names/accessors:
#> targets: 18 (M1A...V12B), targetsheader: 4 (lines)
#> modules: 0
#> wf: 0, clt: 1, yamlinput: 6 (inputs)
#> input: 18, output: 18
#> cmdlist: 18
#> Sub Steps:
#> 1. trim-pe (rendered: TRUE)
#>
#>
if (FALSE) {
preprocessReads(args=trim[1], Fct="trimLRPatterns(Rpattern='GCCCGGGTAA', subject=fq)", batchsize=100000, overwrite=TRUE, compress=TRUE)
}