scplotter to work with Akoya CODEX data prepared by Seurat¶

See: https://satijalab.org/seurat/articles/seurat5_spatial_vignette_2#human-lymph-node-akoya-codex-system

Go back to scplotter documentation: https://pwwang.github.io/scplotter/

InĀ [1]:
options(future.globals.maxSize = 512 * 1024^3) # 512 GB
suppressPackageStartupMessages({
    library(Seurat)
})
# Load the scplotter package
# library(scplotter)
devtools::load_all()
# devtools::load_all("../../../plotthis")

codex.obj <- LoadAkoya(filename = "data/Akoya_CODEX/LN7910_20_008_11022020_reg001_compensated.csv",
    type = "processor", fov = "HBM754.WKLP.262")
codex.obj <- NormalizeData(object = codex.obj, normalization.method = "CLR", margin = 2)
codex.obj <- ScaleData(codex.obj)
VariableFeatures(codex.obj) <- rownames(codex.obj)  # since the panel is small, treat all features as variable.
codex.obj <- RunPCA(object = codex.obj, npcs = 20, verbose = FALSE)
codex.obj <- RunUMAP(object = codex.obj, dims = 1:20, verbose = FALSE)
codex.obj <- FindNeighbors(object = codex.obj, dims = 1:20, verbose = FALSE)
codex.obj <- FindClusters(object = codex.obj, verbose = FALSE, resolution = 0.4, n.start = 1)
codex.obj
ℹ Loading scplotter
Warning message:
ā€œData is of class matrix. Coercing to dgCMatrix.ā€
Normalizing layer: counts

Normalizing across cells

Centering and scaling data matrix

Warning message in svd.function(A = t(x = object), nv = npcs, ...):
ā€œYou're computing too large a percentage of total singular values, use a standard svd instead.ā€
Warning message:
ā€œThe default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric
To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation'
This message will be shown once per sessionā€
An object of class Seurat 
28 features across 188450 samples within 1 assay 
Active assay: Akoya (28 features, 28 variable features)
 3 layers present: counts, data, scale.data
 2 dimensional reductions calculated: pca, umap
 1 spatial field of view present: HBM754.WKLP.262
InĀ [Ā ]:
options(repr.plot.width = 12, repr.plot.height = 6)

p1 <- CellDimPlot(codex.obj)
p2 <- SpatDimPlot(codex.obj)

p1 + p2
ℹ Loading scplotter
No description has been provided for this image
InĀ [14]:
options(repr.plot.width = 12, repr.plot.height = 6)

SpatFeaturePlot(codex.obj, features = c("CD34", "CD21", "Lyve1"))
No description has been provided for this image
InĀ [12]:
x <- sessionInfo()
x <- capture.output(print(x))
# hide the BLAS/LAPACK paths
x <- x[!startsWith(x, "BLAS/LAPACK:")]
cat(paste(x, collapse = "\n"))
R version 4.4.3 (2025-02-28)
Platform: x86_64-conda-linux-gnu
Running under: Red Hat Enterprise Linux 8.10 (Ootpa)

Matrix products: default

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

time zone: America/Chicago
tzcode source: system (glibc)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] scplotter_0.4.0    future_1.58.0      Seurat_5.3.0       SeuratObject_5.1.0
[5] sp_2.2-0          

