📊 SATURDAY · DIFFERENTIAL EXPRESSION IN R

How to Compare Gene Expression: Differential Expression Analysis in R

RNA-seq count data to differentially expressed genes, using DESeq2 and clusterProfiler.

Hands-on: How to compare gene expression, differential expression analysis in R, Saturday, 13:45-15:15

Coffee break 15:15-15:30 · continued 15:30-16:45

Tomasz Gaczorek, Faculty of Biochemistry, Biophysics and Biotechnology, Jagiellonian University, Kraków

In person? Nothing to do. Remote? Install R before Saturday.

On-site participants: the classroom computers already have R, RStudio, all packages and the dataset. Skip this page.

Remote participants: install R, RStudio and the packages below in advance. The Bioconductor packages (DESeq2, clusterProfiler, org.Hs.eg.db) pull a lot of dependencies and can take 20 to 40 minutes on a slow connection. Do not leave this until Saturday morning.

💬 Slack channel

Support runs on Slack, but it is limited. Prepare in advance, read through the steps, and post problems before the session rather than during it.

Open the Slack channel

⚠️ We can't walk everyone through installation live. If R or the packages fail, post the exact error on Slack before Saturday.

⬇️ Step 1: install R and RStudio click to collapse

Two separate programs. Install R first (the language), then RStudio (the interface that runs on top of it). Installing RStudio without R will not work.

R (version 4.3.3 or newer, required)

The version matters: DESeq2 and the other Bioconductor packages only install against a matching R + Bioconductor pair. An old R is the single most common reason the package install fails later. Download from CRAN:

Download R (CRAN mirror)

Windows: run the .exe, accept defaults. macOS: pick the .pkg matching your chip (Apple Silicon = arm64, Intel = x86_64). Linux: install r-base via your package manager, but check the version is 4.3.3+.

RStudio Desktop (free)

Download RStudio Desktop

Open-source builds and older releases: Posit download page. After installing, open RStudio: it should detect R automatically. The version number prints in the Console at startup.

📦 Step 2: install the R packages click to collapse

Open RStudio. In the Console (bottom-left pane), paste the commands below and press Enter. Run them in this order: CRAN packages first, then the Bioconductor ones through BiocManager.

install.packages("BiocManager")
install.packages("tidyverse")
install.packages("ggplot2")
BiocManager::install("DESeq2")
BiocManager::install("enrichplot")
BiocManager::install("org.Hs.eg.db")
BiocManager::install("clusterProfiler")
What to expect while it runs:
  • If R asks "Do you want to install from sources the package which needs compilation?", answer no unless a package is unavailable as a binary. Binaries install faster and skip the compiler.
  • If it asks to update old packages (a/s/n), n (none) is the safe choice during a workshop setup; updating everything can trigger long recompiles.
  • org.Hs.eg.db is a large annotation download. If it times out, just re-run that one line.

Total download is several hundred MB with dependencies. That is the slow part, not the workshop dataset (three small CSVs, linked below).

✅ Step 3: verify everything loads click to expand

Installing is not the same as working. Paste this into the Console: if it runs with no error, you are ready.

library(tidyverse)
library(DESeq2)
library(clusterProfiler)
library(enrichplot)
library(org.Hs.eg.db)
sessionInfo()

Each library() line should return quietly (loading messages are fine, red Error lines are not). sessionInfo() prints your R version and every loaded package: keep that output, it is the fastest thing to paste on Slack if something is off.

If all five load, your environment matches what the workshop needs.

📁 WORKSHOP DATASET (GSE237252)

RNA-seq counts and metadata for the differential expression analysis: smoker vs nonsmoker, split by sex. Download all three files into one folder before the session.

Small files, quick download. The R packages are the part to install early.

📄 WORKSHOP INSTRUCTION

The full workshop instruction (21 exercises, DEA and GO-term analysis) is a single HTML file prepared by Tomasz Gaczorek. Download it, open it in any browser, and work along during the session. No internet needed once saved.

Download the workshop instruction (HTML)

Right-click the button and choose "Save link as" if it opens instead of downloading.

🔧 Troubleshooting (read if install fails) click to expand
Error / symptomCause & fix
package 'DESeq2' is not available for this version of RYour R is too old for the current Bioconductor. Install R 4.3.3+ (Step 1), restart, then re-run BiocManager::install("DESeq2").
Bioconductor version doesn't match R version (warning at install)Run BiocManager::install(version = "3.18") (or the version BiocManager suggests for your R), then install the packages again.
Windows: 'lib' ... is not writable / installation path not writeableR was installed under Program Files. Right-click RStudio and Run as administrator once for the install, or let R create a personal library when it offers to.
macOS: build fails on libgfortran / compilation from sourceYou chose to compile from source. Re-run and answer no to the "install from sources" prompt so R uses the prebuilt binary.
Download stalls or times out on org.Hs.eg.dbIt is a large annotation package. Re-run that single line; the partial download resumes cleanly. On a very slow link, increase the timeout: options(timeout = 600) then retry.
there is no package called 'BiocManager'Run install.packages("BiocManager") first, then the BiocManager::install(...) lines.
A package "was built under R version X" warningUsually harmless. Only act on it if library() then throws an actual error.
Still stuckPaste the output of sessionInfo() plus the full error into Slack before Saturday.

Get the install done this week

If the five packages load with no error, you're set. Grab the three dataset files above. On-site participants have everything ready on the classroom machines.

EEBG 2026 · Differential expression analysis in R · DESeq2 · clusterProfiler