MultiAssaySpatialExperiment 0.99.12
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.
| 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 |
| Function | Platform |
|---|---|
readXeniumMASE() |
10x Xenium |
readVisiumMASE() |
10x Visium |
readVisiumHDMASE() |
10x Visium HD |
readCosMxMASE() |
NanoString CosMx |
readMERSCOPEMASE() |
Vizgen MERSCOPE |
| 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 |
| 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 |
| 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 |
| 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.
| 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 |
| Function | Description |
|---|---|
c() |
Merge two objects, unioning assays and spatial layers |
cbind() |
Bind objects that share assay names, along observations |
sessionInfo()
## R version 4.6.1 (2026-06-24)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.4 LTS
##
## Matrix products: default
## BLAS: /home/biocbuild/bbs-3.24-bioc/R/lib/libRblas.so
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0 LAPACK version 3.12.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] 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