Compute and plot the cross functions between two specified cell types. This function implements the cross functions from [spatstat] package.
Usage
calculate_cross_functions(
sce_object,
method = "Kcross",
cell_types_of_interest,
feature_colname,
plot_results = TRUE,
dist = NULL
)
Arguments
- sce_object
SingleCellExperiment object in the form of the output of
format_image_to_sce
.- method
String that is the method for dependence calculation. Options: "Gcross", "Kcross", "Kcross.inhom", "Lcross", "Jcross". Default method is "Kcross".
- cell_types_of_interest
String Vector. Cell types of interest.
- feature_colname
String that is the name of the column of the types.
- plot_results
Boolean. TRUE if result to be plotted, FALSE if not. In either case, an object with the results is returned
- dist
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.
Examples
df_cross <- calculate_cross_functions(SPIAT::defined_image, method = "Kcross",
cell_types_of_interest = c("Tumour","Immune3"),
feature_colname ="Cell.Type", dist = 100)