calculate_nearest_distances {STDistance}R Documentation

Calculate nearest distances between cell types

Description

Calculate nearest distances between cell types

Usage

calculate_nearest_distances(
  spatial_data,
  reference_type,
  target_types,
  x_col = "pxl_row_in_fullres",
  y_col = "pxl_col_in_fullres",
  id_col = "barcode",
  type_col = "Epi_strom"
)

Arguments

spatial_data

A data frame containing spatial coordinates and cell type info

reference_type

The reference cell type to calculate distances from

target_types

Vector of target cell types to calculate distances to

x_col

Column name for x-coordinates

y_col

Column name for y-coordinates

id_col

Column name for cell identifiers

type_col

Column name for cell type information

Value

A data frame with nearest distances for each reference cell

Examples

calculate_nearest_distances(posi, reference_type="Macrophage",
                 target_types=c("Epithelial_cells_A","Epithelial_cells_B",
                 "Epithelial_cells_C","Epithelial_cells_D"),
                 id_col = "Newbarcode",
                 type_col = "celltype_ABCDepi")

[Package STDistance version 0.6.6 Index]