troutpy.pl.nmf_factors_exrna_cells_W#
- troutpy.pl.nmf_factors_exrna_cells_W(sdata, nmf_adata_key='nmf_data', save=True, saving_path='', spot_size=30, cmap='viridis')#
Plot the spatial distribution of each NMF factor for cells.
Extracts the NMF (Non-negative Matrix Factorization) cell loadings (
Wmatrix) from the AnnData object stored atnmf_adata_keywithinsdataand creates a spatial plot for each factor.- Parameters:
sdata (
SpatialData) – A spatial transcriptomics dataset that contains the NMF factors in the specified key.nmf_adata_key (
str(default:'nmf_data')) – The key insdatathat contains the AnnData object with NMF results.save (
bool(default:True)) – Whether to save the spatial factor plots to disk. The plots are saved in afiguressubdirectory ofsaving_path.saving_path (
str(default:'')) – Path where the plots should be saved ifsaveisTrue.spot_size (
int(default:30)) – Size of the spots in the spatial plot. Only used ifsaveisFalse.cmap (
str(default:'viridis')) – Colormap to use for the spatial plots.
- Return type:
- Returns:
None