Skip to contents

Function used by MapSpatialOmics to align SM data to ST spots with lower resolution (i.e. Visium Spots)

Usage

lowresMapping(
  SM.data,
  ST.data,
  SM.assay = "Spatial",
  ST.assay = "Spatial",
  SM.fov = "fov",
  ST.image = "slice1",
  ST.scale.factor = "hires",
  SM.pixel.width = NULL,
  overlap.threshold = 0.2,
  annotations = TRUE,
  add.metadata = TRUE,
  merge.unique.metadata = TRUE,
  map.data = FALSE,
  new_SPT.assay = "SPT",
  new_SPM.assay = "SPM",
  verbose = FALSE
)

Arguments

SM.data

A SpaMTP Seurat object representing the Spatial Metabolomics data.

ST.data

A Seurat object representing the Visium Spatial Transcriptomics data.

SM.assay

Character string defining the Seurat assay that contains the annotated counts and metadata corresponding to the m/z values (default = "Spatial").

ST.assay

Character string specifying the current assay to use to extract transcriptional data from (default = "Spatial").

SM.fov

Character string of the image fov associated with the spatial metabolomic data (default = "fov").

ST.image

Character string matching the image name associated with the ST data stored in the Visium object (default = "slice1").

ST.scale.factor

Character string defining the image resolution associated with the Visium image pixel data. If NULL the full-res coordinates will be used and no scaling will be performed (default = "hires").

SM.pixel.width

Numeric value defining the width of each SM pixel. If set to NULL, the median pixel width will be calculated based on the distance between each pixel (default = NULL).

overlap.threshold

Numeric value defining the overlap proportion threshold for a SM pixel to be associated with a ST spot. For example, if res_increase = 0.2 then pixels that have at least 20% area overlap with the respective visium spot will be assigned a match (default = 0.2).

annotations

Boolean value indicating if the Spatial Metabolomics (MALDI) Seurat object contains annotations assigned to m/z values (default = TRUE).

add.metadata

Boolean defining whether to add the current metadata stored in the SM object to the new mapped multi-omic SpaMTP object (default = TRUE)

merge.unique.metadata

Boolean indicating whether to summaries duplicated metadata terms to only store unique values in the metadata. Note: add.metadata must be set to TRUE for this functionality to be implmented (default = TRUE).

map.data

Boolean indicating whether to map normalised/additional data stored in the data slot of the SpaMTP assay. Note: this process is computationally expensive with large datasets (default = FALSE).

new_SPT.assay

Character string defining the assay name of the new overlaid SpaMTP Seurat object containing all updated transcriptomics data (default = "SPT").

new_SPM.assay

Character string defining the assay name of the new overlaid SpaMTP Seurat object containing all updated metabolomic data (default = "SPM").

verbose

Boolean value indicating whether to print informative progression update messages and progress bars (default = TRUE).

Value

A SpaMTP Seurat object with the Spatial Metabolomic data mapped to equivalent Spatial Transcripomics (Visium) spots.

Examples

# Helper function for MapSpatialOmics