SpatialDE.fit_spatial_interactions

SpatialDE.fit_spatial_interactions(adata, layer=None, genes=None, spatial_key='spatial', ard=False, sizefactors=None)

Estimate magnitude of spatial cell-cell interactions using an SVCA model (ARnol, 2019).

In contrast to the original publication, which used a Gaussian approximation, this fits a Poisson GLMM. This function is intendend to be used after test_spatial_interactions() to analyse the genes showing significant cell-cell interactions.

Parameters:
  • adata (AnnData) – The annotated data matrix.

  • layer (Optional[str]) – Name of the AnnData object layer to use. By default adata.X is used.

  • genes (Optional[List[str]]) – List of genes to analyze. Defaults to all genes.

  • spatial_key (str) – Key in adata.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.

Return type:

DataFrame

Returns: A Pandas DataFrame with the results.

Return type:

DataFrame

Parameters:
  • adata (AnnData) –

  • layer (str | None) –

  • genes (List[str] | None) –

  • spatial_key (str) –

  • ard (bool) –

  • sizefactors (ndarray | None) –