Single cell RNA-seq tutorial
2021-09-28
Chapter 1 Prerequisites
In this session, we will go through some of the most common analyitcal approaches for visualising a scRNA-seq data set and identifying groups of cells. We will use a data set containing ~3,000 peripheral blood mononuclear cells (PBMCs) made publicly available by 10X.
You’ll need to download the example dataset and extract it.
This session is based on the Guided Clustering in Seurat tutorial, designed by Rahul Satija’s group, which you can access via the following link.
Let’s get started!
1.1 Load R libraries
We’ll begin by loading Seurat (note that this tutorial uses v3.2.1), as well as well as a few other libraries that should give us enough functionality to complete all of our analysis. We are also using R version 4.0.2. Check your R and library versions running sessionInfo().
# For all parts
library(Seurat)
library(limma)
library(tidyverse) # For ggplot2 and easy manipulation of data
library(patchwork) # To combine plots
library(future) # For paralellization
library(DoubletFinder) # For finding doublets
library(clustree) # To select clustering resolution
options(stringsAsFactors = FALSE) # Set this to deactivate the automatic read-in of characters as factors
We will also set point R to the correct version of Python to use, if needed. This will be important when using the clustering functions.
# point R to the correct python version for Leiden clustering
Sys.setenv(RETICULATE_PYTHON = "./python/bin/python")
::py_config() reticulate