SpatialDE.test_spatial_interactions
- SpatialDE.test_spatial_interactions(adata, layer=None, spatial_key='spatial', ard=False, sizefactors=None, copy=False)
Fit an SVCA model (Arnol, 2019) and test for spatial cell-cell interactions.
In contrast to the original publication, which used a Gaussian approximation with a likelihood ratio test, this fits a Poisson GLMM and uses a score test.
- Parameters:
adata (
AnnData) – The annotated data matrix.layer (
Optional[str]) – Name of the AnnData object layer to use. By defaultadata.Xis used.spatial_key (
str) – Key inadata.obsmwhere the spatial coordinates are stored.ard (
bool) – Whether to use automatic relevance determination for the kernel. This amounts to a separate lengthscale for each spatial dimension.sizefactors (
Optional[ndarray]) – Scaling factors for the observations. Defaults to total read counts.copy (
bool) – Whether to return a copy ofadatawith results or write the results intoadatain-place.
- Return type:
Tuple[DataFrame,Optional[AnnData]]- Returns:
A tuple. The first element is a Pandas DataFrame with the test results, the second is
Noneifcopy == Falseor anAnnDataobject.