Returns the distance of the closest cell of a specific type from each reference cell.

calculate_minimum_distances_between_celltypes(
  spe_object,
  feature_colname,
  cell_types_of_interest = NULL
)

Arguments

spe_object

SpatialExperiment object in the form of the output of format_image_to_spe.

feature_colname

String of the feature column of cells to choose the cell types from (e.g. Cell.Type, Cell.Type2, etc).

cell_types_of_interest

String Vector of marker combinations to consider is FALSE.

Value

A data.frame is returned

Examples

min_dists <- calculate_minimum_distances_between_celltypes(
SPIAT::defined_image, feature_colname = "Cell.Type", 
cell_types_of_interest = c("Tumour","Immune1"))
#> [1] "Markers had been selected in minimum distance calculation: "
#> [1] "Immune1" "Tumour"