ggspavis 1.2.0
The ggspavis
package contains a set of visualization functions for spatially resolved transcriptomics data, designed to work with the SpatialExperiment Bioconductor object class.
These plotting functions are used in our online book OSTA and other work.
Load some example datasets from the STexampleData package and create some example plots.
library(SpatialExperiment)
library(STexampleData)
library(ggspavis)
# load data in SpatialExperiment format
spe <- Visium_mouseCoronal()
# add some values in 'colData' to annotate spots
colData(spe)$sum <- colSums(counts(spe))
# example plots
plotSpots(spe, annotate = "sum")
plotVisium(spe, fill = "sum", trans = "log", highlight = "in_tissue")
# load data in SpatialExperiment format
spe <- Visium_humanDLPFC()
# example plots
plotSpots(spe, annotate = "ground_truth", palette = "libd_layer_colors")
plotVisium(spe, fill = "ground_truth", highlight = "in_tissue")
# load data in SpatialExperiment format
spe <- seqFISH_mouseEmbryo()
# example plots
plotMolecules(spe, molecule = "Sox2")
sessionInfo()
## R version 4.2.0 RC (2022-04-19 r82224)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04.4 LTS
##
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.15-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.15-bioc/R/lib/libRlapack.so
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_GB 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
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] BumpyMatrix_1.4.0 ggspavis_1.2.0
## [3] ggplot2_3.3.5 STexampleData_1.3.9
## [5] ExperimentHub_2.4.0 AnnotationHub_3.4.0
## [7] BiocFileCache_2.4.0 dbplyr_2.1.1
## [9] SpatialExperiment_1.6.0 SingleCellExperiment_1.18.0
## [11] SummarizedExperiment_1.26.0 Biobase_2.56.0
## [13] GenomicRanges_1.48.0 GenomeInfoDb_1.32.0
## [15] IRanges_2.30.0 S4Vectors_0.34.0
## [17] BiocGenerics_0.42.0 MatrixGenerics_1.8.0
## [19] matrixStats_0.62.0 BiocStyle_2.24.0
##
## loaded via a namespace (and not attached):
## [1] colorspace_2.0-3 rjson_0.2.21
## [3] ellipsis_0.3.2 scuttle_1.6.0
## [5] XVector_0.36.0 farver_2.1.0
## [7] bit64_4.0.5 interactiveDisplayBase_1.34.0
## [9] AnnotationDbi_1.58.0 fansi_1.0.3
## [11] R.methodsS3_1.8.1 sparseMatrixStats_1.8.0
## [13] cachem_1.0.6 knitr_1.38
## [15] jsonlite_1.8.0 png_0.1-7
## [17] R.oo_1.24.0 shiny_1.7.1
## [19] HDF5Array_1.24.0 BiocManager_1.30.17
## [21] compiler_4.2.0 httr_1.4.2
## [23] dqrng_0.3.0 assertthat_0.2.1
## [25] Matrix_1.4-1 fastmap_1.1.0
## [27] limma_3.52.0 cli_3.3.0
## [29] later_1.3.0 htmltools_0.5.2
## [31] tools_4.2.0 gtable_0.3.0
## [33] glue_1.6.2 GenomeInfoDbData_1.2.8
## [35] dplyr_1.0.8 rappdirs_0.3.3
## [37] Rcpp_1.0.8.3 jquerylib_0.1.4
## [39] vctrs_0.4.1 Biostrings_2.64.0
## [41] rhdf5filters_1.8.0 DelayedMatrixStats_1.18.0
## [43] xfun_0.30 stringr_1.4.0
## [45] beachmat_2.12.0 mime_0.12
## [47] lifecycle_1.0.1 edgeR_3.38.0
## [49] zlibbioc_1.42.0 scales_1.2.0
## [51] promises_1.2.0.1 parallel_4.2.0
## [53] rhdf5_2.40.0 yaml_2.3.5
## [55] curl_4.3.2 memoise_2.0.1
## [57] sass_0.4.1 stringi_1.7.6
## [59] RSQLite_2.2.12 highr_0.9
## [61] BiocVersion_3.15.2 filelock_1.0.2
## [63] BiocParallel_1.30.0 ggside_0.2.0
## [65] rlang_1.0.2 pkgconfig_2.0.3
## [67] bitops_1.0-7 evaluate_0.15
## [69] lattice_0.20-45 purrr_0.3.4
## [71] Rhdf5lib_1.18.0 labeling_0.4.2
## [73] bit_4.0.4 tidyselect_1.1.2
## [75] magrittr_2.0.3 bookdown_0.26
## [77] R6_2.5.1 magick_2.7.3
## [79] generics_0.1.2 DelayedArray_0.22.0
## [81] DBI_1.1.2 pillar_1.7.0
## [83] withr_2.5.0 KEGGREST_1.36.0
## [85] RCurl_1.98-1.6 tibble_3.1.6
## [87] crayon_1.5.1 DropletUtils_1.16.0
## [89] utf8_1.2.2 rmarkdown_2.14
## [91] locfit_1.5-9.5 grid_4.2.0
## [93] blob_1.2.3 digest_0.6.29
## [95] xtable_1.8-4 httpuv_1.6.5
## [97] R.utils_2.11.0 munsell_0.5.0
## [99] viridisLite_0.4.0 bslib_0.3.1