medianByPosition: Compute median quality for each nucleotide position

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/intPhred.R

Description

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

Usage

1
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

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.

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.

Author(s)

Joern Toedling

See Also

intPhred

Examples

1
2
3
4
   exDir <- system.file("extdata", package="girafe")
   ra  <- readFastq(dirPath=exDir, pattern=
                   "aravinSRNA_23_plus_adapter_excerpt.fastq")
   medianByPosition(ra, batchSize=200)

girafe documentation built on Nov. 8, 2020, 4:56 p.m.