fastqFilter | R Documentation |
fastqFilter takes an input fastq file (can be compressed), filters it based on several
user-definable criteria, and outputs those reads which pass the filter
to a new fastq file (also can be compressed). Several functions in the ShortRead
package are leveraged to do this filtering.
fastqFilter(
fn,
fout,
truncQ = 2,
truncLen = 0,
maxLen = Inf,
minLen = 20,
trimLeft = 0,
trimRight = 0,
maxN = 0,
minQ = 0,
maxEE = Inf,
rm.phix = TRUE,
rm.lowcomplex = 0,
orient.fwd = NULL,
n = 1e+06,
OMP = TRUE,
qualityType = "Auto",
compress = TRUE,
verbose = FALSE,
...
)
fn |
(Required). The path to the input fastq file. |
fout |
(Required). The path to the output file.
Note that by default ( |
truncQ |
(Optional). Default 2.
Truncate reads at the first instance of a quality score less than or equal to |
truncLen |
(Optional). Default 0 (no truncation).
Truncate reads after |
maxLen |
(Optional). Default Inf (no maximum). Remove reads with length greater than maxLen. maxLen is enforced on the raw reads. |
minLen |
(Optional). Default 20. Remove reads with length less than minLen. minLen is enforced after all other trimming and truncation. |
trimLeft |
(Optional). Default 0.
The number of nucleotides to remove from the start of each read. If both |
trimRight |
(Optional). Default 0.
The number of nucleotides to remove from the end of each read. If both |
maxN |
(Optional). Default 0.
After truncation, sequences with more than |
minQ |
(Optional). Default 0. After truncation, reads contain a quality score below minQ will be discarded. |
maxEE |
(Optional). Default |
rm.phix |
(Optional). Default TRUE.
If TRUE, discard reads that match against the phiX genome, as determined by
|
rm.lowcomplex |
(Optional). Default 0.
If greater than 0, reads with an effective number of kmers less than this value will be removed.
The effective number of kmers is determined by |
orient.fwd |
(Optional). Default NULL. A character string present at the start of valid reads. Only allows unambiguous nucleotides. This string is compared to the start of each read, and the reverse complement of each read. If it exactly matches the start of the read, the read is kept. If it exactly matches the start of the reverse-complement read, the read is reverse-complemented and kept. Otherwise the read if filtered out. The primary use of this parameter is to unify the orientation of amplicon sequencing libraries that are a mixture of forward and reverse orientations, and that include the forward primer on the reads. |
n |
(Optional). The number of records (reads) to read in and filter at any one time.
This controls the peak memory requirement so that very large fastq files are supported.
Default is |
OMP |
(Optional). Default TRUE.
Whether or not to use OMP multithreading when calling |
qualityType |
(Optional). |
compress |
(Optional). Default TRUE. Whether the output fastq file should be gzip compressed. |
verbose |
(Optional). Default FALSE. Whether to output status messages. |
... |
(Optional). Arguments passed on to |
integer(2)
.
The number of reads read in, and the number of reads that passed the filter and were output.
fastqPairedFilter
FastqStreamer
trimTails
testFastq = system.file("extdata", "sam1F.fastq.gz", package="dada2")
filtFastq <- tempfile(fileext=".fastq.gz")
fastqFilter(testFastq, filtFastq, maxN=0, maxEE=2)
fastqFilter(testFastq, filtFastq, trimLeft=10, truncLen=200, maxEE=2, verbose=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.