entropy_gradient_aggregated: The aggregated gradient of entropy and the peak of the...

View source: R/entropy_gradient_aggregated.R

entropy_gradient_aggregatedR Documentation

The aggregated gradient of entropy and the peak of the gradient

Description

This 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.

Usage

entropy_gradient_aggregated(
  spe_object,
  cell_types_of_interest,
  feature_colname,
  radii
)

Arguments

spe_object

SpatialExperiment object in the form of the output of format_image_to_spe.

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.

Value

A list of the gradient of entropy and the peak

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])

TrigosTeam/SPIAT documentation built on Aug. 22, 2024, 7:50 p.m.