QualityScore-class | R Documentation |
This class hierarchy represents quality scores for short
reads. QualityScore
is a virtual base class, with derived
classes offering different ways of representing qualities. Methods
defined on QualityScore
are implemented in all derived
classes.
Objects from the class are created using constructors (e.g.,
NumericQuality
) named after the class name.
Defined classes are as follows:
Virtual base class; instances cannot be instantiated.
A single numeric vector, where values represent quality scores on an arbitrary scale.
A integer numeric vector, where values represent quality scores on an arbitrary scale.
A rectangular matrix of quality scores, with rows representing reads and columns cycles. The content and interpretation of row and column entries is arbitrary; the rectangular nature implies quality scores from equal-length reads.
‘fastq’ encoded quality scores stored in
a BStringSet
instance. Base qualities of a single read are
represented as an ASCII character string. The integer-valued
quality score of a single base is encoded as its ASCII equivalent
plus 33. The precise definition of the integer-valued quality
score is unspecified, but is usually a Phred score; the meaning
can be determined from the source of the quality scores. Multiple
reads are stored as a BStringSet
, and so can be of varying
lengths.
As with FastqQuality
, but with integer
qualities encoded as ASCII equivalent plus 64.
Class ".ShortReadBase"
, directly.
The following methods are defined on all QualityScore
and
derived classes:
signature(x = "QualityScore", i = "ANY", j = "missing")
signature(x = "MatrixQuality", i = "ANY", j = "missing")
:
Subset the object, with index i
indicating the reads for
which quality scores are to be extracted. The class of the result
is the same as the class of x
. It is an error to provide
any argument other than i
.
signature(x = "QualityScore", i = "ANY", j = "ANY")
:
Subset the object, returning the quality score (e.g., numeric
value) of the i
th read.
signature(x = "MatrixQuality", i = "ANY", j = "ANY")
:
Returns the vector of quality scores associated with the
i
th read.
signature(x = "MatrixQuality")
:
The integer(2) dimension (e.g., number of reads, read width) represented by the quality score.
signature(x = "QualityScore")
:
signature(x = "MatrixQuality")
:
The integer(1) length (e.g., number of reads) represented by the
quality score. Note that length
of MatrixQuailty
is
the number of rows of the corresponding matrix, and not the length
of the corresponding numeric vector.
signature(x = "QualityScore", values = "QualityScore")
:
append values
after x
.
signature(x = "QualityScore")
:
signature(x = "NumericQuality")
:
signature(x = "MatrixQuality")
:
signature(x = "FastqQuality")
:
A numeric vector with length equal to the number of quality
scores, and value equal to the number of quality scores for each
read. For instance, a FastqQuality
will have widths
equal to the number of nucleotides in the underlying short read.
signature(object = "QualityScore")
:
signature(object = "NumericQuality")
:
signature(object = "FastqQuality")
:
provide a brief summary of the object content.
signature(x = "QualityScore")
:
provide a more detailed view of object content.
The following methods are defined on specific classes:
signature(x = "FastqQuality", ...)
:
Return a character vector of valid quality characters.
signature(x = "FastqQuality", ...)
,
signature(x = "SFastqQuality", ...)
:
Returns a named character vector of integer encodings.
signature(stringSet = "FastqQuality")
:
Apply alphabetFrequency
to quality scores, returning a matrix as described in
alphabetFrequency
.
signature(stringSet = "FastqQuality")
:
Apply alphabetByCycle
to quality scores, returning a
matrix as described in alphabetByCycle
.
signature(object = "FastqQuality")
:
signature(object = "SFastqQuality")
:
signature(object = "PhredQuality")
:
Apply alphabetScore
(i.e., summed base quality, per
read) to object
.
signature(from = "FastqQuality", to = "numeric")
:
signature(from = "FastqQuality", to = "matrix")
:
signature(from = "FastqQuality", to = "PhredQuality")
:
signature(from = "SFastqQuality", to = "matrix")
:
signature(from = "SFastqQuality", to = "SolexaQuality")
:
Use as(from, "matrix")
) and similar to coerce objects of
class from
to class to
, using the quality encoding
implied by the class. When to
is “matrix”, the
result is a matrix of type integer
with number of columns
equal to the maximum width of from
; elements i, j
with j > width(from)[i]
have value NA_integer_
. The
result always represents the integer encoding of the corresponding
quality string.
signature(x = "FastqQuality", ...
: reverse the
quality sequence.
signature(x = "FastqQuality", start = NA, end = NA, width = NA, use.names = TRUE)
:
‘narrow’ quality
so that scores are between
start
and end
bases, according to
narrow
in the IRanges
package.
signature(object="FastqQuality", 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
.
signature(object="FastqQuality", k="integer",
a="character", successive=FALSE, ..., ranges=FALSE)
: trim
trailing scores if k
scores fall below the quality encoded
by a
. If successive=FALSE
, the k'th failing score
and all subseqent scores are trimmed. If successive=TRUE
,
failing scores must occur successively; the sequence is trimmed
from the first of the successive failing score.
signature(x = "FastqQuality")
:
signature(x = "FastqQuality")
:
signature(x = "FastqQuality")
:
Apply srsort
, srorder
, srrank
, and
srduplicated
to quality scores, returning objects as
described on the appropriate help page.
Integer representations of SFastqQuality
and
FastqQuality
can be obtained with as(x, "matrix")
.
Martin Morgan <mtmorgan@fhcrc.org>
NumericQuality
and other constructors.
names(slot(getClass("QualityScore"), "subclasses"))
encoding(FastqQuality())
encoding(SFastqQuality())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.