runRankEnrich
¶
runRankEnrich
Description¶
Function to calculate gene signature enrichment scores per spatial position using a rank based approach.
Usage¶
runRankEnrich(
gobject,
sign_matrix,
expression_values = c("normalized", "raw", "scaled", "custom"),
reverse_log_scale = TRUE,
logbase = 2,
output_enrichment = c("original", "zscore"),
ties_method = c("random", "max"),
p_value = FALSE,
n_times = 1000,
rbp_p = 0.99,
num_agg = 100,
name = NULL,
return_gobject = TRUE
)
Arguments¶
Argument 
Description 


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 

how to return enrichment output 

how to handle rank ties 

calculate pvalues (boolean, default = FALSE) 

number of permutations to calculate for p_value 

fractional binarization threshold (default = 0.99) 

number of top genes to aggregate (default = 100) 

to give to spatial enrichment results, default = rank 

return giotto object 
Details¶
 sign_matrix: a rankfold matrix with genes as row names and celltypes as column names.
Alternatively a scRNAseq matrix and vector with clusters can be provided to makeSignMatrixRank, which will create the matrix for you. list()
First a new rank is calculated as R = (R1*R2)^(1/2), where R1 is the rank of foldchange for each gene in each spot and R2 is the rank of each marker in each cell type. The RankBiased Precision is then calculated as: RBP = (1  0.99) * (0.99)^(R  1) and the final enrichment score is then calculated as the sum of top 100 RBPs.
Value¶
data.table with enrichment results
Seealso¶
``makeSignMatrixRank` <#makesignmatrixrank>`_