Cambridge Makerere Summer School
R and RStudio are separate downloads and installations.
R is the underlying statistical computing environment. The base R system and a very large collection of packages that give you access to a huge range of statistical and analytical functionality are available from CRAN, the Comprehensive R Archive Network.
RStudio is a graphical integrated development environment (IDE) that makes using R much easier and more interactive.
You need to first install R before you install RStudio. The instructions are slightly different depending on your operating system/computer platform. Please use the relevant instruction below.
If you already have R and RStudio installed on your laptop, please make sure they are both up to date and update any packages that you already have installed.
.exe
file that was just downloaded to launch it and install RApple MacBooks come with one of two types of cpu (chip) - Intel or Apple M1/M2. A different version of R needs to be installed depending on the type of chip that is running your MacBook. So, the first thing you should do is check what chip your Mac has. Once you know this, you can download the relevant R version and install it.
About This Mac
. Check to see whether you have an “Intel” or an “Apple M” chip:In order to run RStudio on Mac OS you will need to install an additional piece of software - XQuartz.
.pkg
file from XQuartz.Finally install RStudio:
If you already have R and RStudio installed, you should make sure that you are running the latest versions.
First check RStudio and update if necessary. Open RStudio, and click on Help
in the menu bar and then Check for updates
.
To check which version of R you are using, it is the first thing that appears in the console. If your version of R is older than version 4.3.0.
If either R or RStudio requires updating, close RStudio and then folow the relevant installation instructions for your platform (Windows or macOS).
tidyverse
R packageIn the “R intro” workshop we will be learning how to work with data using a suite of packages collectively known as “the tidyverse”. This is includes packages such as readr
, dplyr
and ggplot2
. Rather than install each package separately we can conveniently install them all at once by installing the tidyverse
package.
To install the tidyverse
packages:
Start RStudio, at the console type
install.packages("tidyverse")
and then press Enter
:
You should then see some messages as the tidyverse is installed:
Finally, check that the tidyverse has been installed by loading it from your library. To do this, at the console type:
library(tidyverse)
and press Enter
. You should see the following message (or similar):
For the “Differential Gene Expression Analysis of RNAseq data with DESeq2 in R” workshop we will need a number of packages. Some are specific for differential gene expression analysis, others for annotation of genes based on gene IDs and other are simply helper packages for creating plots. Many of the packages we will be using come from the Bioconductor project. Bioconductor is an open project that curates R packages specifically for analysis of biological data. Bioconductor packages are kept in a different repository to CRAN packages (such as the tidyverse, which you should have already installed) and so require a different function to install them.
Before installing the packages we need, we must first install the latest version of Bioconductor. It is essential that your R and RStudio are up to date before doing this. It is not possible to install the current version of Bioconductor in older versions of R.
BiocManager
package. Start RStudio, at the console run the command:install.packages("BiocManager")
BiocManager::install(version = "3.19")
If this is the first time you are installing Bioconductor, it can take some time.
Although we are going to be installing packages from both CRAN and Bioconductor we can use BiocManager::install
to install all the packages - it will figure out whether to use CRAN or Bioconductor for each package.
BiocManager::install(c("AnnotationDbi", "AnnotationHub", "circlize",
"clusterProfiler", "ComplexHeatmap", "DESeq2",
"enrichplot", "ensembldb", "gganimate", "ggdendro",
"ggfortify", "ggrepel", "ggvenn", "janitor", "msigdb",
"ExperimentHub", "org.Mm.eg.db", "pathview", "tximport"))
Again, it may take some time to install all of the packages.
library(AnnotationDbi)
library(AnnotationHub)
library(circlize)
library(clusterProfiler)
library(ComplexHeatmap)
library(DESeq2)
library(enrichplot)
library(ensembldb)
library(gganimate)
library(ggdendro)
library(ggfortify)
library(ggrepel)
library(ggvenn)
library(janitor)
library(msigdb)
library(ExperimentHub)
library(org.Mm.eg.db)
library(pathview)
library(tidyverse)
library(tximport)
If a package has not installed correctly you will get a message similar to this:
We will need various data files for the workshops. These can all be downloaded in a single zip file from here.
Please download this file and unzip in a suitable location on your laptop. We will be working within this folder for the duration of the workshops.