I. Installing R & Bioconductor - abishpius/R-for-Computational-Biology GitHub Wiki

Installing R

Need to download both of the following:

  • Download R - Select appropriate version for your computer
  • Download R Studio - Free gui environment to use R

Installing Bioconductor

Similar to CRAN, Bioconductor is a public repository of R packages. While packages on CRAN cover many fields, packages on Bioconductor address areas of high-throughput genomic analysis. The core packages that we will be installing serve as the foundation for many of the other packages available on Bioconductor. We refer to packages available through Bioconductor as a Bioconductor package. NOTE: to install said packages use BiocManager::install.

Each version of Bioconductor is built and tested against a specific release of R. Note that this course was last updated using Bioconductor version 3.10 and R version 3.6.3. We cannot guarantee that the content works with later versions of R and Bioconductor.

Code: Installing Required Packages

# install Bioconductor and check version
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install(version="3.10")

# install Bioconductor packages
BiocManager::install("BSgenome.Hsapiens.UCSC.hg19")
BiocManager::install(c("genefilter","geneplotter"))

# load installed packages
library(BSgenome.Hsapiens.UCSC.hg19)
library(genefilter)
library(geneplotter)

Code: Getting help in R and Bioconductor

# get help through the documentation
help.start()
?mean
help(mean)
help(package="genefilter")

# inspect objects, classes and methods
library(Biobase)    # load one of the core Bioconductor packages
?ExpressionSet
?"ExpressionSet-class"
methods(class = ExpressionSet)

# inspect the source code for functions and methods
read.csv
plotMA
showMethods("plotMA")
getMethod("plotMA","data.frame")

# vignettes teach you how to use various functions in a package
vignette(package="Biobase")
vignette("ExpressionSetIntroduction")
browseVignettes(package="Biobase")

# report key details about your R session
sessionInfo()