Spatial annotations outline areas of interest within spatial data sets. The area outline is represented by a detailed polygon stored in a data.frame of vertices that map the polygon into two dimensional space.

Apart from being useful to highlight areas of interests in visualizations, spatial annotatations can be used as spatial references to analyze gene expression changes as a function of distance to certain areas. This concept is detailed in the vignette on Spatial Gradient Screening (SGS).

SPATA2 differentiates between three kinds of spatial annotations:

GroupAnnotations: represent the spatial extent of observations, such as cells or barcoded spots, by filtering and outlining them based on predefined groups. This class allows for the creation of annotations that highlight specific spatial clusters, areas, or patterns identified through grouping techniques. It provides a means to focus on regions of interest within spatial multi-omic datasets using predefined categorizations.

ImageAnnotations: capture spatial annotations by outlining areas of interest on images. This class provides a flexible framework for creating annotations that visually highlight specific regions within images, such as histological structures, cellular patterns, or other histo-morphological features in images.

NumericAnnotations: represent the spatial extent of observations, such as cells or barcoded spots, by filtering and outlining them according to their values for a specific numeric variable. This class is particularly suitable for creating annotations that highlight areas of interest based on continuous characteristics like gene expression or other numeric attributes derived from spatial multi-omic datasets.