scSLAT.model.preprocess.Cal_Spatial_Net

scSLAT.model.preprocess.Cal_Spatial_Net(adata, rad_cutoff=None, k_cutoff=None, model='Radius', return_data=False, verbose=True)[source]

Construct the spatial neighbor networks.

Parameters:
  • adata (anndata._core.anndata.AnnData) – AnnData object of scanpy package.

  • rad_cutoff (typing.Optional[int]) – radius cutoff when model=’Radius’

  • k_cutoff (typing.Optional[int]) – The number of nearest neighbors when model=’KNN’

  • model (typing.Optional[str]) – The network construction model. When model==’Radius’, the spot is connected to spots whose distance is less than rad_cutoff. When model==’KNN’, the spot is connected to its first k_cutoff nearest neighbors.

Return type:

None

Returns:

The spatial networks are saved in adata.uns[‘Spatial_Net’]