This repository contains a comprehensive workflow for processing and analyzing single-cell RNA sequencing (scRNA-seq) data using Python. The tutorials are based on the SIB Swiss Institute of Bioinformatics training materials.
The analysis is primarily conducted on Peripheral Blood Mononuclear Cell (PBMMC) and ETV6-RUNX1 (a common leukemia fusion gene) samples. This data allows for the exploration of diverse immune cell populations, batch effect correction, and trajectory modeling.
The data used in this workflow comes from:
Caron, M., St-Onge, P., Sontag, T. et al. Single-cell analysis of childhood leukemia reveals a link between developmental states and ribosomal protein expression as a source of intra-individual heterogeneity. Sci Rep 10, 8079 (2020). https://doi.org/10.1038/s41598-020-64929-x
The raw count matrices and FASTQ files can be downloaded here:
wget https://single-cell-transcriptomics-python.s3.eu-central-1.amazonaws.com/course_data.tar.gz
tar -xvf course_data.tar.gz
rm course_data.tar.gzThe course_data folder contains filtered feature-barcode matrices in .mtx format for 3 ETV6-RUNX1 samples and 3 PBMMC samples, along with example READS.
Loads 10x Genomics data into AnnData objects. It covers the calculation of quality control metrics (mitochondrial, ribosomal, and hemoglobin gene percentages) and the application of thresholds to remove low-quality cells.
Implements Shifted Logarithm normalization and identifies highly variable genes. It also handles data scaling and assigns categorical cell cycle phases to cells.
Explores PCA (Principal Component Analysis) to capture major variance and UMAP for non-linear visualization. Learn how to select the optimal number of PCs for downstream tasks.
Demonstrates the use of the Harmony algorithm to integrate samples from different batches, ensuring that clusters are formed by cell type rather than technical origin.
Applies graph-based clustering using the Leiden algorithm. It explores how changing the "resolution" parameter affects the granularity of identified cell populations.
Focuses on identifying marker genes for clusters and performing cell type annotation. Includes a demonstration of Label Transfer (mapping labels from a reference to a new dataset) using sc.tl.ingest.
Goes beyond expression to infer Gene Regulatory Networks (GRNs). It identifies regulons (transcription factors and their targets) and scores their activity across cells.
Models cellular development as a continuous path. It uses Diffusion Maps and Diffusion Pseudotime (DPT) to rank cells by their developmental maturity relative to a "root" cell.
Estimates the future state of individual cells by analyzing the ratio of unspliced vs. spliced mRNA transcripts, providing a "vector field" of cellular differentiation.
To run these notebooks, I used a Conda environment to manage dependencies, but of course you can use other alternatives.
- Create the environment:
conda env create -f environment.yml- Activate the environment:
conda activate scrna-seq-envFor the notebooks to work out-of-the-box with your data, I suggest organizing your repo like this:
.
├── 01_scrna_seq_analysis_tools_qc.ipynb
├── 02_scrna_seq_normalization_scaling.ipynb
├── ... (other notebooks)
├── course_data/ <-- Place the downloaded/extracted data here
├── environment.yml
└── README.md