scplotter to work with SlideSeq data prepared by Seurat¶
See: https://satijalab.org/seurat/articles/spatial_vignette#slide-seq
Go back to scplotter documentation: https://pwwang.github.io/scplotter/
In [ ]:
options(future.globals.maxSize = 512 * 1024^3) # 512 GB
suppressPackageStartupMessages({
library(Seurat)
library(SeuratData)
})
# Load the scplotter package
# library(scplotter)
devtools::load_all()
# devtools::load_all("../../../plotthis")
suppressWarnings(suppressMessages({
# InstallData("ssHippo")
slide.seq <- LoadData("ssHippo")
slide.seq <- SCTransform(slide.seq, assay = "Spatial", ncells = 3000, verbose = FALSE)
slide.seq <- RunPCA(slide.seq)
slide.seq <- RunUMAP(slide.seq, dims = 1:30)
slide.seq <- FindNeighbors(slide.seq, dims = 1:30)
slide.seq <- FindClusters(slide.seq, resolution = 0.3, verbose = FALSE)
}))
# slide.seq <- qs2::qs_read("data/slide.seq.qs")
slide.seq
ℹ Loading scplotter ℹ Loading plotthis
An object of class Seurat 42639 features across 53173 samples within 2 assays Active assay: SCT (19375 features, 3000 variable features) 3 layers present: counts, data, scale.data 1 other assay present: Spatial 2 dimensional reductions calculated: pca, umap 1 image present: image
In [ ]:
slide.seq@images$image@
Spatial data from the SlideSeq technology for 53173 samples Associated assay: Spatial Image key: image_
In [ ]:
options(repr.plot.width = 12, repr.plot.height = 6)
slide.seq$log_nCount_Spatial <- log(slide.seq$nCount_Spatial)
p1 <- FeatureStatPlot(slide.seq, features = "log_nCount_Spatial",
ident = "orig.ident", add_point = TRUE, legend.position = "none")
p2 <- SpatialFeaturePlot(slide.seq, features = "log_nCount_Spatial", points_size = 0.5)
p1 + p2
In [24]:
options(repr.plot.width = 12, repr.plot.height = 6)
p1 <- CellDimPlot(slide.seq, reduction = "umap", label = TRUE)
p2 <- SpatialDimPlot(slide.seq, points_size = 0.5)
p1 + p2
In [74]:
options(repr.plot.width = 6, repr.plot.height = 5)
SpatialDimPlot(slide.seq, highlight = "seurat_clusters == 5",
highlight_color = "red", points_size = 0.5, highlight_size = 0.2)
In [80]:
options(repr.plot.width = 12, repr.plot.height = 8)
SpatialFeaturePlot(slide.seq, points_size = 0.1,
features = c("PCP4", "TTR", "PRKCD", "GM5741", "NWD2", "DDN"))