Summary and Schedule
Spatially resolved transcriptomics is a cutting-edge molecular profiling technology that measures transcript expression and position within a tissue. This course will teach you how to analyze spatial transcriptomics data generated by the Visium 10X platform. By the end of this course, you will be able to:
- Describe different spatial transcriptomics technologies and the best uses of each.
- Identify important elements for good experimental design.
- Analyze spatial transcriptomics data, including quality control, transcript quantification, and cell-type assignment within regions.
Prerequisites
To succeed in this course, you need to have
- proficiency in the R programming language;
- knowledge of bulk RNA and single-cell sequence analysis.
Setup Instructions | Download files required for the lesson | |
Duration: 00h 00m | 1. Spatially Resolved Transcriptomics in Life Sciences Research |
What is spatial transcriptomics? What research questions or problems can spatial transcriptomics address? How do the technologies work? Which technology will we learn about in this lesson? :::::: |
Duration: 00h 15m | 2. Data and Study Design |
Which data will we explore in this course? How was the study that generated the data designed? What are some critical design elements for rigorous, reproducible spatial transcriptomics experiments? |
Duration: 00h 45m | 3. Data Preprocessing |
What data files should I expect from the Visium assay? Which data preprocessing steps are required to prepare the raw data files for further analysis? What software will we use for data preprocessing? |
Duration: 02h 20m | 4. Remove Low-quality Spots |
How do I remove low-quality spots? What kinds of problems produce low-quality spots? What happens if I skip quality control and proceed with analysis? |
Duration: 03h 35m | 5. Normalization in Spatial Transcriptomics |
What technical and biological factors impact spatial transcriptomics
data? How do these factors motivate the need for normalization? What are popular normalization methods? How do we assess the impact of normalization? |
Duration: 04h 45m | 6. Feature Selection, Dimensionality Reduction, and Spot Clustering |
Why is feature selection important in spatial transcriptomics? What are the implications of using different proportions of highly variable genes (HVGs) in data analysis? Why is feature selection in spatial transcriptomics not typically necessary with normalization techniques like SCTransform? How do PCA and UMAP differ in their approach to dimensionality reduction in spatial transcriptomics? What advantages do linear methods like PCA offer before applying nonlinear methods like UMAP? How do these dimensionality reduction techniques impact downstream analysis such as clustering and visualization? |
Duration: 06h 10m | 7. Deconvolution in Spatial Transcriptomics |
How can we bring single-cell resolution to multi-cellular
spatial transcriptomics spots? What are different algorithmic approaches for doing so? |
Duration: 07h 00m | 8. Differential Expression Testing |
How can we assess region-specific gene expression using
differential expression? How can we assess spatially varying gene expression using spatial statistics? :::::::::::::::::::::::::::::::::::::::::::::::: |
Duration: 07h 50m | 9. Putting it all Together | How do I put the whole spatial transcriptomics analysis together? |
Duration: 09h 15m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
For this lesson, you will be working in the R programming language and the RStudio development environment. You will be installing this software on your laptop and downloading the data set. Installing software and downloading data may take 2-3 hours. Please take care of this before the workshop so that you are able to participate at the start of the course.
Software Setup
R
Please download and install R version 4.4.0 (Puppy Cup). To interact with R, we use RStudio. You can also download the latest stable version of RStudio, although this is not as critical as the latest R version is. If you don’t have administrative rights to your laptop, please ask the IT help desk to install software for you. Once you have installed R and RStudio, open RStudio to verify that the installation was successful.
R Package Installation
Next, we will install the required packages for this lesson. Note
that the spacexr
package takes a long time to download.
In RStudio, copy and paste the following commands into the Console:
R
pkgs <- c("BiocManager", "data.table", "ggExtra", "hdf5r",
"here", "igraph", "leiden", "Matrix", "matrixStats",
"plyr", "rcartocolor", "remotes", "DESeq2",
"Rfast2", "Seurat", "tidyverse", "R.utils")
for(pkg in pkgs) {
if(!require(pkg, character.only=TRUE)) {
install.packages(pkg, dependencies = TRUE)
}
}
BiocManager::install(c("glmGamPoi", "rhdf5", "ComplexHeatmap","DESeq2"))
options(timeout = 1e6)
remotes::install_github("immunogenomics/presto", build_vignettes = FALSE)
remotes::install_github("dmcable/spacexr", build_vignettes = FALSE)
Once the installation has finished, copy and paste the following commands into the console to verify that packages installed correctly.
R
library(BiocManager)
library(data.table)
library(R.utils)
library(hdf5r)
library(here)
library(presto)
library(rcartocolor)
library(remotes)
library(spacexr)
library(sparseMatrixStats)
library(Seurat)
library(tidyverse)
library(ComplexHeatmap)
library(DESeq2)
library(patchwork)
Project Setup
Create a new project called
spatialRNA
. Click the File menu button, then New Project. Click New Directory. Click New Project. Type spatialRNA as the directory name. Create the project anywhere you like, but don’t forget where you put it! Click the Create Project button. This will create a file calledspatialRNA.Rproj
in the directory you just created. In the future you can double-click on this file to open RStudio in this directory. This will be the easiest way to interact with the files/code you produce in this workshop.Use the Files tab to create a
data
folder to hold the data, ascripts
folder to house your scripts, and aresults
folder to hold results. Alternatively, you can copy and paste the following commands into the R console for step 2 only. You still need to create a project with step 1.
R
dir.create("data")
dir.create("scripts")
dir.create("results")
Data Set Download
We will be working with brain data from Maynard et
al., Nature Neuroscience, 2021. We have created links on Box from
which you can download the data. Once you have opened your
spatialRNA
project in RStudio, run the code below to
download the data into your data
directory.
R
dir.create("data/151508/spatial", recursive = TRUE)
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/vfbgloxx9ciu04hj9i9f5jjzglfrx0by.h5",
destfile = "data/151508/151508_raw_feature_bc_matrix.h5",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/puetvwocuf14kzyogtds7y1o7cme8dvp.h5",
destfile = "data/151508/151508_filtered_feature_bc_matrix.h5",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/zxulmiupeurvrmwe0tz1y0hslzrsj4wb.json",
destfile = "data/151508/spatial/scalefactors_json.json",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/w1bjdguo3emfb5uvwlys26yrudw08dm0.png",
destfile = "data/151508/spatial/tissue_hires_image.png",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/xgmx8tqdfjndejr1hp3r29r4531rd6s2.png",
destfile = "data/151508/spatial/tissue_lowres_image.png",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/gw2e7d47tihg25df8hahelrhx42y345o.csv",
destfile = "data/151508/spatial/tissue_positions_list.csv",
mode = "wb")
dir.create("data/151673/spatial", recursive = TRUE)
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/ge38lg6u1i45n3grusrdyd3nccukl489.h5",
destfile = "data/151673/151673_raw_feature_bc_matrix.h5", mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/m8btvh1y9tjszfal99k2cvr1f32lh1si.h5",
destfile = "data/151673/151673_filtered_feature_bc_matrix.h5", mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/feb8gnawor51ojh2ci4mlshhxobpnaji.json",
destfile = "data/151673/spatial/scalefactors_json.json",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/ejyx4qkv62p5t0njwf5z8px2mqcjxnd7.png",
destfile = "data/151673/spatial/tissue_hires_image.png",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/8tgbt4654zbxwsqr3vwlk64dyzzulhlb.png",
destfile = "data/151673/spatial/tissue_lowres_image.png",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/drlayml5otq7n2xedndm0qsqly58g306.csv",
destfile = "data/151673/spatial/tissue_positions_list.csv",
mode = "wb")
dir.create("data/151669/spatial", recursive = TRUE)
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/gmc41gg5bu9t4rhmem5czn17d57zcd88.h5",
destfile = "data/151669/151669_raw_feature_bc_matrix.h5", mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/qbe9rv3fnsgwiitdshmfxp20havdhgys.h5",
destfile = "data/151669/151669_filtered_feature_bc_matrix.h5", mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/vj3t6n0jp6527ru8pwm8mgkm2o3ws4f5.json",
destfile = "data/151669/spatial/scalefactors_json.json",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/a62rbd9oc3lxeoytdpl87okgiap0dsjt.png",
destfile = "data/151669/spatial/tissue_hires_image.png",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/fq1f30txsn10cx7g937ew96vdghek76j.png",
destfile = "data/151669/spatial/tissue_lowres_image.png",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/gsbcd00z82q5u8dsxqhyznqfvt2k28t3.csv",
destfile = "data/151669/spatial/tissue_positions_list.csv",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/ny1wokl6sz1xjzz68aftbk209se5nvws.tsv",
destfile = "data/spot-meta.tsv",
mode = "wb")
dir.create("data/scRNA-seq", recursive = TRUE)
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/ydu9rbdhum5qrvuijze23qwz7dlztefo.tsv",
destfile = "data/scRNA-seq/sc_cell_types.tsv",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/lasxuiq5wi3ms1jnokzmm7pp4hptr8ma.gz",
destfile = "data/scRNA-seq/sc_counts.tsv.gz",
mode = "wb")
download.file(url = "https://thejacksonlaboratory.box.com/shared/static/dt2chlmxtjajxfnlpfzolz1tvb6kic7p.rds",
destfile = "data/rctd-sample-1.rds",
mode = "wb")
Development of this lesson was funded by a Jackson Laboratory Director’s Innovation Fund award to Dr. Gary Churchill. We are grateful for this support.