Learn R Programming

girafe (version 1.24.0)

medianByPosition: Compute median quality for each nucleotide position

Description

This function computes the median quality for each position in a read over all reads in a ShortReadQ object.

Usage

medianByPosition(x, method = "Sanger", batchSize = 100000L)

Arguments

x
object of class ShortReadQ, such as the result of function readFastq
method
string; passed on to function intPhred
batchSize
number of rows to process in each iteration; directly influences RAM usage of this function

Value

A numeric vector of the median values per nucleotide position in the reads. The length of this vector corresponds to the length of the longest read in the data.

Details

The quality values are computed for each batch of reads and stored as numeric Rle objects for each postion. In each iteration, the Rle object of the current batch is merged with the previous one in order to keep the RAM usage low.

See Also

intPhred

Examples

Run this code
   exDir <- system.file("extdata", package="girafe")
   ra  <- readFastq(dirPath=exDir, pattern=
                   "aravinSRNA_23_plus_adapter_excerpt.fastq")
   medianByPosition(ra, batchSize=200)

Run the code above in your browser using DataLab