ShortReadQ-class {ShortRead} | R Documentation

## "ShortReadQ" class for short reads and their quality scores

### Description

This class provides a way to store and manipulate, in a coordinated fashion, the reads, identifiers, and quality scores of uniform-length short reads.

### Objects from the Class

Objects from this class are the result of `readFastq`, or can be constructed from `DNAStringSet`, `QualityScore`, and `BStringSet` objects, as described below.

### Slots

Slots `sread` and `id` are inherited from `ShortRead`. An additional slot defined in this class is:

`quality`:

  Object of class `"BStringSet"` representing a quality score (see `readFastq` for some discussion of quality score).

### Extends

Class `"ShortRead"`, directly. Class `".ShortReadBase"`, by class "ShortRead", distance 2.

### Methods

Constructors include:

ShortReadQ

  `signature(sread = "DNAStringSet", quality = "QualityScore", id = "BStringSet")`:

ShortReadQ

  `signature(sread = "DNAStringSet", quality = "BStringSet", id = "BStringSet")`:

  Create a `ShortReadQ` object from reads, their quality scores, and identifiers. When `quality` is of class `BStringSet`, the type of encoded quality score is inferred from the letters used in the scores. The length of `id` and `quality` must match that of `sread`.

ShortReadQ

  `signature(sread = "DNAStringSet", quality = "QualityScore", id = "missing")`:

ShortReadQ

  `signature(sread = "DNAStringSet", quality = "BStringSet", id = "missing")`:

  Create a `ShortReadQ` object from reads and their quality scores, creating empty identifiers. When `quality` is of class `BStringSet`, the type of encoded quality score is inferred from the letters used in the scores.

ShortReadQ

  `signature(sread = "missing", quality = "missing", id = "missing")`: Create an empty `ShortReadQ` object.

See `accessors` for additional functions to access slot content, and `ShortRead` for inherited methods. Additional methods include:

quality

  inherited from `signature(object = "ANY")`: access the quality slot of `object`.

coerce

  `signature(from = "SFastqQuality", to = "QualityScaledDNAStringSet")`:

  (Use `as(from, "QualityScaledDNAStringSet")`) coerce objects of class `from` to class `to`, using the quality encoding implied by `quality(from)`. See `QualityScore` for supported quality classes and their coerced counterparts.

writeFastq

  `signature(object = "ShortReadQ", file = "character", ...)`:

writeFastq

  `signature(object = "ShortReadQ", file = "FastqFile", ...)`: Write `object` to `file` in fastq format. See `?writeFastq` for additional arguments `mode` and `full`.

[

  `signature(x = "ShortReadQ", i = "ANY", j = "missing")`: This method creates a new `ShortReadQ` object containing only those reads indexed by `i`. Additional methods on ‘[,ShortRead’ do not provide additional functionality, but are present to limit inappropriate use.

[<-

  `signature(x = "ShortReadQ", i = "ANY", j = "missing", ..., y="ShortReadQ")`: This method updates `x` so that records indexed by `i` are replaced by corresponding records in `value`.

append

  `signature(x = "ShortReadQ", values = "ShortRead")`: append the `sread`, `quality` and `id` slots of `values` after the corresponding fields of `x`.

reverse, reverseComplement

  `signature(x = "ShortReadQ", ...`: reverse or reverse complement the DNA sequence, and reverse the quality sequence.

narrow

  `signature(x = "ShortReadQ", start = NA, end = NA, width = NA, use.names = TRUE)`: narrow `sread` and `quality` so that sequences are between `start` and `end` bases, according to `narrow` in the `IRanges` package.

trimTailw

  `signature(object="ShortReadQ", k="integer", a="character", halfwidth="integer", ..., ranges=FALSE)`: trim trailing nucleotides when a window of width 2 * halfwidth + 1 contains `k` or more quality scores falling at or below `a`.

trimTails

  `signature(object="ShortReadQ", k="integer", a="character", successive=FALSE, ..., ranges=FALSE)`: trim trailing nucleotides if `k` nucleotides fall below the quality encoded by `a`. If `successive=FALSE`, the k'th failing nucleotide and all subseqent nucleotides are trimmed. If `successive=TRUE`, failing nucleotides must occur successively; the sequence is trimmed from the first of the successive failing nucleotides.

alphabetByCycle

  `signature(stringSet = "ShortReadQ")`: Apply `alphabetByCycle` to the `sread` component, the `quality` component, and the combination of these two components of `stringSet`, returning a list of matrices with three elements: `"sread"`, `"quality"`, and `"both"`.

alphabetScore

  `signature(object = "ShortReadQ")`: See `alphabetScore` for details.

qa

  `signature(dirPath = "ShortReadQ", lane="character", ..., verbose=FALSE)`: Perform quality assessment on the `ShortReadQ` object using `lane` to identify the object and returning an instance of `ShortReadQQA`. See `qa`

detail

  `signature(x = "ShortReadQ")`: display the first and last entries of each of `sread`, `id`, and `quality` entries of `object`.

### Author(s)

Martin Morgan

### See Also

`readFastq` for creation of objects of this class from fastq-format files.

### Examples

    showClass("ShortReadQ")
    showMethods(class="ShortReadQ", where=getNamespace("ShortRead"),
                inherit=FALSE)
    showMethods(class="ShortRead", where=getNamespace("ShortRead"),
                inherit=FALSE)

    sp <- SolexaPath(system.file('extdata', package='ShortRead'))
    rfq <- readFastq(analysisPath(sp), pattern="s_1_sequence.txt")
    quality(rfq)
    sread(reverseComplement(rfq))
    quality(reverseComplement(rfq))
    quality(trimTails(rfq, 2, "H", successive=TRUE))

[Package ShortRead version 1.45.4 Index]