scviva.model.base.SpatialDeconvolutionMixin#
- class scviva.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)
Methods table
|
Return cell type proportions as a tidy DataFrame. |
|
Plot spatial map of a single cell type's proportion. |
Methods
- SpatialDeconvolutionMixin.get_proportions_df(adata=None)[source]#
Return cell type proportions as a tidy DataFrame.
- SpatialDeconvolutionMixin.plot_cell_type_map(adata=None, cell_type=None, basis='spatial', ax=None, **kwargs)[source]#
Plot spatial map of a single cell type’s proportion.
- Parameters:
- adata
AnnData|None AnnData object. If None, uses the model’s registered adata.
- cell_type
str|None Name of the cell type to visualize. Must be in
self.cell_type_mapping.- basis
str Key in
adata.obsmfor spatial coordinates.- ax
Matplotlib axes. If None, a new figure is created.
- **kwargs
Forwarded to
scanpy.pl.embedding().
- adata