Developer API#

Internal base classes and mixins used to build new scviva models.

Base classes#

SpatialBaseModel

Base class for all scviva models.

SpatialNeighborhoodMixin

Mixin for spatial neighbor graph computation.

SpatialDeconvolutionMixin

Mixin for spatial deconvolution result formatting and visualization.

SpatialPredictiveMixin

Shared predictive methods for spatial models with neighbor graphs.

Data fields#

SpatialCoordsField

AnnData obsm field for 2D/3D spatial coordinates.

NeighborhoodGraphField

AnnData obsm field for neighbor index/distance arrays.

Modules (neural networks)#

nicheVAE

Variational auto-encoder with niche decoders [Levy et al., 2025].

JVAE

Joint variational auto-encoder for imputing missing genes in spatial data.

Utilities#

get_spatial_coords

Extract spatial coordinates from AnnData.obsm.

validate_spatial_coords

Validate that spatial coordinate array has correct shape.

resolve_device

Resolve device string, preferring CUDA, then MPS, then CPU in "auto" mode.

stats_dtype

Preferred floating dtype for statistical computations on device.