medianByPosition {girafe} | R Documentation

## 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

### 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

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

[Package girafe version 1.32.0 Index]