visiumSpotDistances: Calculate Distances Between Visium Spots

View source: R/v.R

visiumSpotDistancesR Documentation

Calculate Distances Between Visium Spots

Description

This function calculates the pairwise distances between specified Visium spots based on their x and y coordinates.

Usage

visiumSpotDistances(
  type = c("small", "large"),
  bcs_o = NULL,
  bcs_n = NULL,
  nnn = NULL
)

Arguments

type

A character vector specifying the type of Visium platform. One of "small" or "large". Default is "small".

bcs_o

A character vector of barcodes specifying the origin spots. If NULL (default), all barcodes from the specified type are used.

bcs_n

A character vector of barcodes specifying the neighbor spots. If NULL (default), all barcodes from the specified type are used.

nnn

A numeric value specifying the number of nearest neighbors to consider. If NULL (default), all neighbors are considered.

Value

A data frame containing the pairwise distances between the specified Visium spots. The data frame contains the following variables:

  • bcs_o: Barcode of the origin spot.

  • bcs_n: Barcode of the neighbor spot.

  • xo: x-coordinate of the origin spot.

  • yo: y-coordinate of the origin spot.

  • xn: x-coordinate of the neighbor spot.

  • yn: y-coordinate of the neighbor spot.

  • distance: Calculated distance between the origin and neighbor spots.


theMILOlab/SPATA2 documentation built on Feb. 8, 2025, 11:41 p.m.