For each cell, aggregate gene expression counts from all cells belonging to that cell's neighbourhood.

get_nbcounts(seurat = NULL, label = NULL, which = NULL)

Arguments

seurat

a Seurat object containing Kandinsky data slot

label

character string indicating meta data variable containing cell type annotation

which

character vector indicating for which cell type creating the neighbourhood expression matrix. Cells belonging to the same class(es) specified through `which` will not be included in the expression count aggregation.

Value

sparse cell (rows) X gene (columns) count matrix. Each cell count profile is the result of the aggregation of all gene expression counts found across its neighbouring cells.

Details

When `label` or `which` parameters are set to NULL, this function will create an expression count neighbourhood matrix considering all cells included in the dataset. Otherwise, the aggregated count matrix will be created for only cells belonging to the cell class(es) specified through the `which` argument, and cells from that same class will not be considered for the gene expression count aggregation across neighbouring cells. Cell class annotation that will be considered for the analysis needs to be specified through the `label` argument.