Calculates the ratio of the bordering cell count and the total to-be-clustered cell count in an image. The bordering cells are detected by the default identify_bordering_cells function. If the ratio is high, it means that most cells to be clustered are identified as bordering cells. This means there is no clear clusters.

R_BC(spe_object, cell_type_of_interest, feature_colname)

Arguments

spe_object

SpatialExperiment object in the form of the output of format_image_to_spe.

cell_type_of_interest

String. The cell type that the user wants to determine a cluster of.

feature_colname

String. The column that contains the cell type to be clustered.

Value

A number is returned.

Examples

R_BC(SPIAT::defined_image, cell_type_of_interest = "Tumour", "Cell.Type")

#> [1] 0.2014652