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 spaceseurat_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:
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
Use the DotPlot() function in conjunction with marker_list to see if clusters correspond well with celltypes.
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.
---title: "Spatially Derived Clusters - Answer Key"author: - Noor Sohaildate: "2026-04-18"license: "CC-BY-4.0"editor_options: markdown: wrap: 72---```{r}#| label: load_libraries_data#| echo: false# Load libraries and datalibrary(Seurat)library(tidyverse)# Set parallelization (multithreading) to speed up calculationsplan("multicore", workers = parallel::detectCores() -1)# Load datasetseurat_banksy <- qs2::qs_read("intermediate/09_seurat_banksy_2.qs")```# Exercise 11. What steps/functions did we use to calculate clusters previously?::: {#fig-sc_workflow .figure}{width=630}Single-cell RNA-seq analysis workflow.<br>_Image source: [Intro to scRNA-seq analysis](https://hbctraining.github.io/Intro-to-scRNAseq/)_.:::- Principle component analysis: `RunPCA()`- Evaluate necessity of integration- Find k-nearest neighbors: `FindNeighbors()`- Cluster cells: `FindClusters()`# Exercise 22. 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.```{r}#| label: RunUMAP_banksy# Run UMAP on BANKSY harmony latent spaceseurat_banksy <-RunUMAP(seurat_banksy,reduction ="harmony.banksy",reduction.name ="umap.harmony.banksy", return.model =TRUE, dims =1:30,seed.use =12345)seurat_banksy```Then we can visualize what each of the resultant clusters appear like on the BANKSY derived UMAP space:```{r}#| label: fig-umap_banksy#| fig-cap: UMAP of both BANKSY derived clusters and gene expression derived clusters.#| fig-width: 14DimPlot(seurat_banksy, group.by =c("banksy_cluster","seurat_cluster.projected"),reduction ="umap.harmony.banksy",label =TRUE)```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 33. Use the `DotPlot()` function in conjunction with `marker_list` to see if clusters correspond well with celltypes.```{r}#| label: marker_listmarker_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"))``````{r}#| label: dotplot#| fig-width: 15#| fig-height: 8DotPlot(seurat_banksy, marker_list,group.by ="banksy_cluster",cluster.idents =TRUE) +theme(axis.text.x =element_text(angle =90, vjust =0.5, hjust=1))```3. 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.::: callout-warningMost 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 >>](11_banksy_clustering.qmd)[Back to Schedule](../schedule/schedule.qmd)