Description Usage Arguments Author(s) Examples
filterFastq
filters reads from source to destination file(s)
applying a filter to reads in each file. The filter can be a function
or FilterRules instance; operations are done in a memory-efficient
manner.
1 2 | filterFastq(files, destinations, ..., filter = FilterRules(),
compress=TRUE, yieldSize = 1000000L)
|
files |
a character vector of valid file paths. |
destinations |
a character vector of destinations, recycled to be
the same length as |
... |
Additional arguments, perhaps used by a |
filter |
A simple function taking as it's first argument a
|
compress |
A logical(1) indicating whether the file should be
gz-compressed. The default is |
yieldSize |
Number of fastq records processed in each call to
|
Martin Morgan mtmorgan@fhcrc.org
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## path to a convenient fastq file
sp <- SolexaPath(system.file('extdata', package='ShortRead'))
fl <- file.path(analysisPath(sp), "s_1_sequence.txt")
## filter reads to keep those with GC < 0.7
fun <- function(x) {
gc <- alphabetFrequency(sread(x), baseOnly=TRUE)[,c("G", "C")]
x[rowSums(gc) / width(x) < .7]
}
filterFastq(fl, tempfile(), filter=fun)
## trimEnds,character-method uses filterFastq internally
trimEnds(fl, "V", destinations=tempfile())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.