loaded via a namespace (and not attached):
  [1] fs_1.6.6                    matrixStats_1.5.0          
  [3] spatstat.sparse_3.1-0       bitops_1.0-9               
  [5] sf_1.0-20                   devtools_2.4.5             
  [7] httr_1.4.7                  RColorBrewer_1.1-3         
  [9] repr_1.1.7                  profvis_0.4.0              
 [11] tools_4.4.3                 sctransform_0.4.2          
 [13] R6_2.6.1                    lazyeval_0.2.2             
 [15] uwot_0.2.3                  urlchecker_1.0.1           
 [17] withr_3.0.2                 gridExtra_2.3              
 [19] progressr_0.15.1            quantreg_6.00              
 [21] cli_3.6.5                   Biobase_2.62.0             
 [23] spatstat.explore_3.4-3      fastDummies_1.7.5          
 [25] iNEXT_3.0.1                 labeling_0.4.3             
 [27] spatstat.data_3.1-6         proxy_0.4-27               
 [29] ggridges_0.5.6              pbapply_1.7-2              
 [31] pbdZMQ_0.3-14               stringdist_0.9.15          
 [33] parallelly_1.45.0           sessioninfo_1.2.3          
 [35] VGAM_1.1-13                 rstudioapi_0.17.1          
 [37] generics_0.1.4              shape_1.4.6.1              
 [39] ica_1.0-3                   spatstat.random_3.4-1      
 [41] dplyr_1.1.4                 Matrix_1.7-3               
 [43] S4Vectors_0.40.2            abind_1.4-5                
 [45] terra_1.8-42                lifecycle_1.0.4            
 [47] SummarizedExperiment_1.32.0 SparseArray_1.2.4          
 [49] Rtsne_0.17                  grid_4.4.3                 
 [51] promises_1.3.2              crayon_1.5.3               
 [53] miniUI_0.1.2                lattice_0.22-7             
 [55] cowplot_1.1.3               pillar_1.10.2              
 [57] GenomicRanges_1.54.1        rjson_0.2.23               
 [59] future.apply_1.20.0         codetools_0.2-20           
 [61] glue_1.8.0                  spatstat.univar_3.1-3      
 [63] data.table_1.17.4           remotes_2.5.0              
 [65] vctrs_0.6.5                 png_0.1-8                  
 [67] spam_2.11-1                 testthat_3.2.3             
 [69] gtable_0.3.6                assertthat_0.2.1           
 [71] cachem_1.1.0                S4Arrays_1.2.1             
 [73] mime_0.13                   tidygraph_1.3.0            
 [75] survival_3.8-3              SingleCellExperiment_1.24.0
 [77] units_0.8-5                 ellipsis_0.3.2             
 [79] fitdistrplus_1.2-2          scRepertoire_2.2.1         
 [81] ROCR_1.0-11                 nlme_3.1-168               
 [83] usethis_3.1.0               RcppAnnoy_0.0.22           
 [85] evd_2.3-7.1                 GenomeInfoDb_1.38.8        
 [87] rprojroot_2.0.4             irlba_2.3.5.1              
 [89] KernSmooth_2.23-26          plotthis_0.7.0             
 [91] colorspace_2.1-1            BiocGenerics_0.48.1        
 [93] DBI_1.2.3                   tidyselect_1.2.1           
 [95] compiler_4.4.3              SparseM_1.84-2             
 [97] xml2_1.3.8                  desc_1.4.3                 
 [99] ggdendro_0.2.0              DelayedArray_0.28.0        
[101] plotly_4.10.4               scales_1.4.0               
[103] classInt_0.4-11             lmtest_0.9-40              
[105] stringr_1.5.1               digest_0.6.37              
[107] goftest_1.2-3               spatstat.utils_3.1-4       
[109] XVector_0.42.0              htmltools_0.5.8.1          
[111] pkgconfig_2.0.3             base64enc_0.1-3            
[113] MatrixGenerics_1.14.0       fastmap_1.2.0              
[115] rlang_1.1.6                 GlobalOptions_0.1.2        
[117] htmlwidgets_1.6.4           shiny_1.10.0               
[119] farver_2.1.2                zoo_1.8-14                 
[121] jsonlite_2.0.0              RCurl_1.98-1.17            
[123] magrittr_2.0.3              GenomeInfoDbData_1.2.11    
[125] dotCall64_1.2               patchwork_1.3.0            
[127] IRkernel_1.3.2              Rcpp_1.0.14                
[129] evmix_2.12                  ggnewscale_0.5.1           
[131] viridis_0.6.5               reticulate_1.42.0          
[133] truncdist_1.0-2             stringi_1.8.7              
[135] ggalluvial_0.12.5           ggraph_2.2.1               
[137] brio_1.1.5                  zlibbioc_1.48.2            
[139] MASS_7.3-64                 plyr_1.8.9                 
[141] pkgbuild_1.4.8              parallel_4.4.3             
[143] listenv_0.9.1               ggrepel_0.9.6              
[145] forcats_1.0.0               deldir_2.0-4               
[147] graphlayouts_1.2.2          IRdisplay_1.1              
[149] splines_4.4.3               gridtext_0.1.5             
[151] tensor_1.5                  circlize_0.4.16            
[153] igraph_2.0.3                uuid_1.2-1                 
[155] spatstat.geom_3.4-1         cubature_2.1.4             
[157] RcppHNSW_0.6.0              reshape2_1.4.4             
[159] stats4_4.4.3                pkgload_1.4.0              
[161] evaluate_1.0.3              tweenr_2.0.3               
[163] httpuv_1.6.15               MatrixModels_0.5-4         
[165] RANN_2.6.2                  tidyr_1.3.1                
[167] purrr_1.0.4                 polyclip_1.10-7            
[169] scattermore_1.2             ggplot2_3.5.2              
[171] ggforce_0.4.2               xtable_1.8-4               
[173] e1071_1.7-16                RSpectra_0.16-2            
[175] later_1.4.2                 viridisLite_0.4.2          
[177] class_7.3-23                gsl_2.1-8                  
[179] tibble_3.2.1                memoise_2.0.1              
[181] IRanges_2.36.0              cluster_2.1.8.1            
[183] globals_0.18.0