Skip to contents

Calculate distance between spots

Usage

calc_spot_dist(spe, long_format = TRUE, spot_dist_cutoff = 1.5)

Arguments

spe

SpatialExperiment object

long_format

if TRUE (default), return long format data.frame. Otherwise, matrix format.

spot_dist_cutoff

cutoff value for norm.d in spot distances. Default cutoff is 1.5 and it comes from sqrt(3) ~ 1.73, based on how Visium spot-array is arranged, so by default, only computing nearest neighbors.

Value

A data fame with computed distance including both d and norm.d. norm.d is a multiple of the shortest distance between spots.