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.X
is used.spatial_key (
str
) – Key inadata.obsm
where 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 ofadata
with results or write the results intoadata
in-place.
- Return type:
Tuple
[DataFrame
,Optional
[AnnData
]]- Returns:
A tuple. The first element is a Pandas DataFrame with the test results, the second is
None
ifcopy == False
or anAnnData
object.