compute.spatial.kld: 6. find gene sets with spatial relevance

View source: R/gsdensity_functions.R

compute.spatial.kldR Documentation

6. find gene sets with spatial relevance

Description

This function is to calculate how likely the cells relevant to a gene set is randomly distributed spatially

Usage

## S3 method for class 'spatial.kld'
compute(spatial.coords, weight_vec, n = 10, n.times = 20)

Arguments

spatial.coords

a data frame with each row as a cell and each column as a spatial coordinate (usually 2: x and y)

weight_vec

output of run.rwr

n

split the spatial map for local density estimation; n is the number of split for each dimension; for n = 10, the spatial map is split to n * n = 100 grids for the density estimation

n.times

the weight_vec is shuffled several times (n.times) to generate a background distribution (shuffled weights vs. equal weights) for statistical significance estimation (p.value); larger n.times will be more time-consuming and more accurate

Value

spatial kl-divergence


gsdensity documentation built on March 31, 2023, 8:32 p.m.