The TENxVisiumData package provides an R/Bioconductor
resource for Visium
spatial gene expression datasets by 10X Genomics. The package
currently includes 13 datasets from 23 samples across two organisms
(human and mouse) and 13 tissues:
A list of currently available datasets can be obtained using the
ExperimentHub interface:
## ExperimentHub with 26 records
## # snapshotDate(): 2026-10-07
## # $dataprovider: 10X Genomics
## # $species: Homo sapiens, Mus musculus
## # $rdataclass: SpatialExperiment
## # additional mcols(): taxonomyid, genome, description,
## # coordinate_1_based, maintainer, rdatadateadded, preparerclass, tags,
## # rdatapath, sourceurl, sourcetype
## # retrieve records with, e.g., 'object[["EH6695"]]'
##
## title
## EH6695 | HumanBreastCancerIDC
## EH6696 | HumanBreastCancerILC
## EH6697 | HumanCerebellum
## EH6698 | HumanColorectalCancer
## EH6699 | HumanGlioblastoma
## ... ...
## EH6739 | HumanSpinalCord_v3.13
## EH6740 | MouseBrainCoronal_v3.13
## EH6741 | MouseBrainSagittalPosterior_v3.13
## EH6742 | MouseBrainSagittalAnterior_v3.13
## EH6743 | MouseKidneyCoronal_v3.13
To retrieve a dataset, we can use a dataset’s corresponding named
function <id>(), where <id> should
correspond to one a valid dataset identifier (see
?TENxVisiumData). E.g.:
Alternatively, data can loaded directly from Bioconductor’s ExerimentHub
as follows. First, we initialize a hub instance and store the complete
list of records in a variable eh. Using
query(), we then identify any records made available by the
TENxVisiumData package, as well as their accession IDs
(EH1234). Finally, we can load the data into R via
eh[[id]], where id corresponds to the data
entry’s identifier we’d like to load. E.g.:
Each dataset is provided as a SpatialExperiment (SPE), which extends the SingleCellExperiment (SCE) class with features specific to spatially resolved data:
## class: SpatialExperiment
## dim: 36601 7785
## metadata(0):
## assays(1): counts
## rownames(36601): ENSG00000243485 ENSG00000237613 ... ENSG00000278817
## ENSG00000277196
## rowData names(1): symbol
## colnames(7785): AAACAAGTATCTCCCA-1 AAACACCAATAACTGC-1 ...
## TTGTTTGTATTACACG-1 TTGTTTGTGTAAATTC-1
## colData names(1): sample_id
## reducedDimNames(0):
## mainExpName: NULL
## altExpNames(0):
## spatialCoords names(2) : pxl_col_in_fullres pxl_row_in_fullres
## imgData names(4): sample_id image_id data scaleFactor
For details on the SPE class, we refer to the package’s vignette. Briefly, the SPE harbors the following data in addition to that stored in a SCE:
spatialCoords; a numeric matrix of spatial coordinates,
stored inside the object’s int_colData:
## pxl_col_in_fullres pxl_row_in_fullres
## AAACAAGTATCTCCCA-1 15937 17428
## AAACACCAATAACTGC-1 18054 6092
## AAACAGAGCGACTCCT-1 7383 16351
## AAACAGGGTCTATATT-1 15202 5278
## AAACAGTGTTCCTGGG-1 21386 9363
## AAACATTTCCCGGATT-1 18549 16740
spatialData; a DFrame of spatially-related
sample metadata, stored as part of the object’s colData.
This colData subset is in turn determined by the
int_metadata field spatialDataNames:
## DataFrame with 6 rows and 0 columns
imgData; a DFrame containing image-related
data, stored inside the int_metadata:
## DataFrame with 2 rows and 4 columns
## sample_id image_id data scaleFactor
## <character> <character> <list> <numeric>
## 1 HumanBreastCancerIDC1 lowres #### 0.0247525
## 2 HumanBreastCancerIDC2 lowres #### 0.0247525
Datasets with multiple sections are consolidated into a single SPE
with colData field sample_id indicating each
spot’s sample of origin. E.g.:
##
## MouseBrainSagittalAnterior1 MouseBrainSagittalAnterior2
## 2695 2825
Datasets of targeted analyses are provided as a nested SPE,
with whole transcriptome measurements as primary data, and those
obtained from targeted panels as altExps. E.g.:
## [1] "TargetedImmunology" "TargetedPanCancer"
## R version 4.6.1 (2026-06-24)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 26.04.1 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so; LAPACK version 3.12.0
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
## [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: Etc/UTC
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] TENxVisiumData_1.21.0 SpatialExperiment_1.23.0
## [3] SingleCellExperiment_1.35.2 SummarizedExperiment_1.43.0
## [5] Biobase_2.73.2 GenomicRanges_1.65.4
## [7] Seqinfo_1.3.2 IRanges_2.47.5
## [9] S4Vectors_0.51.10 MatrixGenerics_1.25.0
## [11] matrixStats_1.5.0 ExperimentHub_3.3.2
## [13] AnnotationHub_4.3.2 BiocFileCache_3.3.0
## [15] dbplyr_2.6.0 BiocGenerics_0.59.12
## [17] generics_0.1.4 BiocStyle_2.41.0
##
## loaded via a namespace (and not attached):
## [1] KEGGREST_1.53.6 rjson_0.2.23 xfun_0.61
## [4] bslib_0.12.0 httr2_1.3.0 lattice_0.23-1
## [7] vctrs_0.7.3 tools_4.6.1 curl_8.0.0
## [10] tibble_3.3.1 AnnotationDbi_1.75.2 RSQLite_3.53.3
## [13] blob_1.3.0 pkgconfig_2.0.3 BiocBaseUtils_1.15.1
## [16] Matrix_1.7-6 lifecycle_1.0.5 compiler_4.6.1
## [19] Biostrings_2.81.9 htmltools_0.5.9 sys_3.4.3
## [22] buildtools_1.0.0 sass_0.4.10 yaml_2.3.12
## [25] pillar_1.11.1 crayon_1.5.3 jquerylib_0.1.4
## [28] DelayedArray_0.39.8 cachem_1.1.0 magick_2.9.1
## [31] abind_1.4-8 tidyselect_1.2.1 digest_0.6.39
## [34] dplyr_1.2.1 purrr_1.2.2 BiocVersion_3.24.0
## [37] maketools_1.3.2 grid_4.6.1 fastmap_1.2.0
## [40] SparseArray_1.13.4 cli_3.6.6 magrittr_2.0.5
## [43] S4Arrays_1.13.2 withr_3.0.3 filelock_1.0.3
## [46] rappdirs_0.3.4 bit64_4.8.6 rmarkdown_2.32
## [49] XVector_0.53.0 httr_1.4.9 bit_4.6.0
## [52] png_0.1-9 memoise_2.0.1 evaluate_1.0.5
## [55] knitr_1.52 rlang_1.3.0 Rcpp_1.1.2
## [58] glue_1.8.1 DBI_1.3.0 BiocManager_1.30.27
## [61] jsonlite_2.0.0 R6_2.6.1