Workflows

Your first single-cell RNA-seq analysis: the steps

A step-by-step first single-cell RNA-seq analysis: QC, doublets, normalisation, PCA, clustering, UMAP, annotation and pseudobulk differential expression.

A single-cell RNA-seq experiment produces a matrix in which each row is a cell and each column is a gene. The first analysis is the process of turning that matrix into clusters, cell types and, eventually, a biological claim. The steps are now fairly standard, and both Scanpy in Python and Seurat in R implement them. What is not standard is the judgement required at each step. This guide walks through the order of operations and the decisions that matter most.

Before you start: know what the matrix contains

Most workflows begin with the output of a preprocessing tool such as Cell Ranger or STARsolo: a count matrix, a list of cell barcodes and a list of features. Check which reference genome and annotation version were used, and whether the matrix contains all barcodes or only those that passed the preprocessing tool's own cell calling.

You also need metadata: which sample each barcode came from, the experimental condition, the donor or replicate, and any technical batch. Single-cell analysis without sample metadata quickly becomes a descriptive exercise, because you cannot tell whether a cluster reflects biology, a donor or a sequencing run.

Step 1: load the data and look at it

Load the matrix and inspect the distributions before changing anything. How many cells and genes are there? What do the total counts and gene counts per cell look like? Do a few cells dominate? Plot the number of genes detected per cell and the mitochondrial fraction. These views show whether the matrix looks like a typical experiment.

Step 2: filter cells and genes

Low-quality cells and empty droplets add noise to every downstream step. Filtering removes them, but the thresholds are dataset-specific. The companion guide on single-cell quality filters covers the metrics and how to choose cut-offs from the distributions rather than from habit.

Gene filtering is usually lighter. Many workflows keep genes detected in at least a few cells, then select highly variable genes later. Record any gene filter so the decision can be reviewed.

Step 3: identify doublets

A doublet is a droplet that captured two cells. Its expression profile looks like a mixture of two cell types, and it can create spurious intermediate clusters. Tools such as scDblFinder, DoubletFinder and Scrublet score cells for doublet likelihood. Run doublet detection per sample, before merging, because the expected doublet rate depends on how many cells were loaded.

Remove high-scoring cells with a threshold appropriate to the tool and the experiment, and keep the scores in the metadata. Doublet detection is probabilistic; some doublets remain and some real cells are removed. Treat the scores as evidence, not as a perfect classifier.

Step 4: normalise

Raw counts are affected by how many reads each cell received. The common approach is to divide each cell's counts by its total, multiply by a scale factor and take the logarithm. Scanpy's normalize_total followed by log1p, and Seurat's NormalizeData, implement this. Seurat users sometimes prefer SCTransform, which models counts with a regularised negative binomial and returns residuals.

Normalisation makes cells more comparable, but it does not make the values absolute. A normalised value is not a concentration, and comparing one gene's value across cells assumes the usual compositional caveats. For differential expression, return to counts and use a method designed for them.

Step 5: select highly variable genes

Most genes carry little information for clustering: housekeeping genes vary mildly, and many genes are near zero. Highly variable gene selection keeps the genes that change most between cells, often a few thousand. Scanpy's highly_variable_genes and Seurat's FindVariableFeatures are the usual entry points.

The choice affects the clusters. Check that marker genes of expected cell types are not excluded, and avoid letting technical variation such as mitochondrial content or cell cycle dominate the selection. Some workflows regress out cell cycle or mitochondrial signal; do this deliberately, because removing real biology can also remove the differences you want to study.

Step 6: scale, reduce dimensions and integrate

Scale the selected genes so that highly expressed genes do not dominate, then run principal component analysis. PCA compresses thousands of genes into a smaller number of components that capture the main axes of variation. Inspect the variance explained and the elbow to choose how many components to carry forward.

If samples or batches separate on the PCA, integration may be needed. Harmony, scVI and Seurat's integration methods embed cells from different batches in a shared space. Integration is not automatically beneficial: aggressive correction can mix distinct cell types. Run it when there is a technical reason, and compare integrated and unintegrated results.

Step 7: build the neighbour graph and cluster

Clustering operates on a graph in which each cell is connected to similar cells. Scanpy uses neighbors and leiden; Seurat uses FindNeighbors and FindClusters. The Leiden algorithm is common because it produces well-connected communities.

The resolution parameter controls granularity. Low resolution gives few, broad clusters; high resolution splits them. There is no correct number of clusters, and the algorithm is not discovering a ground truth. Try a range, check stability, and ask whether the splits correspond to markers and to known biology.

Step 8: visualise with UMAP

UMAP is the usual way to display clusters. It is good at showing local neighbourhoods and poor at preserving global distances. Two clusters that look far apart on a UMAP are not necessarily more different than two clusters that look close, and cluster sizes on the plot do not represent cell proportions.

Use UMAP for display and for sanity checks, not for quantitative claims. If you need to compare cell type proportions between conditions, compute the proportions from the metadata and model them, rather than measuring areas on the embedding.

Step 9: find markers and annotate cell types

Marker discovery compares each cluster with the others, often with a Wilcoxon rank-sum test in Scanpy or Seurat. The result is a ranked list of genes that are relatively enriched in the cluster. Filter by effect size and detection rate, not only by p-value, because with thousands of cells even tiny differences become significant.

Annotation combines marker lists with canonical markers from the literature. Check several markers per type and look at expression across clusters, not just the top gene. Reference-based tools such as SingleR or Azimuth can help, but they transfer labels from a reference and inherit its limitations. A cluster label is a hypothesis supported by markers, not a fact established by the clustering algorithm.

Step 10: differential expression

The most common mistake in single-cell analysis is treating cells as independent replicates. Cells from one donor are not independent samples, and a test that treats them as such will produce very small p-values for trivial differences.

The safer approach is pseudobulk: sum counts within each cell type and each donor, then analyse the resulting bulk-like matrix with DESeq2, edgeR or limma-voom. This respects the experimental unit and lets you include covariates such as batch. If there is only one donor per condition, any difference is confounded with donor, and the analysis should be described as exploratory. The same logic about replication applies to single-cell experiments as to bulk RNA-seq, and the guide to replicate numbers explains why.

What comes after the first pass

Trajectory inference, RNA velocity, cell-cell communication and transcription-factor activity can add useful hypotheses. They are model-based and assumption-heavy, so present them as exploratory unless they are supported by independent data. The standard workflow is still the backbone: quality control, normalisation, clustering, annotation and a defensible differential-expression design.

Record software versions, parameters and thresholds at every step; results are sensitive to filtering and resolution, and a reader cannot judge a cluster plot without them.

Key points

  • Check the matrix, genome version and sample metadata before analysis.
  • Filter low-quality cells with dataset-specific thresholds, and remove doublets per sample.
  • Normalise for sequencing depth, then select highly variable genes for clustering.
  • Integrate batches only when there is a technical reason; over-integration can merge real cell types.
  • Clustering resolution is a choice, not a truth, and UMAP distances are not quantitative.
  • Annotate clusters with several markers and treat labels as hypotheses.
  • Test differential expression on pseudobulk by donor, not on individual cells.

When to ask for help

If you have a count matrix but are unsure about filtering, integration or differential-expression design, an analyst can review the decisions before the results are written up. You can order an analysis or discuss a project through our single-cell analysis service. For a fuller treatment with code, see the Scanpy and Seurat workflow.

Sources

When to ask for help. If your data or design do not fit a tutorial, order an analysis and we will reply with a fixed price.

Written by the Solagene team for research and education. Found an error? Tell us and we will correct it.