An RNAString object allows efficient storage and manipulation of a long RNA sequence.
Unlike the BString container that allows storage of any single string (based on a single-byte character set) the RNAString container can only store a string based on the RNA alphabet (see below). In addition, the letters stored in an RNAString object are encoded in a way that optimizes fast search algorithms.
The RNA alphabet
This alphabet is the same as the DNA alphabet, except that
is replaced by
?DNA_ALPHABET for more
information about the DNA alphabet.
The RNA alphabet is stored in the
RNA_ALPHABET predefined constant
(character vector). The
alphabet() function returns
applied to an RNAString object.
Constructor-like functions and generics
RNAString(x="", start=1, nchar=NA): Tries to convert
xinto an RNAString object by reading
ncharletters starting at position
In the code snippet below,
x is an RNAString object.
RNA_BASES RNA_ALPHABET d <- DNAString("TTGAAAA-CTC-N") r <- RNAString(d) r alphabet(r) # RNA_ALPHABET alphabet(r, baseOnly=TRUE) # RNA_BASES ## When comparing an RNAString object with a DNAString object, ## U and T are considered equals: r == d # TRUE