Aggregates cells into coarse-grained groups using k-means clustering, and updates the gene expression matrix and cell-cell affinity matrix accordingly. This is useful for testing or reducing computational complexity in downstream analyses.
CoarseGrain(
feature_space,
expression,
graph.affinity,
N = 5000,
random.seed = 1
)
matrix; the low-dimensional feature space of cells (e.g., PCA or UMAP coordinates), with cells as rows and dimensions as columns.
matrix; the gene expression matrix with features (genes) as rows and cells as columns.
matrix; the cell-cell affinity matrix to be coarse-grained.
integer; the number of coarse-grained groups to form using k-means clustering. Default is 5000.
integer; random seed to ensure reproducibility. Default is 1.
A list containing:
matrix; coarse-grained gene expression matrix (genes × groups).
matrix; updated cell-cell affinity matrix between coarse-grained groups.