spatialvi.model.base.SpatialNeighborhoodMixin#
- class spatialvi.model.base.SpatialNeighborhoodMixin[source]#
Mixin for spatial neighbor graph computation.
Applied to: SCVIVA, ResolVI. Provides a single entry point for neighbor graph computation with pluggable backends (squidpy on CPU, RAPIDS on GPU).
The computed neighbor arrays are stored in: -
adata.obsm["index_neighbor"]— dense int array, shape (n_cells, n_neighs) -adata.obsm["distance_neighbor"]— dense float array, shape (n_cells, n_neighs)These keys match the upstream ResolVI module’s expected input format.
- __init__()#
Methods
__init__()compute_neighbors(adata[, spatial_key, ...])Compute spatial neighbor graph and store in
adata.obsm.