qualityScores {Rsubread} | R Documentation

## Extract Quality Score Data in a Sequencing Read Dataset

### Description

Extract quality strings and convert them to Phred scores for generating boxplots.

### Usage

    qualityScores(

        # basic input/output options
        filename,
        input_format = "gzFASTQ",
        offset = 33,
        nreads = 10000)

### Arguments

`filename` | a character string giving the name of an input file containing sequence reads.
`input_format` | a character string specifying format of the input file. `gzFASTQ` (gzipped FASTQ) by default. Acceptable formats include `gzFASTQ`, `FASTQ`, `SAM` and `BAM`. Character string is case insensitive.
`offset` | a numeric value giving the offset added to the base-calling Phred scores. Possible values include `33` and `64`. By default, `33` is used.
`nreads` | a numeric value giving the number of reads from which quality scores are extracted. `10000` by default. A value of `-1` indicates that quality scores will be extracted from all the reads.

### Details

Quality scores of read bases are represented by ASCII characters in next-gen sequencing data. This function extracts the quality characters from each base in each read and then converts them to Phred scores using the provided offset value (`offset`).

If the total number of reads in a dataset is `n`, then every `n`/`nreads` read is extracted from the input data.

### Value

A data matrix containing Phred scores for read bases. Rows in the matrix are reads and columns are base positions in each read.

### Author(s)

Wei Shi, Yang Liao and Zhiyin Dai

### Examples

    reads <- system.file("extdata","reads.txt.gz",package="Rsubread")
    x <- qualityScores(filename=reads,offset=64,nreads=1000)
    x[1:10,1:10]

[Package Rsubread version 2.0.1 Index]