Skip to contents

Calculate spatial correlations in both univariate and bivariate settings.

Usage

SpaCET.SpatialCorrelation(
  SpaCET_obj,
  mode,
  item = NULL,
  W,
  nPermutation = 1000
)

Arguments

SpaCET_obj

A SpaCET object.

mode

Mode of spatial correlation, i.e., "univariate", "bivariate", "pairwise".

item

A vector or two-column matrix. See details.

nPermutation

Permutation number.

Value

A SpaCET object

Details

1) when mode = "univariate", set `item` as NULL or a gene vector. if NULL: test genome-wide genes else: test the genes you input

2) when mode = "univariate", set `item` as NULL or a two-column matrix. if NULL: test all ligand-receptor pair stored in our package else: test the gene pairs you input

Examples

genes <- c("TGFB1","TGFB2","TGFB3","TGFBR1","TGFBR2","TGFBR3")
genePairs <- data.frame(c("TGFB1","TGFB1"), c("TGFBR1","TGFBR2"))
SpaCET_obj <- SpaCET.SpatialCorrelation(SpaCET_obj, mode="univariate", item=genes, W, nPermutation=1000)
SpaCET_obj <- SpaCET.SpatialCorrelation(SpaCET_obj, mode="bivariate", item=genePairs, W, nPermutation=1000)
SpaCET_obj <- SpaCET.SpatialCorrelation(SpaCET_obj, mode="pairwise", W)