allSameLetter {Biostrings} | R Documentation |
This method finds all strings in a "BioString" object which consist of a particular letter repeating again and again. Note that this does not do a pattern matching. So, if the letter is "N" for a BioString object with DNA patterns, then it would only match strings which are repeats of "N" and not others. See the examples for an illustration.
allSameLetter(x, letter)
x |
An object of class "BioString" or a character vector. In the later case it is converted to a BioString object. |
letter |
A single letter. It should be part of the alphabet of
x . |
A logical vector of same length as x
with elements TRUE
or FALSE
accordingly as the corresponding element of x
is a repeat of letter
or not.
Saikat DebRoy
PpiI <- "GAACNNNNNCTC" D1 <- DNAString("tgctgatgcatagctagctgGAACtagctCTCtcgtagctggatgctgatNNNNNNNNNNNN") matches <- matchDNAPattern(PpiI, D1) matches allN <- allSameLetter(matches, 'N') allN matches[!allN]