Clustering Quality Control - Answer Key

Authors

Noor Sohail

Will Gammerdinger

Published

August 18, 2026

Exercise 1

  1. Hypothesize the clusters corresponding to each of the different clusters in the table:
Cell Type Clusters
CD14+ monocytes ?
FCGR3A+ monocytes ?
Conventional dendritic cells ?
Plasmacytoid dendritic cells ?
Macrophages -
B cells ?
T cells ?
CD4+ T cells ?
CD8+ T cells ?
NK cells ?
Megakaryocytes ?
Erythrocytes ?
Unknown ?
# List of known celltype markers
markers <- list(
  "CD14+ monocytes" = c("CD14", "LYZ"),
  "FCGR3A+ monocytes" = c("FCGR3A", "MS4A7"),
  "Conventional dendritic cells" = c("FCER1A", "CST3"),
  "Plasmacytoid dendritic cells" = c("IL3RA", "GZMB", "SERPINF1", "ITM2C"),
  "B cells" = c("CD79A", "MS4A1"),
  "T cells" = c("CD3D"),
  "CD4+ T cells" = c("IL7R", "CCR7"),
  "CD8+ T cells" = c("CD8A"),
  "NK cells" = c("GNLY", "NKG7"),
  "Megakaryocytes" = c("PPBP"),
  "Erythrocytes" = c("HBB", "HBA2")
)

# Create dotplot based on RNA expression
DotPlot(seurat_integrated, markers, assay = "RNA") +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))
Figure 1: DotPlot representing top marker genes for a variety of cell types, with each circle representing the average expression of that cluster and the size showing the percentage of cells that express that gene.
# Iterate through each celltype
for (celltype in names(markers)) {
  # Grab genes for each celltype
  genes <- markers[[celltype]]
  
  # UMAP plot
  p <- FeaturePlot(seurat_integrated,
                   reduction = "umap",
                   features = genes,
                   order = TRUE,
                   min.cutoff = "q10",
                   label = TRUE) + 
        patchwork::plot_annotation(title = celltype)
  
  print(p)
}

Cell Type Clusters
CD14+ monocytes 2, 4
FCGR3A+ monocytes 10
Conventional dendritic cells 13
Plasmacytoid dendritic cells 16
Marcrophages -
B cells 7, 11, 14
T cells 1, 3, 6
CD4+ T cells 1, 3, 6
CD8+ T cells 5
NK cells 9, 12
Megakaryocytes 15
Erythrocytes -
# List of known celltype markers
markers = {
    "CD14+ monocytes": ["CD14", "LYZ"],
    "FCGR3A+ monocytes": ["FCGR3A", "MS4A7"],
    "Conventional dendritic cells": ["FCER1A", "CST3"],
    "Plasmacytoid dendritic cells": ["IL3RA", "GZMB", "SERPINF1", "ITM2C"],
    "B cells": ["CD79A", "MS4A1"],
    "T cells": ["CD3D"],
    "CD4+ T cells": ["CD3D", "IL7R", "CCR7"],
    "CD8+ T cells": ["CD3D", "CD8A"],
    "NK cells": ["GNLY", "NKG7"],
    "Megakaryocytes": ["PPBP"],
    "Erythrocytes": ["HBB", "HBA2"],
}
sc.pl.dotplot(adata_integrated, 
              markers, 
              groupby = "leiden_0.8")
Figure 2: DotPlot representing top marker genes for a variety of cell types, with each circle representing the average expression of that cluster and the size showing the percentage of cells that express that gene.
for celltype, genes in markers.items():
    # Include cluster column + markers
    colors = ["leiden_0.8"] + genes

    # UMAP plot
    sc.pl.embedding(adata_integrated,
                    basis = "umap_scvi",
                    color = colors,
                    legend_loc = "on data",
                    ncols = 2,
                    show = False)

    plt.suptitle(celltype)
    plt.tight_layout()
    plt.show()

Based on the figures from above, we can roughly say that the cluster map to these celltypes:

Cell Type Clusters
CD14+ monocytes 2
FCGR3A+ monocytes 13
Conventional dendritic cells 3
Plasmacytoid dendritic cells 5
Macrophages -
B cells 10, 11
T cells 0, 1, 6, 8
CD4+ T cells 0, 1, 4, 6
CD8+ T cells 8
NK cells 9
Megakaryocytes 15
Erythrocytes -

Back to Lesson >>

Back to Schedule

Reuse

CC-BY-4.0