omicverse.space.STT

omicverse.space.STT(adata, spatial_loc='xy_loc', region='Region')[source]

Spatial Transition Tensor (STT) analysis class.

STT models spatial dynamics and transitions by learning spatial-temporal patterns in spatial transcriptomics data using transition tensors. This class provides methods for analyzing cell state transitions, developmental trajectories, and spatial dynamics in tissue organization.

Parameters:
  • adata (AnnData) – Spatial AnnData containing spliced/unspliced layers and coordinates.

  • spatial_loc (str, default='xy_loc') – Coordinate key in adata.obsm.

  • region (str, default='Region') – Region annotation column in adata.obs.

  • Attributes

    adata: AnnData

    Input annotated data matrix.

    adata_aggr: AnnData or None

    Aggregated data after training.

    spatial_loc: str

    Key for spatial coordinates.

    region: str

    Key for region annotations.

  • Examples

    >>> import scanpy as sc
    >>> import omicverse as ov
    >>> # Load data with spliced/unspliced counts
    >>> adata = sc.read_h5ad('spatial_velocity.h5ad')
    >>> # Initialize STT object
    >>> stt = ov.space.STT(
    ...     adata,
    ...     spatial_loc='spatial',
    ...     region='tissue_region'
    ... )
    >>> # Estimate cell stages
    >>> stt.stage_estimate()
    >>> # Train the model
    >>> stt.train(n_states=10)