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?
  • 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 resulting clusters appear like on the BANKSY derived UMAP space:

# Create DimPlot using the BANKSY derived UMAP space
DimPlot(seurat_banksy, 
        group.by = c("banksy_cluster",
                     "seurat_cluster.projected"),
        reduction = "umap.harmony.banksy",
        label = TRUE)
Figure 1: 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 appear 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 of tumor bins in the BANKSY clusters.

Exercise 3

  1. Use the DotPlot() function in conjunction with marker_list to see if clusters correspond well with celltypes.
# Create marker list
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 = 45, 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.

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

Back to Lesson >>

Back to Schedule

Reuse

CC-BY-4.0