-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPrecourse_Instructions.Rmd
More file actions
256 lines (179 loc) · 8 KB
/
Precourse_Instructions.Rmd
File metadata and controls
256 lines (179 loc) · 8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
---
title: |
Cambridge Makerere Summer School
{width=60%}
subtitle: "Essential preparations prior to attending Bioinformatics workshop"
author: "Ashley Sawle"
date: "21st October 2024"
output:
html_document:
number_sections: yes
css: style.css
toc: yes
toc_depth: 1
---
# Installing R and RStudio {.tabset .tabset-fade .tabset-pills}
**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](https://cran.r-project.org), 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.
## Installation on Windows {-}
### Installing R {-}
1. Download the current version of R (version 4.4.1 as of 21/10/2024) from the
[CRAN website](https://cran.r-project.org/bin/windows/base).
2. Double click the `.exe` file that was just downloaded to launch it and install R
### Installing RStudio {-}
1. Go to the [RStudio download page](https://posit.co/download/rstudio-desktop/#download)
2. Under *Installers* download **RStudio-2024.09.0-375.exe**
3. Double click the file to install it
## Installation on Apple MacBook {-}
### Installing R {-}
Apple 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.
1. Click on Apple logo in top left of the screen, then chick on
`About This Mac`. Check to see whether you have an "Intel" or an "Apple M"
chip:
<center>
{width=90%}
</center>
<br/><br/>
2. Download the appropriate version of R for your chip from the [CRAN
website](https://cran.r-project.org/bin/macosx/):
<center>
{width=90%}
</center>
3. Double click on the downloaded file to install R
### Installing XQuartz {-}
In order to run RStudio on Mac OS you will need to install an additional piece
of software - XQuartz.
1. Download the `.pkg` file from [XQuartz](https://www.xquartz.org/).
3. Double click the downloaded file to install XQuartz
### Installing RStudio {-}
Finally install RStudio:
1. Go to the [RStudio download
page](https://posit.co/download/rstudio-desktop/#download)
2. Under *Installers* select **Mac OS 12+ RStudio-2024.09.0-375.dmg**
3. Double click the donwloaded file to install RStudio
## Updating existing R and 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.
<center>
{width=80%}
</center>
If either R or RStudio requires updating, close RStudio and then folow the
relevant installation instructions for your platform (Windows or macOS).
# Installing the `tidyverse` R package
In 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
```{r eval = FALSE}
install.packages("tidyverse")
```
and then press `Enter`:
<center>
{width=80%}
{width=60%}
</center>
You should then see some messages as the tidyverse is installed:
<center>
{width=60%}
</center>
Finally, check that the tidyverse has been installed by loading it
from your library. To do this, at the console type:
```{r eval = FALSE}
library(tidyverse)
```
and press `Enter`. You should see the following message (or similar):
<center>
{width=60%}
</center>
# Installing packages for the "Differential Gene Expression Analysis" workshop
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](https://bioconductor.org/)
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.
## Install Bioconductor
1. First we need to install the `BiocManager` package. Start RStudio, at the
console run the command:
```{r eval = FALSE}
install.packages("BiocManager")
```
2. Now we can install Bioconductor. At the console type:
```{r eval = FALSE}
BiocManager::install(version = "3.19")
```
If this is the first time you are installing Bioconductor, it can take some time.
## Install Packages
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.
1. To install all of the packages we need for the RNAseq course, type (or
copy/paste) the following command into the console.
```{r eval = FALSE}
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.
2. Once the installation is complete, type (or copy/paste) each of the following
lines to ensure you have correctly installed all the packages.
```{r eval = FALSE}
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:
{width=60%}
# Downloading the Data
We will need various data files for the workshops. These can all be downloaded
in a single zip file from
[here](https://bioinformatics-core-shared-training.github.io/Reverse_Summer_School_2024_PreCourse/Bioinformatics_workshop_data.zip).
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.