## ---------------------------------------------------------------------
## available.genomes() and installed.genomes()
## ---------------------------------------------------------------------
# What genomes are currently installed:
installed.genomes()
# What genomes are available:
available.genomes()
# Split the package names in parts:
av_gen <- available.genomes(splitNameParts=TRUE)
table(av_gen$organism)
table(av_gen$provider)
# Make your choice and install with:
library(BiocInstaller)
biocLite("BSgenome.Scerevisiae.UCSC.sacCer1")
# Have a coffee 8-)
# Load the package and display the index of sequences for this genome:
library(BSgenome.Scerevisiae.UCSC.sacCer1)
Scerevisiae # same as BSgenome.Scerevisiae.UCSC.sacCer1
## ---------------------------------------------------------------------
## getBSgenome()
## ---------------------------------------------------------------------
## Specify the full name of an installed BSgenome data package:
genome <- getBSgenome("BSgenome.Celegans.UCSC.ce2")
genome
## Specify a genome assembly (a.k.a. provider version):
genome <- getBSgenome("hg38")
class(genome) # BSgenome object
providerVersion(genome)
genome$chrM
genome <- getBSgenome("hg38", masked=TRUE)
class(genome) # MaskedBSgenome object
providerVersion(genome)
genome$chr22
Run the code above in your browser using DataLab