View source: R/CrossExpression.R
spatial_enrichment | R Documentation |
Determines whether the supplied genes show spatial enrichment in cross-expression. Spatial enrichment can be interpreted as delineating anatomical boundaries.
spatial_enrichment(
data,
locations,
gene1,
gene2,
neighbor = 1,
max_pairs = 20000
)
data |
A cells by genes expression matrix. |
locations |
A cells by coordinates (x-y or higher dimensions) matrix. |
gene1 |
Name of gene1. |
gene2 |
Name of gene2. |
neighbor |
The n-th nearest neighbor. |
max_pairs |
Specify maximum number of cell pairs to consider. Lower number increases computational efficiency. |
Returns a p-value and distance distributions between cross-expressing cells and cross-expressing and random cells.
data("locations")
data("expression")
locations = as.matrix(locations)
expression = as.matrix(expression)
expression = expression[,1:5]
results = spatial_enrichment(data = expression, locations = locations,
gene1 = "Calb1", gene2 = "Rasgrf2", max_pairs = 100)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.