anySameLetter {Biostrings}R Documentation

Generic to find the strings which contain a particular letter

Description

This method finds all strings in a "BioString" object which contains at least one occurance of a particular letter. 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 contain at least one instance of "N" and not others. See the examples for an illustration.

Usage

anySameLetter(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 contains letter or not.

Author(s)

Saikat DebRoy

See Also

BioString-class

Examples

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

[Package Biostrings version 1.4.0 Index]