Test for density correlation between two cell types.
Arguments
- spe
A SpatialExperiment object.
- coi
Character vector for cell types of interest for density correlation analysis. Default is NULL, which is to consider all cell types previously calculated in the gridDensity() step.
- probs
A numeric scalar. The threshold of proportion that used to filter grids by density when ROIs have not been identified previously. Ignored if 'roi' is present in the 'metadata' component of spe. Default to 0.85.
- trace
Logical. If TRUE, print the process of testing. Default to FALSE.
Examples
data("xenium_bc_spe")
coi <- c("Breast cancer", "Fibroblasts", "B cells", "T cells")
spe <- gridDensity(spe, coi = coi)
spe <- findROI(spe, coi = coi, method = "walktrap")
result <- corDensity(spe)