API Reference#

Models#

Core Models#

model.SpatialVAE

Spatial Variational Autoencoder for spatial transcriptomics.

model.BaseSpatialModel

Base class for all spatial transcriptomics models.

External Models#

external.AMICI

AMICI model for cell-cell interaction inference.

external.VIVS

VIVS model for identifying spatially variable genes.

external.Starfysh

Starfysh model for spatial deconvolution with histology.

external.Harreman

Harreman model for metabolic exchange inference.

external.Nolan

High-level interface to the NOLAN spatial niche model.

external.Lambda

Language-model based cell type annotation.

external.PPIInference

Static methods for prediction-powered inference.

external.SPARL

Interface to the SPARL representation learning model.

external.scVIVA

Wrapper for scvi-tools scVIVA model.

external.ResolVI

Wrapper for scvi-tools ResolVI model.

external.DestVI

Wrapper for scvi-tools DestVI model.

Modules#

module.SpatialVAEModule

Spatial VAE module for gene expression modeling.

module.NicheModule

Module for niche-aware spatial analysis.

module.DeconvolutionModule

Module for spatial deconvolution.

Data#

data.compute_spatial_neighbors

Compute spatial nearest neighbors.

data.compute_niche_composition

Compute neighborhood cell type composition.

data.synthetic_spatial

Generate synthetic spatial transcriptomics data.

data.synthetic_scrna

Generate synthetic single-cell RNA-seq data.

Neural Network Components#

nn.SpatialEncoder

Encoder that incorporates spatial context.

nn.SpatialDecoder

Decoder that can incorporate spatial context for reconstruction.

nn.SpatialAttention

Spatial attention mechanism that weights neighbors by distance.

nn.NeighborAttention

Attention mechanism for aggregating neighbor information.

Training#

train.SpatialTrainingPlan

Training plan with spatial-specific features.

train.NicheTrainingPlan

Training plan for niche-aware models.

train.DeconvolutionTrainingPlan

Training plan for spatial deconvolution models.

Utilities#

utils.spatial_autocorrelation

Compute spatial autocorrelation for genes.

utils.plot_spatial

Plot cells in spatial coordinates.

utils.plot_proportions

Plot cell type proportions in spatial coordinates.