1 Introduction

1.1 Overview

The primary utility of the spatialHeatmap package is the generation of spatial heatmaps (SHMs) for visualizing cell-, tissue- and organ-specific abundance patterns of biological molecules (e.g. RNAs) in spatial anatomical images (Zhang et al. 2024). This is useful for identifying biomolecules with spatially enriched/depleted abundance patterns as well as clusters and/or network modules composed of biomolecules sharing similar abundance patterns such as similar gene expression patterns. These functionalities are introduced in the main vignette of this package. The following describes extended functionalities for integrating tissue with single-cell data by co-visualizing them in composite plots that combine SHMs with embedding plots of high-dimensional data. The resulting spatial context information is important for gaining insights into the tissue-level organization of single cell data or vice versa.

1.2 Data Structures

The supported bulk and single-cell assay data come from most large-scale profiling technologies such as transcriptomics, proteomics, metabolomics, etc, while the corresponding anatomical images need to be supplied as annotated SVG (aSVG) images, where spatial features (e.g. tissues) are assigned unique identifiers.

To implement the co-visualization functionality, spatialHeatmap takes advantage of efficient and reusable S4 classes for both assay data and aSVGs respectively. The former includes the Bioconductor core data structures SummarizedExperiment (SE, Morgan et al. (2018)) and SingleCellExperiment (SCE, Amezquita et al. (2020)) for bulk and single-cell data respectively (Figure 1A, C). The slots assays, colData, and rowData contain expression values, tissue/cell metadata, and biomolecule metadata respectively. For the embedding plots of single-cell data, the reduced dimensionality embedding results (PCA, UMAP or tSNE) are stored in the reducedDims slot of SCE.

The S4 class SVG (Figure 1B) is developed specifically in spatialHeatmap for storing aSVG instances. The two most important slots coordinate and attribute stores the aSVG feature coordinates and respective attributes (colors, line withs, etc) respectively, while other slots dimension, svg, and raster stores image dimension, original aSVG instances, and raster image paths respectively. Moreover, the meta class SPHM (Figure 1D) is developed to harmonize these data objects.

When creating co-visualization plots (Figure 1a-b), SHMs are created by mapping expression values from SE to corresponding spatial features in SVG through the same identifiers (here TissuesA and TissueB) between the two, and single cells in SCE are associated with spatial features through their group labels (here TissuesA and TissueB) stored in the colData slot.