Skip to content

Single Cell RNA Seq Analysis

reubenthomas edited this page Oct 27, 2025 · 89 revisions

Description

This workshop will focus on the analysis of single-cell RNA-seq data starting from the raw counts matrices. You'll learn about quality control of the raw data, normalization, feature selection, dimensionality reduction, clustering, finding marker genes, and batch correction. You'll analyze data using R.

The discussions are organized in three sessions:

  • Session 1: Load the data, quality control, normalization, feature selection, dimensionality reduction.

  • Session 2: Dimensionality reduction (continued), clustering, finding marker genes.

  • Session 3: Advanced discussion on normalization, differential analysis, batch-correction, Q&A.

Note: Attendance in all three sessions is highly recommended. Each session builds upon prior sessions.

Required experience:

  • Familiarity with R and RStudio (e.g., reading in files, working with lists and dataframes)
  • Some exposure to RNA-seq datasets

Learning Path

Advanced   This is an advanced workshop in the RNA-Seq Analysis series. Prior experience with RNA-Seq analysis is required. See introductory and intermediate workshops in the RNA-Seq Analysis series.

Materials

Sessions 1-2:

The slides are here .

  1. There is a zip file with code and data at this link.
  2. Open the link, press the download button (usually on the top right corner), and select “Direct Download” if a menu pops up.
  3. The zip file download should start.
  4. Unzip the zip file.

Session 3

  1. The slides for this session can be found here
  2. The Rmarkdown file along with the support data and R code can downloaded in this folder.
  3. Follow the instructions above to unzip this file.

Pre-workshop Instructions

Before the workshop, please ensure that R and RStudio are installed, and all required packages are set up. Completing these steps will ensure a smooth experience during the hands-on sessions.

Sessions 1–2

  1. Install R and RStudio
    (latest stable versions recommended).

  2. Install the following packages in RStudio:

    # Core packages
    install.packages("tidyverse")   # Data handling and visualization
    install.packages("Seurat")      # Single-cell RNA-seq analysis
    install.packages("sctransform") # Normalization
    install.packages("patchwork")   # Plot arrangement
    install.packages("future")      # Parallel processing of tasks
    
    # Check Seurat version
    library(Seurat)
    packageVersion("Seurat")   # Should be 4.0 or higher
    
    # If prompted to install from source, type 'y' to confirm
    
    # Bioconductor dependencies
    if (!requireNamespace("BiocManager", quietly = TRUE))
        install.packages("BiocManager")
    BiocManager::install("glmGamPoi")
    
    # GitHub dependencies (requires devtools)
    if (!requireNamespace("devtools", quietly = TRUE))
        install.packages("devtools")
    
    devtools::install_github("gladstone-institutes/clustOpt")
    devtools::install_github("gladstone-institutes/LODopt")
    
    # Optional: For handling large datasets efficiently
    BiocManager::install("BPCells")
    
    # Verify installations
    library(clustOpt)
    packageVersion("clustOpt")
    library(LODopt)
    packageVersion("LODopt")
  3. Download and open the hands-on materials

    • Download here
    • Unzip the folder and open hands_on_component.Rmd in RStudio.
  4. Click the “Knit” button in RStudio.
    If all installations were successful, the R Markdown file will compile into an HTML report that matches hands_on_component_output.html included in the materials.
    Note: It may take several minutes to run through all steps.

If you encounter installation issues with clustOpt or LODopt, refer to the official troubleshooting guides:

Session 3

If you have already installed R, RStudio, Seurat, and tidyverse, you only need to install the additional packages below.

  1. Install Bioconductor packages:

    if (!requireNamespace("BiocManager", quietly = TRUE))
        install.packages("BiocManager")
    
    BiocManager::install("muscat")
    BiocManager::install("SummarizedExperiment")
    BiocManager::install("harmony")
  2. Install additional R packages:

    install.packages("magrittr")
    install.packages("lme4")
    install.packages("gdata")
    install.packages("ssizeRNA")

    If prompted to install from source, type ‘y’ to confirm.

  3. Download and open

  4. Knit the file.
    If the setup is correct, RStudio will generate an HTML document named Session3.html, which matches the example provided.
    Again, this process may take several minutes.

✅ Tips

  • Restart R after installing multiple packages to ensure all dependencies load correctly.
  • If a package fails to install, copy the exact error message and email us before the workshop or bring it to the first workshop session. We will troubleshoot together.

Online Learning

You can access these materials remotely at any time and go through them at your own pace. Here's how:

  1. Download the materials for Sessions 1-3 as described above. Study the slide deck for a review of current practices in scRNA-seq analysis (Jan, 2023).
  2. Published benchmarks for different classes methods/analyses on single-cell RNA-seq data.

Clone this wiki locally