☰ Menu

      Single Cell RNA-Seq Analysis

Home
Introduction and Lectures
Intro to the Workshop and Core
Schedule
What is Bioinformatics/Genomics?
Experimental Design and Cost Estimation
Support
Slack
Zoom
Cheat Sheets
Software and Links
Scripts
Prerequisites
CLI
R
Data Reduction
Files and Filetypes
Project setup
Generating Expression Matrix
scRNAseq Analysis
Prepare scRNAseq Analysis
scRNAseq Analysis - PART1
scRNAseq Analysis - PART2
scRNAseq Analysis - PART3
scRNAseq Analysis - PART4
scRNAseq Analysis - PART5
scRNAseq Analysis - PART6
ETC
Closing thoughts
Workshop Photos
Github page
Biocore website

The dataset used in this course is from Mysore V, Cullere X, Settles ML, Ji X, Kattan MW, Desjardins M, Durbin-Johnson B, Gilboa T, Baden LR, Walt DR, Lichtman AH, Jehi L, Mayadas TN. Protective heterologous T cell immunity in COVID-19 induced by the trivalent MMR and Tdap vaccine antigens. Med (N Y). 2021 Sep 10;2(9):1050-1071.e7. doi: 10.1016/j.medj.2021.08.004. Epub 2021 Aug 14. PMID: 34414383; PMCID: PMC8363466.

In this study, antigen-presenting cells were exposed to SARS-CoV-2, MMR, or Tdap antigens and co-cultured with T cells from donors who were either COVID-19 convalescent, uninfected, or vaccinated against COVID-19. The resulting T cell activation was measured with immunologic assays and flow cytometry, and T cell receptor clonotyping and single-cell RNA sequencing were used to identify cross-reacting T cells.

For the purposes of this workshop, we are using a subset of this data; one a sub-sample of one library composed of four samples.

Data Setup

Let’s set up a project directory for the analysis, and talk a bit about project philosophy.

1. First, create a directory for your user and the example project in the workshop directory:

cd
mkdir -p /share/workshop/scRNA_workshop/$USER/scrnaseq_example

2a. Next, go into that directory, create a raw data directory (we are going to call this 00-RawData) and cd into that directory. Let’s then create symbolic links to the fastq files that contains the raw read data.

cd /share/workshop/scRNA_workshop/$USER/scrnaseq_example
mkdir 00-RawData
cd 00-RawData/
ln -s /share/workshop/scRNA_workshop/Data/Pool1_gex_S17_L004_R* .

This directory now contains the reads for each “sample” (in this case just 1).

2b. Let’s create a sample sheet for the project, and store sample names in a file called samples.txt

echo Pool1_gex > ../samples.txt
cat ../samples.txt

3. Now, take a look at the raw data directory.

ls /share/workshop/scRNA_workshop/$USER/scrnaseq_example/00-RawData

4. View the contents of the files using the ‘less’ command, when gzipped used ‘zless’ (which is just the ‘less’ command for gzipped files, q to exit):

Read 1

cd 00-RawData/
zless Pool1_gex_S17_L004_R1_001.fastq.gz

and Read 2

zless Pool1_gex_S17_L004_R2_001.fastq.gz

Detailed explanation of FASTQ file is here. Please read on the description and make sure you can identify which lines correspond to a single read and which lines are the header, sequence, and quality values. Press ‘q’ to exit this screen. Then, let’s figure out the number of reads in this file. A simple way to do that is to count the number of lines and divide by 4 (because the record of each read uses 4 lines). In order to do this use cat to output the uncompressed file and pipe that to “wc” to count the number of lines:

zcat Pool1_gex_S17_L004_R1_001.fastq.gz | wc -l

Divide this number by 4 and you have the number of reads in this file. One more thing to try is to figure out the length of the reads without counting each nucleotide. First get the first 4 lines of the file (i.e. the first record):

zcat Pool1_gex_S17_L004_R1_001.fastq.gz  | head -4

Note the header lines (1st and 3rd line) and sequence and quality lines (2nd and 4th) in each 4-line fastq block. You can isolate the sequence line:

zcat Pool1_gex_S17_L004_R1_001.fastq.gz | head -2 | tail -1

Then, copy and paste the DNA sequence line into the following command (replace [sequence] with the line):

echo -n [sequence] | wc -c

This will give you the length of the read.

Also can do the bash one liner:

echo -n $(zcat Pool1_gex_S17_L004_R1_001.fastq.gz  | head -2 | tail -1) | wc -c

See if you can figure out how this command works.

Quiz