Get the workshop material and data

In RStudio create a new project. This ensures all the files for this workshop are placed in their own folder.

Once you’ve created a new project, run the following R code to download the workshop material and dataset:

# Download the R file we will be working from
download.file(
    "https://raw.githubusercontent.com/MonashBioinformaticsPlatform/Single-Cell-Workshop/main/vignettes/pbmc3k_tutorial.R",
    "pbmc3k_tutorial.R")

# Download and untar the dataset
download.file(
    "http://10x.files.s3-us-west-2.amazonaws.com/samples/cell/pbmc3k/pbmc3k_filtered_gene_bc_matrices.tar.gz",
    "pbmc3k_filtered_gene_bc_matrices.tar.gz")

untar("pbmc3k_filtered_gene_bc_matrices.tar.gz")

Package Installation

For this workshop, several packages need to be installed. Seurat is relatively easy to install by itself. Monocle however has several dependencies that must be installed first, and these can sometimes be difficult to get all working.

Should BiocManager ask to update more packages, we recommend choosing not to for your first attempt at installation. If you have a large number of packages that BiocManager wants to update, this can take several hours to update. If however your installation fails, then you might need to update the Bioc packages.

## Install required packages for Seurat and Monocle:
install.packages(c("Seurat", "dplyr", "devtools", "R.utils"))

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

## Install required Bioconductor dependencies for Monocle:
if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")

BiocManager::install(c('SingleR', 'celldex',
                       'BiocGenerics', 'DelayedArray', 'DelayedMatrixStats',
                       'limma', 'S4Vectors', 'SingleCellExperiment',
                       'SummarizedExperiment', 'batchelor', 'Matrix.utils'))

## Install Monocle
devtools::install_github('cole-trapnell-lab/leidenbase')
devtools::install_github('cole-trapnell-lab/monocle3')

Monocle can be especially fiddly to install. We recommend checking the Monocle installation page if you encounter the following issues:

If you encounter an error with Github API rate limit, we are in the process of outlining a solution for this.

We suggest attending the MBP help session at 3pm on 10 December for installation problems or using the Slack channel to ask for help.