stJoincount - stJoincount - Join count statistic for quantifying spatial
correlation between clusters
stJoincount facilitates the application of join count
analysis to spatial transcriptomic data generated from the 10x
Genomics Visium platform. This tool first converts a labeled
spatial tissue map into a raster object, in which each spatial
feature is represented by a pixel coded by label assignment.
This process includes automatic calculation of optimal raster
resolution and extent for the sample. A neighbors list is then
created from the rasterized sample, in which adjacent and
diagonal neighbors for each pixel are identified. After adding
binary spatial weights to the neighbors list, a
multi-categorical join count analysis is performed to tabulate
"joins" between all possible combinations of label pairs. The
function returns the observed join counts, the expected count
under conditions of spatial randomness, and the variance
calculated under non-free sampling. The z-score is then
calculated as the difference between observed and expected
counts, divided by the square root of the variance.