Skip to contents

This function projects annotations from a high-resolution (8µm) spatial assay onto a lower-resolution (16µm) spatial assay by finding the nearest 8µm spot to each 16µm spot based on spatial coordinates.

Usage

annotations_8um_to_16um(HDobj, referenceVar)

Arguments

HDobj

A Seurat object containing both 8µm and 16µm spatial assays (named Spatial.008um and Spatial.016um).

referenceVar

A character string specifying the name of the metadata column in the 8µm assay to project (e.g., a clustering or annotation label).

Value

A modified Seurat object with a new metadata column named projected_<referenceVar> containing the projected annotation on 16µm spots.

Details

The function uses FNN::get.knnx() to find the nearest 8µm spot for each 16µm spot based on tissue coordinates. It assigns the annotation from the closest 8µm spot to each 16µm spot. The new annotation column is added to the metadata of HDobj.