Summary of the MultiAssaySpatialExperiment API

A one-page reference. MultiAssaySpatialExperiment (MASE) extends MultiAssayExperiment (MAE), so the whole MAE API applies as well; see the MultiAssayExperiment cheatsheet for that half. Listed below is what MASE adds, plus the inherited functions used most often alongside it.

Worked examples are in Introduction to MultiAssaySpatialExperiment; the slots and mapping tables are documented in Design of MultiAssaySpatialExperiment.

Constructors

Function Description Returns
MultiAssaySpatialExperiment() Create a MASE from experiments, maps and spatial layers MultiAssaySpatialExperiment
prepMASE() Wrap prepMultiAssay(), harmonizing names and spatial keys list of constructor arguments
buildSpatialMap() Assemble a spatialMap from a sampleMap DataFrame
PointsLayerList() Named list of point layers PointsLayerList
ShapesLayerList() Named list of geometry layers ShapesLayerList
RasterLayerList() Named list of image or label layers RasterLayerList

Platform readers

Function Platform
readXeniumMASE() 10x Xenium
readVisiumMASE() 10x Visium
readVisiumHDMASE() 10x Visium HD
readCosMxMASE() NanoString CosMx
readMERSCOPEMASE() Vizgen MERSCOPE

Spatial accessors

Function Description Returns
spatialPoints() Get or set the point layers PointsLayerList
spatialShapes() Get or set the geometry layers ShapesLayerList
spatialImages() Get or set the image layers RasterLayerList
spatialLabels() Get or set the segmentation-mask layers RasterLayerList
spatialMap() Get or set the observation-to-element map DataFrame
imgData() Get or set the specimen-to-image map DataFrame

Inherited accessors used most often

Function Description Returns
experiments() Get or set the assays ExperimentList
colData() Get or set specimen metadata DataFrame
sampleMap() Get or set the observation-to-specimen map DataFrame
metadata() Get or set experiment-level metadata list

Subsetting

Expression Cuts on Effect on spatial layers
mase[i, j, k] features, specimens, assays links updated
mase[, "P1"] one specimen, across every assay links updated
mase[, list(rna = ...)] columns of one named assay that assay’s links updated
subsetByColData() specimens updates spatialMap and imgData
subsetByRow() assay features unchanged
subsetByColumn() assay columns trims linked points, shapes, images, labels
subsetByAssay() assay name keeps layers still referenced
subsetByBoundingBox() a rectangle in space selects elements, then the columns mapped to them
subsetByPolygon() an arbitrary region as above

Spatial operations

Function Description Returns
annotateWithRegions() Point-in-polygon join; adds a new spatialMap column named for the shapes layer MultiAssaySpatialExperiment
aggregateByRegion() Summarise assay values per annotated region list of matrices
spatialJoin() Join two layer DataFrame objects directly DataFrame

The join predicate defaults to sf::st_intersects; pass join = to change it, for example sf::st_nearest_feature.

Coercion

Expression Requires
as(spe, "MultiAssaySpatialExperiment") a SpatialExperiment
as(mase, "SpatialExperiment") exactly one compatible assay
as(sfe, "MultiAssaySpatialExperiment") SpatialFeatureExperiment installed
as(mase, "SpatialFeatureExperiment") exactly one compatible assay

Combining

Function Description
c() Merge two objects, unioning assays and spatial layers
cbind() Bind objects that share assay names, along observations

Session info

sessionInfo()
## R version 4.6.1 Patched (2026-06-24 r90190)
## Platform: x86_64-apple-darwin20
## Running under: macOS Ventura 13.7.8
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.6-x86_64/Resources/lib/libRblas.0.dylib 
## LAPACK: /Library/Frameworks/R.framework/Versions/4.6-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.1
## 
## locale:
## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
## 
## time zone: America/New_York
## tzcode source: internal
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] BiocStyle_2.41.0
## 
## loaded via a namespace (and not attached):
##  [1] digest_0.6.39       R6_2.6.1            bookdown_0.48      
##  [4] fastmap_1.2.0       xfun_0.60           cachem_1.1.0       
##  [7] knitr_1.51          htmltools_0.5.9     rmarkdown_2.32     
## [10] lifecycle_1.0.5     cli_3.6.6           sass_0.4.10        
## [13] jquerylib_0.1.4     compiler_4.6.1      tools_4.6.1        
## [16] evaluate_1.0.5      bslib_0.12.0        yaml_2.3.12        
## [19] otel_0.2.0          BiocManager_1.30.27 jsonlite_2.0.0     
## [22] rlang_1.3.0