trimFastq: Trim the fastq files

Description Usage Arguments Value Author(s) Examples

Description

Given the argument of trimLeft, trimRight and minTailQuality, this function trims the fastq files and generate the new files.

Usage

1
2
3
  trimFastq(reads1, outputDir=".", paired=TRUE, nReads=-1L, 
            minTailQuality=20, trimLeft=0L, trimRight=0L,
            mc.cores=getThreads())

Arguments

reads1

The character vector. The filenames of first reads.

outputDir

When to save the trimmed fastq files.

paired

Whether paired-end reads or single-end reads.

nReads

Only sample a certain number nReads of reads. By default, all reads will be processed.

minTailQuality

The minimal tail quaility to decided where to cut. We use a runnning windows of size 4 to calculate the quality at each base, and cut off the tail at the first base where the quality is below minTailQuality. By default, it is 20. If the length of the trimmed read is below half of original read, this read is discarded.

trimLeft

The number of bases to cut on the left of the read.

trimRight

The number of bases to cut on the right (tail) of the read.

mc.cores

The number of threads to use. By default, we use a internal function NGS:::getThreads to decide.

Value

The filenames of trimmed first reads are returned.

Author(s)

Ge Tan

Examples

1
2
3
4
5
6
7
8
  reads1 <- file.path(system.file("extdata", package="NGS"), "fastq", 
                      "nanocage_ACAGAT_carp_embryo_R1.fastq")
  trimmedFastqs <- trimFastq(reads1, outputDir=".", paired=TRUE, 
                             nReads=-1L, 
                             minTailQuality=20, 
                             trimLeft=0L, trimRight=0L,
                             mc.cores=1L)
  file.remove(trimmedFastqs, NGS:::getPairedReads(trimmedFastqs))

ge11232002/NGS documentation built on May 17, 2019, 12:13 a.m.