Setup
Exercises
Login and set up
Choose one of the following:
- Enrolled: if you are enrolled in a course with a teacher
- Own installation: if you want to install packages on your own local Rstudio installation
- Docker: if you want to use the docker image locally
- renkulab.io if you want to easily deploy the environment outside the course
Log in to Rstudio server with the provided link and password, your username is rstudio
.
Install the required packages using the script install_packages.R
With docker, you can use exactly the same environment as we use in the enrolled course, but than running locally.
In the video below there’s a tutorial on how to set up a docker container for this course. Note that you will need administrator rights, and that if you are using Windows, you need the latest version of Windows 10.
The command to run the environment required for this course looks like this (in a terminal):
Modify the script
The home directory within the container is mounted to your current directory ($PWD
), if you want to change this behaviour, modify the path after -v
to the working directory on your computer before running it.
docker run \
--rm \
-p 8787:8787 \
-e PASSWORD=test \
-v $PWD:/home/rstudio \
geertvangeest/single-cell-rstudio:latest
If this command has run successfully, approach Rstudio server like this:
http://localhost:8787
Copy this URL into your browser, and you will be able to use Rstudio with all required installations.
The option -v
mounts a local directory in your computer to the directory /home/rstudio
in the docker container (‘rstudio’ is the default user for Rstudio containers). In that way, you have files available both in the container and on your computer. Use this directory on your computer. Change the first path to a path on your computer that you want to use as a working directory.
The part geertvangeest/single-cell-rstudio:latest
is the image we are going to load into the container. The image contains all the information about software and dependencies needed for this course. When you run this command for the first time it will download the image. Once it’s on your computer, it will start immediately.
To simply run the environment, you can use renku. You can find the repository (including the image) here: https://renkulab.io/projects/geert.vangeest/single-cell-training/.
Create a project
Now that you have access to an environment with the required installations, we will set up a project in a new directory. On the top right choose the button Project (None) and select New Project…

Continue by choosing New Directory

As project type select New Project

Finally, type in the project name. This should be single_cell_course
. Finish by clicking Create Project.

Now that we have setup a project and a project directory (it is in /home/rstudio/single_cell_course
), we can download the data that is required for this course. We will use the built-in terminal of Rstudio. To do this, select the Terminal tab:

Downloading the course data
To download and extract the dataset, copy-paste these commands inside the terminal tab:
wget https://single-cell-transcriptomics.s3.eu-central-1.amazonaws.com/scRNAseq_v2.tar.gz
tar -xvf scRNAseq_v2.tar.gz
rm scRNAseq_v2.tar.gz
Have a look at the data directory you have downloaded. It should contain the following:
./data
├── deng_dataset
│ └── deng-reads.rds
├── gbm_dataset
│ ├── de_genes_gbm_res.0.2.csv
│ ├── dissocation_genes.txt
│ ├── filtered_feature_bc_matrix
│ │ ├── barcodes.tsv.gz
│ │ ├── features.tsv.gz
│ │ └── matrix.mtx.gz
│ └── h.all.v7.2.symbols.xls
└── pancreas_dataset
├── pancreas_expression_matrix.rds
└── pancreas_metadata.rds
We will be working with three different datasets:
- gbm dataset: Transcriptomes of human glioblastoma multiforme cells, generated by 10x genomics. This will be our most used dataset, we will use it throughout the course. Source: 10x datasets
- pancreas dataset: Pancreas cell dataset generated with four different methods. We will use it for integration and differential gene expression analysis. Soure: Stuart T et al. Comprehensive Integration of Single-Cell Data. Cell. 2019;177:1888-1902.e21
- deng dataset: Cells from different stages of mouse preimplantation development, which we will use for trajectory analysis at day 3. Source: Deng Q, et al., Single-Cell RNA-Seq Reveals Dynamic, Random Monoallelic Gene Expression in Mammalian Cells. Science; 2014;343:193–6