BString, DNAString, RNAString {Biostrings}R Documentation

The BString, DNAString and RNAString classes

Description

The BString, DNAString and RNAString classes are containers for big strings in general, and DNA or RNA sequences in particular. BString is the base class designed to store a big string and to make its manipulation easy and efficient. It's also the common parent of the DNAString and RNAString classes.

Details

The 2 main differences between a BString and a conventional character vector are: (1) the data stored in a BString are not copied on object duplication and (2) a BString can only store a single string (see the BStringViews class for an efficient way to store a collection of big strings in a single object). A BString object can be used to store {it as is} any non-empty string based on a single-byte character set. The DNAString and RNAString classes derive directly from the BString class (they have no additional slot). However, these classes can only store strings based on a limited alphabet (the IUPAC extended genetic alphabet + the gap letter) and these letters are encoded (before they are stored in the object) in a way that optimizes fast search algorithms. This makes the DNAString and RNAString classes particularly well suited for storing big DNA or RNA sequences. When the strings you want to work with are not DNA or RNA sequences, then you can use the BString class. All the methods that are defined for a BString object also work with a DNAString or RNAString object.

Accesor methods

In the code snippets below, x is a BString (or DNAString or RNAString) object and i is a numeric vector.

letter(x, i): [TODO: Document me]

Constructor-like functions and generics

In the code snippets below, src can be a character vector or a BString (or DNAString or RNAString) object.

BString(src): [TODO: Document me]
DNAString(src): [TODO: Document me]
RNAString(src): [TODO: Document me]

Standard generic methods

In the code snippets below, x, object, e1 and e2 are BString (or DNAString or RNAString) objects, and i is a numeric vector.

length(x) or nchar(x): Used to get the length of a BString, i.e., its number of letters
x[i]: [TODO: Document me]
e1 == e2: [TODO: Document me]
e1 != e2: [TODO: Document me]
as.character(x): [TODO: Document me]
toString(x): [TODO: Document me]

Other functions and generics

In the code snippets below, x is a BString (or DNAString or RNAString) object and first and last are single numerics.

subBString(x, first, last): [TODO: Document me]

Author(s)

H. Pages

See Also

BStringViews

Examples

  b <- BString("I am a BString object")
  length(b)
  d <- DNAString("TTGAAAA-CTC-N")
  length(d)
  r <- RNAString(d)

[Package Biostrings version 2.0.3 Index]