This internal helper function extracts the expression matrix of a cell's neighbors and computes entropy for each gene using the specified estimator.

calculate_entropy_for_cell(cell_name, mat, seu, nn_list = NULL, nn.name = NULL)

Arguments

cell_name

Character. Name of the cell to compute entropy for.

mat

Matrix. Expression matrix (genes x cells).

seu

Seurat object.

nn_list

Optional list mapping cell names to neighbor indices or names.

nn.name

Optional character. If neighbors are already present in the Seurat object, this specifies the name of the neighbor graph to use (e.g. `"SCT"` or `"RNA"`).

Value

A numeric vector of entropy values for each gene.