BSgenome-class {BSgenome}R Documentation

The BSgenome class

Description

A container for the complete genome sequence of a given specie.

Details

[TODO: Put some details here]

Standard generic methods

In the code snippets below, x is a BSgenome object and name is the name of a chromosome (character-string).

names(x): Returns the index of BStringViews objects contained in x. Each BStringViews object in x was created from a single FASTA file. The names returned by names(x) are usually the names of those source files but eventually a common prefix or suffix was removed in order to keep them as short as possible.
length(x): Returns the length of x, i.e., the number of BStringViews objects that it contains. This is the same as length(names(x)).
x[[name]]: [TODO: Document me]
x$name: [TODO: Document me]

Other functions and generics

In the code snippets below, x is a BSgenome object and name is the name of a chromosome (character-string).

unload(x, name): [TODO: Document me]

Author(s)

H. Pages

See Also

matchPattern, BStringViews, DNAString

Examples

  library(BSgenome.Celegans.UCSC.ce2)
  length(Celegans)
  Celegans

  ## Access chromosome V (BStringViews object) with
  Celegans[["chrV"]]
  ## or with
  Celegans$chrV

  ## Note that the chromosome V data are not loaded into memory until the
  ## first time you try to access them (what gets loaded is the serialized
  ## BStringViews instance stored in the "chrV.rda" file)
  ## To unload chromosome V (if you need to free some memory)
  unload(Celegans, "chrV")

  ## Note that assignment of BStringViews objects does NOT copy the data
  c <- Celegans[["chrV"]]

  ## But then, clean unloading is a bit more complicated
  unload(Celegans, "chrV")
  remove(c)
  ## More generally, you need to keep track of all BStringViews objects
  ## referencing the same data if you want to be able to unload these data
  ## from memory

[Package BSgenome version 1.2.3 Index]