decodeQuality: Conversion between numerical and ASCII representation of read...

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

View source: R/nucSim.R

Description

These functions convert an ASCII encoded sequence of read qualities into a numeric vector of error probabilities and vice versa.

Usage

1
2
decodeQuality(quality, type = c("Illumina", "Sanger", "Solexa"))
encodeQuality(quality, type = c("Illumina", "Sanger", "Solexa"))

Arguments

quality

For decodeQuality a character string representing the read qualities for a single sequence read. For encodeQuality a numeric vector of error probabilities.

type

Type of encoding to use.

Details

See extractQuality for a description of the currently supported encodings.

Value

Either a numeric vector of error probabilities or a character string of encoded read quality scores. Each entry in the vector corresponds to one character in the input.

Author(s)

Peter Humburg

See Also

extractQuality

Examples

1
2
3
4
5
6
7
8
9
## decodeQuality and encodeQualty are the inverse operations 
## of each other as one might expect
quality <- "IIIIIIIIIIIIICIIGIIIIGII95III6II-II0"
errorProb <- decodeQuality(quality, type="Sanger")
qualitySanger <- encodeQuality(errorProb, type="Sanger")
all.equal(quality, qualitySanger)

## They can also be used to convert between encodings
qualityIllumina <- encodeQuality(errorProb, type="Illumina")

ChIPsim documentation built on Nov. 8, 2020, 8:09 p.m.