troutpy.pl.nmf_factors_exrna_cells_W

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')#

Extracts the NMF (Non-negative Matrix Factorization) factors from the specified AnnData object within the spatial data (sdata) and creates spatial plots for each factor. The plots can be displayed or saved to disk.

Parameters:
  • sdata (spatialdata.SpatialData) – A spatial transcriptomics dataset that contains the NMF factors in the specified key.

  • nmf_adata_key (str) – The key in sdata that contains the AnnData object with NMF results. Defaults to ‘nmf_data’.

  • save (bool) – Whether to save the spatial factor plots to disk. Defaults to True.

  • saving_path (str) – Path where the plots should be saved if save is True. The plots are saved in a figures subdirectory.

  • spot_size (int) – Size of the spots in the spatial plot. Defaults to 30.

  • cmap (str) – Colormap to use for the spatial plots. Defaults to ‘viridis’.

Returns:

None