Biostrings (version 2.40.2)

XStringSetList-class: XStringSetList objects

Description

The XStringSetList class is a virtual container for storing a list of XStringSet objects.

Usage

## Constructors: BStringSetList(..., use.names=TRUE) DNAStringSetList(..., use.names=TRUE) RNAStringSetList(..., use.names=TRUE) AAStringSetList(..., use.names=TRUE)

Arguments

...
Character vector(s) (with no NAs), or XStringSet object(s), or XStringViews object(s) to be concatenated into a XStringSetList.
use.names
TRUE or FALSE. Should names be preserved?

Methods

The XStringSetList class extends the List class defined in the IRanges package. Using a less technical jargon, this just means that an XStringSetList object is a list-like object that can be manipulated like an ordinary list. Or, said otherwise, most of the operations that work on an ordinary list (e.g. length, names, [, [[, c, unlist, etc...) should work on an XStringSetList object. In addition, Bioconductor specific list operations like elementNROWS and PartitioningByEnd (defined in the IRanges package) are supported too.

Details

Concrete flavors of the XStringSetList container are the BStringSetList, DNAStringSetList, RNAStringSetList and AAStringSetList containers for storing a list of BStringSet, DNAStringSet, RNAStringSet and AAStringSet objects, respectively. These four containers are direct subclasses of XStringSetList with no additional slots.

Currently DNAStringSetList() and AAStringSetList() are the only XStringSetList constructors. The XStringSetList class itself is virtual and has no constructor.

See Also

XStringSet-class, List-class

Examples

Run this code
## ------------------------------------------------------------------------
## A. THE XStringSetList CONSTRUCTORS
## ------------------------------------------------------------------------
## Currently DNAStringSetList() and AAStringSetList() are the only 
## constructors. Others will be developed when the use case arises.

dna1 <- c("AAA", "AC", "", "T", "GGATA")
dna2 <- c("G", "TT", "C")

x <- DNAStringSetList(dna1, dna2)
x

DNAStringSetList(DNAStringSet(dna1), DNAStringSet(dna2))

DNAStringSetList(dna1, DNAStringSet(dna2))

DNAStringSetList(DNAStringSet(dna1), dna2)

DNAStringSetList(dna1, RNAStringSet(DNAStringSet(dna2)))

DNAStringSetList(list(dna1, dna2))

DNAStringSetList(CharacterList(dna1, dna2))

## Empty object (i.e. zero-length):
DNAStringSetList()

## Not empty (length is 1):
DNAStringSetList(character(0))

## ---------------------------------------------------------------------
## B. UNLISTING AN XStringSetList OBJECT
## ---------------------------------------------------------------------
length(x)
elementNROWS(x)
unlist(x)
x[[1]]
x[[2]]
as.list(x)

names(x) <- LETTERS[1:length(x)]
x[["A"]]
x[["B"]]
as.list(x)  # named list

Run the code above in your browser using DataCamp Workspace