Determine if there is a crossing in the cross K curves, to further detect the existence of potential immune rings.
crossing_of_crossK(df.cross)
Data.frame. The output of
calculate_cross_functions
. Containing the positions of the
two curves. Columns contain "r", "border" and "theo".
A number. The percentage of the crossing position of the specified distance. Returns NA when the crossing happens too close to the y axis (<4
df_cross <- calculate_cross_functions(SPIAT::defined_image, method="Kcross",
cell_types_of_interest = c("Tumour","Immune3"),
feature_colname ="Cell.Type", dist = 100)
crossing_of_crossK(df_cross)
#> [1] "Crossing of cross K function is detected for this image, indicating a potential immune ring."
#> [1] "The crossing happens at the 50% of the specified distance."
#> [1] 0.5