IMPORTANT: If you have an M1 Mac - do not follow these instructions, use one of the provided Virtual Machines (VM). Details on how to log on and access the VM will be provided during the workshop.

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 files we will be using
options(timeout=3600)
filenames <- c("pbmc3k_tutorial.R", "kang2018.rds")
url <- "https://raw.githubusercontent.com/MonashBioinformaticsPlatform/PBMC-Single-Cell-Workshop-2022/main/vignettes/" 
for(filename in filenames)
    download.file(paste0(url,filename), filename)

## Download and untar the raw data
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.

BiocManager likes to update installed packages, but we have disabled this in the R code below. If your installation fails, then you might need to turn updates on. Note that if there are a large number of packages that BiocManager wants to update it can take several hours.

These instructions have been tested with R version 4.2.1 and Bioconductor version 3.16.

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

# 2022-10-30 Harmony failed checks on CRAN. Need to use some old versions for now.
remotes::install_version("RcppArmadillo", version="0.11.2.4.0")
remotes::install_version("harmony", version="0.1", upgrade="never")

## Install required Bioconductor packages
install.packages("BiocManager")
BiocManager::install(c('SingleR', 'celldex',
                       'BiocGenerics', 'DelayedArray', 'DelayedMatrixStats',
                       'limma', 'S4Vectors', 'SingleCellExperiment',
                       'SummarizedExperiment', 'batchelor', 'Matrix.utils'),
                     update=FALSE)

## Install dev versions of some interactive graphics packages
remotes::install_github("plotly/plotly.R")
remotes::install_github("pfh/langevitour")

## install clustree
install.packages("clustree")
install.packages("RColorBrewer")