Function to calculate gene signature enrichment scores per spatial position using a hypergeometric test.
Giotto object
Matrix of signature genes for each cell type / process
expression values to use
reverse expression values from log scale
log base to use if reverse_log_scale = TRUE
percentage of cells that will be considered to have gene expression with matrix binarization
how to return enrichment output
calculate p-values (boolean, default = FALSE)
to give to spatial enrichment results, default = rank
return giotto object
data.table with enrichment results
The enrichment score is calculated based on the p-value from the hypergeometric test, -log10(p-value).