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 Visium HD data analysis.

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 which is used in the pre-reading activities can be found at the link below.

Visium HD Dataset

Lessons

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 with an M1 chip, download and install gfortran before installing your packages

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 packages listed below from CRAN using the install.packages() function.

SFEData
scuttle
scater
scran
bluster
BiocParallel
Voyager
fastverse
ggplot2
pals
tidyverse
Seurat
patchwork
qs
quadprog
remotes
devtools
BiocManager

Please install them one-by-one as follows:

install.packages("tidyverse")
install.packages("Seurat")
install.packages("patchwork")
# & so on ...

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

  1. glmGamPoi

Please install glmGamPoi as follows:

library(BiocManager)
BiocManager::install("glmGamPoi")
BiocManager::install("pachterlab/SpatialFeatureExperiment", ref = "devel")

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

# SeuratWrappers
remotes::install_github('satijalab/seurat-wrappers')

# Banksy
remotes::install_github("prabhakarlab/Banksy@devel")

# spacexr
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(SFEData)
library(scuttle)
library(scater)
library(scran)
library(bluster)
library(BiocParallel)
library(Voyager)
library(fastverse)
library(ggplot2)
library(pals)
library(tidyverse)
library(Seurat)
library(patchwork)
library(qs)
library(quadprog)
library(remotes)
library(devtools)
library(BiocManager)
library(glmGamPoi)
library(SeuratWrappers)
library(Banksy)
library(spacexr)

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

sessionInfo()