Single-cell RNA sequencing (scRNA-seq) measures gene expression in thousands of individual cells at once, so you can see which cell types are in a tissue, how they differ and how they change between conditions. Bulk RNA-seq averages a whole sample; single-cell data shows the cells behind the average. This guide walks through the standard analysis workflow with Scanpy (Python) and Seurat (R), and the decisions that change the result.
What the data looks like
Droplet methods such as 10x Genomics Chromium tag each cell with a barcode and each molecule with a unique molecular identifier (UMI). After processing with Cell Ranger, STARsolo or alevin-fry, you get a count matrix: genes as rows, cells as columns, mostly zeros. A typical experiment has 5,000–20,000 cells per sample and detects 1,000–5,000 genes per cell.
Step 1: Quality control of cells
Three numbers per cell drive QC:
- Total UMI counts and number of genes detected: very low values mean empty droplets or broken cells; very high values suggest doublets.
- Percentage of mitochondrial reads: high values (often above 10–20%, tissue-dependent) indicate stressed or dying cells.
Plot the distributions before choosing thresholds, and choose them per sample rather than copying a tutorial's numbers. Remove doublets (two cells in one droplet) with scDblFinder or Scrublet, and consider ambient-RNA correction with SoupX or CellBender.
Step 2: Normalisation
Cells differ in sequencing depth, so counts are normalised. The common default is to scale each cell to 10,000 counts and log-transform (log1p). Seurat's SCTransform and Scanpy's Pearson-residual method are alternatives that handle depth differences more carefully.
import scanpy as sc
adata = sc.read_10x_h5("filtered_feature_bc_matrix.h5")
sc.pp.filter_cells(adata, min_genes=200)
adata.var["mt"] = adata.var_names.str.startswith("MT-")
sc.pp.calculate_qc_metrics(adata, qc_vars=["mt"], inplace=True)
adata = adata[adata.obs.pct_counts_mt < 15].copy()
sc.pp.normalize_total(adata, target_sum=1e4)
sc.pp.log1p(adata)Step 3: Highly variable genes and PCA
Select 2,000–3,000 highly variable genes, scale them and run PCA. Use an elbow plot to choose how many principal components to keep, typically 20–50. Downstream steps work in this reduced space.
Step 4: Batch correction and integration
When samples come from different donors, days or runs, technical batch effects can split one cell type into several clusters. Integrate with Harmony, scVI or Seurat's anchor-based method. Check the result: cells of the same type should mix across batches, but real biological differences between conditions should not disappear.
Step 5: Clustering and visualisation
Build a k-nearest-neighbour graph on the PCs and cluster with the Leiden algorithm. Visualise with UMAP.
sc.pp.highly_variable_genes(adata, n_top_genes=2000)
sc.pp.pca(adata)
sc.pp.neighbors(adata, n_pcs=30)
sc.tl.leiden(adata, resolution=0.5)
sc.tl.umap(adata)
sc.pl.umap(adata, color=["leiden"])Two cautions: the resolution parameter decides how many clusters you get, so try several and keep the one that matches biology; and UMAP distances are not meaningful, so do not read "these clusters are close" as "these cell types are related".
Step 6: Cell type annotation
Find marker genes for each cluster (Wilcoxon test in Scanpy, FindAllMarkers in Seurat) and match them to known markers, for example CD3E for T cells, MS4A1 for B cells and LYZ for monocytes. Reference-based tools such as CellTypist, SingleR and Azimuth speed this up, but always check their labels against markers yourself.
Step 7: Differential expression between conditions
Comparing a cell type between conditions is where many analyses go wrong. Testing every cell as an independent replicate inflates significance enormously. The accepted approach is pseudobulk: sum counts per cell type per sample, then use DESeq2 or edgeR with samples as replicates. This needs biological replicates, at least three per condition.
Step 8: Going further
- Trajectory and pseudotime (PAGA, Monocle 3, Slingshot) for developmental processes.
- RNA velocity (scVelo) to infer the direction of change.
- Cell–cell communication (CellChat, LIANA) from ligand–receptor expression.
- Spatial transcriptomics to put cell types back in the tissue.
Common mistakes
- Copying QC thresholds from a tutorial on a different tissue.
- Over-clustering, then naming every cluster as a new cell type.
- Treating cells as replicates in differential expression.
- Removing real biological signal with aggressive batch correction.
- Interpreting UMAP distances literally.
Learn single-cell analysis
You can practise on public 10x datasets such as PBMC 3k. Our Single-Cell RNA-seq Analysis course covers this full workflow in Python and R with a certificate, including pseudobulk differential expression and annotation. If you are new to RNA-seq, start with the bulk RNA-seq workflow and the RNA-seq Data Analysis course; for the spatial side, see Spatial Transcriptomics Analysis.
Written by the Solagene team for research and education. Found an error? Tell us and we will correct it.