allSameLetter {Biostrings}R Documentation

Generic to find the strings which are repeats of a single letter

Description

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.

Usage

allSameLetter(x, letter)

Arguments

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.

Value

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.

Author(s)

Saikat DebRoy

See Also

BioString-class

Examples

PpiI <- "GAACNNNNNCTC"
D1 <-
  DNAString("tgctgatgcatagctagctgGAACtagctCTCtcgtagctggatgctgatNNNNNNNNNNNN")
matches <- matchDNAPattern(PpiI, D1)
matches
allN <- allSameLetter(matches, 'N')
allN
matches[!allN]

[Package Biostrings version 1.4.0 Index]