Spatial Transcriptomics Nanocourse

Audience Computational skills required Duration
Biologists Introduction to R 1 session in-person (~1h 45 min of trainer-led time)

Description

This repository contains materials for a module which is part of a Nanocourse organized by the Single Cell Core at HMS. The nanocourse titled “Spatial Transcriptomics: Key Technologies, Experimental Considerations, and Data Analysis” introduces the fundamentals of data analysis for spatial transcriptomics, including common techniques and tools. In this module we walk through the analysis workflow for a Visium HD experiment.

Learning Objectives

  • Describe the steps in a Visium HD analysis workflow
  • Use Seurat and associated tools to perform analysis of spatial transcriptomics data, including QC metric evaluation, normalization, clustering, and marker identification

Dataset

The dataset is located in “Dataset for workshop” -> “Day 1- NGS-based- VisiumHD” in the course DropBox.

Lessons

Visium HD Analysis with Seurat

Installation Requirements

Applications

Download the most recent versions of R and RStudio for your laptop:

Packages for R

Notes for installing packages

Note 1: Install the packages in the order listed below.

Note 2: All the package names listed below are case sensitive!

Note 3: If you have a Mac, download and install this gfortan tool before installing your packages if using R versions 4.3.0 up to 4.4.3 or this gfortran tool if using R versions after 4.4.3.

Note 4: At any point (especially if you’ve used R/Bioconductor in the past), in the console R may ask you if you want to update any old packages by asking Update all/some/none? [a/s/n]:. If you see this, type “a” at the prompt and hit Enter to update any old packages. Updating packages can sometimes take quite a bit of time to run, so please account for that before you start with these installations.

Note 5: If you see a message in your console along the lines of “binary version available but the source version is later”, followed by a question, “Do you want to install from sources the package which needs compilation? y/n”, type n for no, and hit enter.

(1) Install the following packages with CRAN using the install.packages() function:

install.packages("ggplot2")
install.packages("tidyverse")
install.packages("Seurat")
install.packages("patchwork")
install.packages("qs2")
install.packages("quadprog")
install.packages("remotes")
install.packages("devtools")
install.packages("BiocManager")

(2) Install the packages listed below from Bioconductor using the BiocManager::install() function.

library(BiocManager)

BiocManager::install("scuttle")
BiocManager::install("scater")
BiocManager::install("bluster")
BiocManager::install("Voyager")
BiocManager::install("glmGamPoi")
BiocManager::install("SpatialFeatureExperiment")
BiocManager::install("scattermore")
BiocManager::install("sfarrow")

(3) Install the packages listed below from GitHub using the given remotes:install_github or devtools::install_github command.

library(remotes)
library(devtools)
options(timeout = 600000000)

remotes::install_github("satijalab/seurat-wrappers")
remotes::install_github("prabhakarlab/Banksy@devel")
devtools::install_github("dmcable/spacexr", build_vignettes = FALSE)

(4) Finally, please check that all the packages were installed successfully by loading them one at a time using the library() function.

library(SpatialFeatureExperiment)
library(scuttle)
library(scater)
library(bluster)
library(Voyager)
library(ggplot2)
library(tidyverse)
library(Seurat)
library(patchwork)
library(qs2)
library(quadprog)
library(remotes)
library(devtools)
library(BiocManager)
library(glmGamPoi)
library(SeuratWrappers)
library(Banksy)
library(spacexr)
library(sfarrow)
library(scattermore)

(5) Once all packages have been loaded, run sessionInfo().

sessionInfo()

Copy the output of sessioninfo() and paste it in the input text box below or on the website. Then click the “Check my sessionInfo()” button. It will let you know if you are missing any packages. Take a screenshot of the message confirming that all packages have been successfully installed ( you will get a message letting you know that “no packages are missing”), and email it to us before the first session.