This function was amended from the scEntropy python codes (https://github.com/jzlei/scEntropy) provided by https://www.worldscientific.com/doi/abs/10.1142/S1793048020500010

shannon_entropy(
  seurat_obj,
  ref_vec = NULL,
  method = "predefined",
  check_log2 = TRUE,
  scale = FALSE
)

Arguments

seurat_obj

A Seurat object

ref_vec

Optional numeric vector, reference cell expression vector

method

Character string, method for generating reference vector. It must be either "predefined" or "RCSA".

check_log2

Logical, whether to check and perform log2 transformation if necessary

scale

Normalize the entropy values to 0-1 range

Value

Numeric vector, Shannon entropy values relative to the reference