The aggregated gradient of entropy and the peak of the gradient
Source:R/entropy_gradient_aggregated.R
      entropy_gradient_aggregated.RdThis function first calculates the entropy within circles of each reference cell at each radius. Then at each radius, the entropy of all circles surrounding each cell are aggregated into one number. The function sweeps over the specified radii and calculates the aggregated entropy under each radius.
Arguments
- sce_object
 SingleCellExperiment object in the form of the output of
format_image_to_sce.- cell_types_of_interest
 String Vector. The cell types that the entropy is computed on.
- feature_colname
 String. The column name of the interested cell types.
- radii
 Numeric Vector. A vector of radii within a circle of a reference cell where the entropy is computed on.
Examples
gradient_pos <- seq(50, 500, 50)
gradient_results <- entropy_gradient_aggregated(SPIAT::defined_image,
cell_types_of_interest = c("Tumour","Immune3"),
feature_colname = "Cell.Type", radii = gradient_pos)
plot(1:10,gradient_results$gradient_df[1, 3:12])