replaceLetterAt {Modstrings} | R Documentation |
replaceLetterAt
replaces a letter in a ModString
objects
with a new letter. In contrast to modifyNucleotides
it does not
check the letter to be replaced for its identity, it just replaces it and
behaves exactly like the
## S4 method for signature 'ModString' replaceLetterAt(x, at, letter, verbose = FALSE) ## S4 method for signature 'ModStringSet' replaceLetterAt(x, at, letter, verbose = FALSE)
x |
a |
at |
the location where the replacement should be made. The same input as in If x is a If x is a rectangular |
letter |
The new letters. The same input as in If x is a If x is a rectangular |
verbose |
See |
the input ModString
or ModStringSet
object with the changes applied
# Replacing the last two letters in a ModDNAString seq1 <- ModDNAString("AGTC") seq2 <- replaceLetterAt(seq1,c(3,4),"CT") # Now containg and m3C seq2 <- replaceLetterAt(seq1,c(3,4),ModDNAString("/T")) # Replacing the last two letters in a set of sequences set1 <- ModDNAStringSet(c("AGTC","AGTC")) set2 <- replaceLetterAt(set1, matrix(rep(c(FALSE,FALSE,TRUE,TRUE),2), nrow = 2, byrow = TRUE), c("CT","CT"))