Spatially Derived Clusters - Answer Key

Author

Noor Sohail

Published

April 18, 2026

Exercise 1

  1. What steps/functions did we use to calculate clusters previously?
Figure 1: Single-cell RNA-seq analysis workflow.
Image source: Intro to scRNA-seq analysis.
  • Principle component analysis: RunPCA()
  • Evaluate necessity of integration
  • Find k-nearest neighbors: FindNeighbors()
  • Cluster cells: FindClusters()

Exercise 2

  1. What does the UMAP look like when use the BANKSY derived harmony latent space to calculate UMAP coordinates?

First we calculate UMAP on the BANKSY harmony latent space.

# Run UMAP on BANKSY harmony latent space
seurat_banksy <- RunUMAP(seurat_banksy,
                         reduction = "harmony.banksy",
                         reduction.name = "umap.harmony.banksy", 
                         return.model = TRUE, 
                         dims = 1:30,
                         seed.use = 12345)
seurat_banksy
An object of class Seurat 
36170 features across 135798 samples within 2 assays 
Active assay: Spatial.008um (18085 features, 2000 variable features)
 2 layers present: counts, data
 1 other assay present: sketch
 7 dimensional reductions calculated: pca.sketch, umap.sketch, full.pca.sketch, full.umap.sketch, pca.banksy, harmony.banksy, umap.harmony.banksy
 2 spatial fields of view present: P5CRC.008um P5NAT.008um

Then we can visualize what each of the resultant clusters appear like on the BANKSY derived UMAP space:

DimPlot(seurat_banksy, 
        group.by = c("banksy_cluster",
                     "seurat_cluster.projected"),
        reduction = "umap.harmony.banksy",
        label = TRUE)
Figure 2: UMAP of both BANKSY derived clusters and gene expression derived clusters.

The BANKSY clusters align much better with the BANKSY derived UMAP coordinates. This is due to the fact that they have the same underlying structure. We can also see more clearly that the cluster 1 tumor cells we identified earlier appears to have been split into different sub-groups. This aligns with what we see in the spatial slide, where there appears to be spatially constrained clusters tumor groups in the BANKSY clusters.

Exercise 3

  1. Use the DotPlot() function in conjunction with marker_list to see if clusters correspond well with celltypes.
marker_list <- list(
  "B cells" = c("IGKC", "IGHM", "CD79A", "MS4A1", "MZB1"),
  "Endothelial cells" = c("PECAM1", "VWF", "PLVAP", "ENG", "KLF2"),
  "Fibroblasts" = c("COL1A1", "COL3A1", "DCN", "LUM", "COL6A2"),
  "Intestinal epithelial cells" = c("CLCA1", "FCGBP", "MUC2", "PIGR", "ZG16"),
  "Myeloid cells" = c("C1QC", "SELENOP", "SPP1", "LYZ", "CD68"),
  "Neural cells" = c("NRXN1", "L1CAM", "NCAM1", "VIP", "CALB2"),
  "Smooth muscle cells" = c("TAGLN", "ACTA2", "MYH11", "MYL9", "CNN1"),
  "T cells" = c("TRAC", "CD3E", "TRBC2", "IL7R", "CD52"),
  "Tumor cells" = c("CEACAM6", "CEACAM5", "EPCAM", "KRT8", "LCN2")
)
DotPlot(seurat_banksy,
        marker_list,
        group.by = "banksy_cluster",
        cluster.idents = TRUE) +
  theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))

  1. Roughly identify which clusters correspond to which celltypes to provide better context for future analyses.

Based upon the dotplot, the good thing is that while it may not be the clearest signal, we are able to identify major populations of cells in the clusters.

Warning

Most of these annotations are wrong, need to fix

Cluster Cell type
1 B cells
2 Tumor cells
3 Tumor cells
4 Intestinal epithelial cells
5 Endothelial cells
6 B cells
7 B cells / T cells
8 Smooth muscle cells
9 Smooth muscle cells
10 T cells
11 Intestinal epithelial cells
12 Fibroblasts
13 Fibroblasts
14 Tumor cells
15 Tumor cells
16 Intestinal epithelial cells
17 Myeloid cells (?)
18 Neural cells
19 Neural cells
20 ?

Back to Lesson >>

Back to Schedule

Reuse

CC-BY-4.0