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 PBMC workflow lessons 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.
The PBMC workflow uses the public datasets described below. The differential cell abundance lesson uses simulated paired donor samples to show how a change in one population affects the proportions of the others. The trajectory lesson uses measured single-cell qPCR profiles from mouse development. Those values are processed expression measurements, not RNA-seq counts.
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 |
| Analysis Overview | the standard workflow from count matrix to insight, and the tools at each step |
| Key Challenges | batch effects, cell type annotation, pseudobulk differential expression, doublets, and ambient RNA |
| 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 | Wilcoxon marker genes, known markers, marker scores, and cluster labels |
| Trajectories and Pseudotime | Infer cell order and examine root sensitivity with published developmental profiles. |
Conditions
Section titled “Conditions”The condition comparison uses donor samples as replicates. Keep donor, condition and cell type in the metadata through QC and annotation, then aggregate counts within those groups for the pseudobulk analysis. Thousands of cells from one donor do not replace independent donors.
The executed QC page removes metric outliers. It does not run a dedicated doublet model or remove ambient RNA. Read the doublet and ambient RNA discussion before treating that filter as a complete preprocessing procedure for new data.
| Page | What it does |
|---|---|
| Differential Expression | the cell-level view against pseudobulk with PyDESeq2 |
| Differential Cell Abundance | Describe captured cell proportions and compare ratios to a reference population across paired donors. |
| Integration | two 10x chemistries, batch structure seen, then Harmony and scVI |
The datasets
Section titled “The datasets”The PBMC workflow uses three public datasets, shipped inside its section container and pinned by checksum. The cell abundance lesson supplies its separate simulated input and explains the biological quantities that it does not measure. The trajectory lesson supplies its separate public input and source manifest.
| Dataset | Used on | Source |
|---|---|---|
| PBMC 3k | the Scanpy workflow pages | 10x Genomics, Cell Ranger 1.1.0, 2016, 2,700 cells |
| PBMC 10k v3 | the integration page | 10x Genomics, Cell Ranger 3.0.0, 2018, ~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 |
Run an example
Section titled “Run an example”The companion repository is private, so its
single-cell setup instructions
and AnnData runner
require repository access. Build the section image, then run
bash guides/single-cell/anndata-object/run.sh from the repository root. It reads the
PBMC 3k matrix in the image and writes the AnnData file and printed results under
guides/single-cell/anndata-object/outputs/. The public dataset links above remain
available without companion access.
Connect expression to tissue
Section titled “Connect expression to tissue”The Spatial transcriptomics section connects expression matrices to tissue images and spot neighborhoods. Its comparison lesson distinguishes spots, repeated sections, and independent donors.