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
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 |
Spatial accessors
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
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
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
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
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
c() |
Merge two objects, unioning assays and spatial
layers |
cbind() |
Bind objects that share assay names, along
observations |
Session info
## R version 4.6.1 (2026-06-24)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 26.04 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] 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 fastmap_1.2.0
## [4] xfun_0.60 maketools_1.3.2 cachem_1.1.0
## [7] knitr_1.51 htmltools_0.5.9 rmarkdown_2.32
## [10] buildtools_1.0.0 lifecycle_1.0.5 cli_3.6.6
## [13] sass_0.4.10 jquerylib_0.1.4 compiler_4.6.1
## [16] sys_3.4.3 tools_4.6.1 bslib_0.12.0
## [19] evaluate_1.0.5 yaml_2.3.12 otel_0.2.0
## [22] BiocManager_1.30.27 jsonlite_2.0.0 rlang_1.3.0