Description Usage Arguments Details Value Author(s) See Also Examples
Given a read sequence and quality this function introduces errors by first choosing positions
that should be modified based on the quality score and then exchanges nucleotides based on the
probabilities given in prob
.
1 2 | readError(read, qual, alphabet = c("A", "C", "G", "T"),
prob = defaultErrorProb(), ...)
|
read |
A character string representing a read sequence. |
qual |
Numeric vector of read error probabilities. |
alphabet |
Alphabet used for read sequence. |
prob |
Nucleotide exchange probabilities. |
... |
Further arguments (currently ignored). |
If the read sequence contains letters that are not part of alphabet
they are replaced
by the first entry of alphabet
before positions of sequencing errors are determined.
The alphabet used has to match the names used in prob
.
The modified read sequence.
Peter Humburg
defaultErrorProb
, readSequence
1 2 3 4 5 6 7 8 9 10 11 12 13 | set.seed(42)
## generate sequence read and quality
quality <- paste(sample(unlist(strsplit(rawToChar(as.raw(33:126)),"")),
36, replace = TRUE), collapse="")
errorProb <- decodeQuality(quality, type = "Sanger")
read <- paste(sample(c("A", "C", "G", "T"), 36, replace = TRUE),
collapse = "")
## use readError to introduce sequencing errors
read2 <- readError(read, errorProb)
all.equal(read, read2) ## "1 string mismatch"
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.