spatialvi.model.base.SpatialDeconvolutionMixin

spatialvi.model.base.SpatialDeconvolutionMixin#

class spatialvi.model.base.SpatialDeconvolutionMixin[source]#

Mixin for spatial deconvolution result formatting and visualization.

Applied to: DestVI only.

Requires the model to implement: - self.cell_type_mapping: np.ndarray of cell type label strings - self.get_proportions(adata): returns np.ndarray of shape (n_spots, n_cell_types)

__init__()#

Methods

__init__()

get_proportions_df([adata])

Return cell type proportions as a tidy DataFrame.

plot_cell_type_map([adata, cell_type, basis, ax])

Plot spatial map of a single cell type's proportion.