calculate_distance_to_margin: calculate the distances of each cell to the margin

View source: R/calculate_distance_to_tumour_margin.R

calculate_distance_to_marginR Documentation

calculate the distances of each cell to the margin

Description

Returns a SPE object with the minimum distance from cells of interest (CoI) to the identified bordering cells.

Usage

calculate_distance_to_margin(spe_object)

Arguments

spe_object

SpatialExperiment object. It should contain information of the detected bordering cells ('colData()' has 'Region' column).

Value

An spe_object with a 'Distance.To.Border' column is returned.

Examples

spe_border <- identify_bordering_cells(SPIAT::defined_image,
reference_cell = "Tumour", feature_colname = "Cell.Type", n_to_exclude = 10)
spe_dist <- calculate_distance_to_margin(spe_border)

TrigosTeam/SPIAT documentation built on July 26, 2024, 2:24 a.m.