filter_trim {MiscMetabar} | R Documentation |
A wrapper of the function dada2::filterAndTrim()
to use in
targets pipeline
Description
This function filter and trim (with parameters passed on to
dada2::filterAndTrim()
function) forward sequences or paired end
sequence if 'rev' parameter is set. It return the list of files to
subsequent analysis in a targets pipeline.
Usage
filter_trim(
fw = NULL,
rev = NULL,
output_fw = paste(getwd(), "/output/filterAndTrim_fwd", sep = ""),
output_rev = paste(getwd(), "/output/filterAndTrim_rev", sep = ""),
...
)
Arguments
fw |
(required) a list of forward fastq files |
rev |
a list of reverse fastq files for paired end trimming |
output_fw |
Path to output folder for forward files. By default, this function will create a folder "output/filterAndTrim_fwd" in the current working directory. |
output_rev |
Path to output folder for reverse files. By default, this function will create a folder "output/filterAndTrim_fwd" in the current working directory. |
... |
Other parameters passed on to |
Value
A list of files. If rev is set, will return a list of two lists. The first list is a list of forward files, and the second one is a list of reverse files.
Author(s)
Adrien Taudière
See Also
Examples
testFastqs_fw <- c(
system.file("extdata", "sam1F.fastq.gz", package = "dada2"),
system.file("extdata", "sam2F.fastq.gz", package = "dada2")
)
testFastqs_rev <- c(
system.file("extdata", "sam1R.fastq.gz", package = "dada2"),
system.file("extdata", "sam2R.fastq.gz", package = "dada2")
)
filt_fastq_fw <- filter_trim(testFastqs_fw, output_fw = tempdir())
derep_fw <- derepFastq(filt_fastq_fw[1])
derep_fw
filt_fastq_pe <- filter_trim(testFastqs_fw,
testFastqs_rev,
output_fw = tempdir("fw"),
output_rev = tempdir("rev")
)
derep_fw_pe <- derepFastq(filt_fastq_pe[[1]])
derep_rv_pe <- derepFastq(filt_fastq_pe[[2]])
derep_fw_pe
derep_rv_pe