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