XStringSet-class {Biostrings} | R Documentation

## BStringSet, DNAStringSet, RNAStringSet and AAStringSet objects

### Description

The BStringSet class is a container for storing a set of `BString` objects and for making its manipulation easy and efficient. Similarly, the DNAStringSet (or RNAStringSet, or AAStringSet) class is a container for storing a set of `DNAString` (or `RNAString`, or `AAString`) objects.

The BStringList class (and family) is equivalent to the BStringSet family. It was a first attempt to address the problem of storing a large set of sequences but it has been superseded by the BStringSet family.

### Usage

      BStringSet(x, start=NA, end=NA, width=NA, use.names=TRUE)
      DNAStringSet(x, start=NA, end=NA, width=NA, use.names=TRUE)
      RNAStringSet(x, start=NA, end=NA, width=NA, use.names=TRUE)
      AAStringSet(x, start=NA, end=NA, width=NA, use.names=TRUE)

      ## The BStringList family has been superseded by the more efficient
      ## BStringSet family
      BStringList(x, start=NA, end=NA, width=NA, use.names=TRUE, check=TRUE)
      DNAStringList(x, start=NA, end=NA, width=NA, use.names=TRUE, check=TRUE)
      RNAStringList(x, start=NA, end=NA, width=NA, use.names=TRUE, check=TRUE)
      AAStringList(x, start=NA, end=NA, width=NA, use.names=TRUE, check=TRUE)

### Arguments

`x` | [TODO]
`start` | [TODO]
`end` | [TODO]
`width` | [TODO]
`use.names` | [TODO]
`check` | [TODO]

### Details

[TODO]

### Accesor methods

The XStringSet class derives from the IRanges class hence all the accessor methods defined for a IRanges object can also be used on an XStringSet object. In particular, the following methods are available (in the code snippets below, `x` is an XStringSet object:

  `length(x)`: The number of sequences in `x`.
  `width(x)`: A vector of non-negative integers containing the number of letters for each element in `x`.
  `nchar(x)`: The same as `width(x)`.
  `names(x)`: `NULL` or a character vector of the same length as `x` containing a short user-provided description or comment for each element in `x`. These are the only data in an XStringSet object that can safely be changed by the user. All the other data are immutable! As a general recommendation, the user should never try to modify an object by accessing its slots directly.

### Subsetting methods

In the code snippets below, `x` is an XStringSet object, and `i` should be an index specifying the elements to extract.

  `x[i]`: Return a new XStringSet object made of the selected elements.
  `x[[i]]`: Extract the i-th `BString` object from `x`.

### Other methods

In the code snippets below, `x` is an XStringSet object.

  `as.list(x)`: Return the elements in `x` as a standard R list.

### Author(s)

H. Pages

### See Also

BString-class, DNAString-class, RNAString-class, AAString-class, XStringViews-class, IRanges

### Examples

      x1 <- DNAStringSet(c("TTGA", "-CTC-N"))
      x1
      names(x1)
      names(x1)[2] <- "seqB"
      x1

      library(drosophila2probe)
      x2 <- DNAStringSet(drosophila2probe$sequence)
      x2

      RNAStringSet(x2, start=2, end=-5)

[Package Biostrings version 2.8.18 Index]