
Calculate gene spatial auto-correlations (for meta cells)
rs_mc_hotspot_autocor.Rd
This function implements the HotSpot auto-correlation functionality and
will return to what extent a given gene shows auto-correlation in the
kNN-graph over the meta cells. For details see DeTomaso, et al. This version
works on MetaCell counts which are stored in memory directly. There is no
streaming variant: streaming bounds disk re-reads, which is not a problem
an in-memory matrix has.
Usage
rs_mc_hotspot_autocor(
sparse_data,
embd,
knn_data,
hotspot_params,
cells_to_keep,
genes_to_use,
verbose,
seed
)Arguments
- sparse_data
A named list that needs to have
data,indptr,indices,nrow,ncolandcs_type. Shape is (metacells, genes) and the data are the raw counts.- embd
Numerical matrix. The embedding matrix from which to generate the kNN graph. Needs one row per entry of
cells_to_keep.- knn_data
Optional list. This contains pre-computed kNN data (
indices,dist,k) and thedist_metricit was built with. The user has to ensure consistency! If provided, this will be used rather than a graph built from the parameter list.- hotspot_params
List. The HotSpot parameter list. The kNN parameters are only read when no
knn_datais provided.- cells_to_keep
Integer vector. 0-index vector indicating which meta cells to include in the analysis. Ensure that this is of same order/length as the embedding matrix.
- genes_to_use
Integer vector. 0-index vector indicating which genes to include.
- verbose
Integer.
0L- quiet;1L- normal verbosity;2L- detailed verbosity.- seed
Integer. Random seed for reproducibility.