## ------------------------------------------------------------------------
## 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 DataLab