Contents

1 Introduction

The SpatialData package contains a collection of spatially-resolved omics datasets, which have been formatted into the SpatialExperiment, MoleculeExperiment or CytoImageList Bioconductor classes, for use in examples, demonstrations, and tutorials. The datasets are from several different platforms including IMC, MIBI-TOF, Xenium, CosMx and MERFISH. They have been sourced from various publicly available sources.

2 Installation

To install the SpatialDatasets package from GitHub:

if (!require("BiocManager", quietly = TRUE))
    install.packages("BiocManager")

BiocManager::install("SpatialDatasets")

3 Datasets

The package contains the following datasets:

4 Load data

The following examples show how to load the example datasets as SpatialExperiment objects in an R session.

There are two options for loading the datasets: either using named accessor functions or by querying the ExperimentHub database.

4.1 Load using named accessors

library(SpatialExperiment)
library(SpatialDatasets)

4.1.1 Keren et al. (2018)

A study on triple negative breast cancer containing 40 samples measured using MIBI-TOF published by Keren et al. (2018).

# load object
spe <- spe_Keren_2018()

# check object
spe
## class: SpatialExperiment 
## dim: 48 197678 
## metadata(0):
## assays(1): intensities
## rownames(48): Na Si ... Ta Au
## rowData names(0):
## colnames(197678): 1 2 ... 197677 197678
## colData names(40): CellID imageID ... Censored sample_id
## reducedDimNames(0):
## mainExpName: NULL
## altExpNames(0):
## spatialCoords names(2) : x y
## imgData names(0):

5 Generating objects from raw data files

For reference, we include code scripts to generate the SpatialExperiment, MoleculeExperiment or CytoImageList objects from the raw data files.

These scripts are saved in /inst/scripts/ in the source code of the SpatialData package. The scripts include references and links to the data files from the original sources for each dataset.

6 Session information

sessionInfo()
## R version 4.3.1 (2023-06-16)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 22.04.3 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.18-bioc/R/lib/libRblas.so 
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
## 
## 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       
## 
## time zone: America/New_York
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] SpatialDatasets_1.0.0       ExperimentHub_2.10.0       
##  [3] AnnotationHub_3.10.0        BiocFileCache_2.10.0       
##  [5] dbplyr_2.3.4                SpatialExperiment_1.12.0   
##  [7] SingleCellExperiment_1.24.0 SummarizedExperiment_1.32.0
##  [9] Biobase_2.62.0              GenomicRanges_1.54.0       
## [11] GenomeInfoDb_1.38.0         IRanges_2.36.0             
## [13] S4Vectors_0.40.0            BiocGenerics_0.48.0        
## [15] MatrixGenerics_1.14.0       matrixStats_1.0.0          
## [17] BiocStyle_2.30.0           
## 
## loaded via a namespace (and not attached):
##  [1] tidyselect_1.2.0              dplyr_1.1.3                  
##  [3] blob_1.2.4                    filelock_1.0.2               
##  [5] Biostrings_2.70.1             bitops_1.0-7                 
##  [7] fastmap_1.1.1                 RCurl_1.98-1.12              
##  [9] promises_1.2.1                digest_0.6.33                
## [11] mime_0.12                     lifecycle_1.0.3              
## [13] ellipsis_0.3.2                KEGGREST_1.42.0              
## [15] interactiveDisplayBase_1.40.0 RSQLite_2.3.1                
## [17] magrittr_2.0.3                compiler_4.3.1               
## [19] rlang_1.1.1                   sass_0.4.7                   
## [21] tools_4.3.1                   utf8_1.2.4                   
## [23] yaml_2.3.7                    knitr_1.44                   
## [25] S4Arrays_1.2.0                bit_4.0.5                    
## [27] curl_5.1.0                    DelayedArray_0.28.0          
## [29] abind_1.4-5                   withr_2.5.1                  
## [31] purrr_1.0.2                   grid_4.3.1                   
## [33] fansi_1.0.5                   xtable_1.8-4                 
## [35] cli_3.6.1                     rmarkdown_2.25               
## [37] crayon_1.5.2                  generics_0.1.3               
## [39] httr_1.4.7                    rjson_0.2.21                 
## [41] DBI_1.1.3                     cachem_1.0.8                 
## [43] zlibbioc_1.48.0               AnnotationDbi_1.64.0         
## [45] BiocManager_1.30.22           XVector_0.42.0               
## [47] vctrs_0.6.4                   Matrix_1.6-1.1               
## [49] jsonlite_1.8.7                bookdown_0.36                
## [51] bit64_4.0.5                   magick_2.8.1                 
## [53] jquerylib_0.1.4               glue_1.6.2                   
## [55] BiocVersion_3.18.0            later_1.3.1                  
## [57] tibble_3.2.1                  pillar_1.9.0                 
## [59] rappdirs_0.3.3                htmltools_0.5.6.1            
## [61] GenomeInfoDbData_1.2.11       R6_2.5.1                     
## [63] evaluate_0.22                 shiny_1.7.5.1                
## [65] lattice_0.22-5                png_0.1-8                    
## [67] memoise_2.0.1                 httpuv_1.6.12                
## [69] bslib_0.5.1                   Rcpp_1.0.11                  
## [71] SparseArray_1.2.0             xfun_0.40                    
## [73] pkgconfig_2.0.3