Single-Cell RNA-seq
Single-cell RNA-seq (scRNA-seq) measures gene expression in individual cells, revealing cellular heterogeneity invisible to bulk RNA-seq.
The methods in this section follow Single-cell best practices: Heumos, L., Schaar, A.C., Lance, C. et al. Best practices for single-cell analysis across modalities, Nature Reviews Genetics 24, 550-572 (2023). The book and its code are Apache 2.0 licensed.
Every figure and every number on these pages comes from a real run of the code you can read on the page, in one pinned container, on the PBMC datasets described below.
Background
Section titled “Background”What single-cell RNA-seq measures, how the platforms differ, and what makes the analysis hard.
| Page | What it does |
|---|---|
| What is Single-Cell RNA-seq | what single-cell RNA-seq measures and why bulk RNA-seq cannot see it |
| Experimental Protocols | droplet-based and plate-based platforms, and what each is for |
| Key Challenges | dropout, doublets, ambient RNA, batch effects, and scaling |
| Analysis Overview | the standard workflow from count matrix to insight, and the tools at each step |
| From Reads to a Matrix | Cell Ranger and nf-core/scrnaseq commands, and the count matrix they return |
The Scanpy workflow
Section titled “The Scanpy workflow”From the count matrix to an embedding, one page per step.
| Page | What it does |
|---|---|
| The AnnData Object | the AnnData structure and loading a 10x matrix into it |
| Quality Control | per-cell QC metrics and MAD-based filtering |
| Normalization | the shifted logarithm and analytic Pearson residuals |
| Feature Selection | highly variable genes, four flavours compared |
| Dimensionality Reduction | PCA, the variance ratio, UMAP and t-SNE |
Cellular structure
Section titled “Cellular structure”Clustering the embedding and naming what the clusters are.
| Page | What it does |
|---|---|
| Clustering | Leiden clustering and the resolution sweep |
| Annotation | marker genes, marker scores, and cluster labels |
| Marker Genes | ranking genes per cluster with the Wilcoxon test |
Conditions
Section titled “Conditions”Comparing conditions and batches.
| Page | What it does |
|---|---|
| Differential Expression | the cell-level view against pseudobulk with PyDESeq2 |
| Integration | two 10x chemistries, batch structure seen, then Harmony and scVI |
The datasets
Section titled “The datasets”The section computes on three public datasets, all shipped inside the section container and pinned by checksum.
| Dataset | Used on | Source |
|---|---|---|
| PBMC 3k | the Scanpy workflow pages | 10x Genomics, Cell Ranger 1.1.0, 2017, 2,700 cells |
| PBMC 10k v3 | the integration page | 10x Genomics, 2019, ~11,700 cells |
| Kang 2018 | the differential expression page | Kang et al. 2018, doi 10.1038/nbt.4042, 8 lupus patients, control and IFN-beta stimulated |