Compute and plot the cross functions between two specified cell types. This function implements the cross functions from [spatstat] package.
calculate_cross_functions(
spe_object,
method = "Kcross",
cell_types_of_interest,
feature_colname,
plot_results = TRUE,
dist = NULL
)
SpatialExperiment object in the form of the output of
format_image_to_spe
.
String that is the method for dependence calculation. Options: "Gcross", "Kcross", "Kcross.inhom", "Lcross", "Jcross". Default method is "Kcross".
String Vector. Cell types of interest.
String that is the name of the column of the types.
Boolean. TRUE if result to be plotted, FALSE if not. In either case, an object with the results is returned
Number (OPTIONAL) The largest distance between two cell types at which K function is evaluated. If NULL, use the default distances set by cross functions.
An object of class "fv" defined in `spatstat` package.
df_cross <- calculate_cross_functions(SPIAT::defined_image,
method = "Kcross", cell_types_of_interest = c("Tumour","Immune3"),
feature_colname ="Cell.Type", dist = 100)