Bioinfo, bench to analysis · an interactive tutorial
⭑ Try OmicOne
Chapter 11Analysis

Marker genes and cell-type annotation

Clustering only gives numbers. Turning “cluster 3” into “B cells” takes two things: the genes each cluster expresses specifically, its marker genes, and prior knowledge of which cells express those genes. This chapter connects the two on pbmc3k and then asks you to annotate it yourself.

Finding marker genes

Seurat’s FindAllMarkers compares each cluster with all other cells in turn, by default with a Wilcoxon rank-sum test. The key columns of the result:

Column Meaning
avg_log2FC log2 of mean expression in the cluster over the rest; 1 means about two-fold higher
pct.1 / pct.2 Fraction of cells with the gene detected in the cluster / in the rest
p_val_adj Bonferroni-adjusted p-value (over all genes)

A good marker has all three: a large fold change, a high pct.1 and a low pct.2. Sorting by p-value alone is not enough: a gene expressed in 95% of all cells and only slightly higher in the cluster can also have a tiny p-value.

markers <- FindAllMarkers(obj, only.pos = TRUE)
Marker gene explorerReal data
Loading data…

Pick a cluster in the widget to see its marker table; then click a gene to see it on the UMAP and as violins per cluster. Try MS4A1, LYZ, NKG7 and PPBP.

From markers to cell identity

Annotation means matching marker genes to known cell types. The widget below shows a few markers for each pbmc3k cluster; make your call first, then reveal the standard annotation from the Seurat tutorial.

Annotate the cell types yourselfReal data
Loading data…
Open after the quiz: the markers used in the Seurat tutorial
Markers Cell type
IL7R, CCR7 Naive CD4⁺ T cells
IL7R, S100A4 Memory CD4⁺ T cells
CD8A CD8⁺ T cells
GNLY, NKG7 NK cells
MS4A1 B cells
CD14, LYZ CD14⁺ monocytes
FCGR3A, MS4A7 FCGR3A⁺ monocytes
FCER1A, CST3 Dendritic cells
PPBP Platelets

Besides manual annotation, reference-based tools (SingleR, Azimuth, CellTypist and others) annotate automatically. They are fast, but the reference must match your tissue and condition, and the result still needs checking against markers.

Common pitfalls

  • Deciding on one gene. Use several markers, and check that genes which should be absent really are.
  • Forcing a name on every cluster. “Low quality”, “doublets” and “unknown” are legitimate labels.
  • Using cell-level p-values as evidence of differences between conditions. Compare conditions with pseudobulk; the unit is the sample.
  • Accepting reference annotations wholesale. Cell types missing from the reference get forced into the closest category.