smooth_cells: Smooths cells' gene expression by averaging its expression by...

View source: R/CrossExpression.R

smooth_cellsR Documentation

Smooths cells' gene expression by averaging its expression by the nearest neighbors. Optionally computes genes by genes Pearson's correlation matrix between cells by genes and neighbors by genes matrices.

Description

Smooths cells' gene expression by averaging its expression by the nearest neighbors. Optionally computes genes by genes Pearson's correlation matrix between cells by genes and neighbors by genes matrices.

Usage

smooth_cells(data, locations, neighbors_smoothed = 1, corr = TRUE)

Arguments

data

A cells by genes expression matrix.

locations

A cells by coordinates (x-y or higher dimensions) matrix.

neighbors_smoothed

Numbers of neighbors used for smoothing (0 is the cell itself; 1 is the nearest neighbor).

corr

If TRUE, computes genes by genes correlation matrix between regions.

Value

Returns a smoothed gene expression matrix. If corr = TRUE, additionally returns a gene-gene correlation matrix.

Examples

data("locations")
data("expression")
locations  = as.matrix(locations)
expression = as.matrix(expression)
expression = expression[,1:5]
results    = smooth_cells(data = expression, locations = locations)


CrossExpression documentation built on Aug. 8, 2025, 7:25 p.m.