troutpy.pl.paired_nmf_factors

troutpy.pl.paired_nmf_factors#

troutpy.pl.paired_nmf_factors(sdata, layer='nmf_data', n_factors=5, figsize=(12, 6), spot_size_exrna=5, spot_size_cells=10, cmap_exrna='YlGnBu', cmap_cells='Reds', vmax_exrna='p99', vmax_cells=None, save=False, output_path='', format='pdf')#

Plots the spatial distribution of NMF factors for extracellular transcripts and cells.

Parameters:
  • sdata (spatialdata.SpatialData) – spatial data object containing both extracellular and cell data.

  • layer (str) – Layer in sdata to extract the NMF data from (default: ‘nmf_data’).

  • n_factors (int) – Number of NMF factors to plot (default: 5).

  • figsize (tuple) – Size of the figure for each subplot (default: (12, 6)).

  • spot_size_exrna (float) – Size of the spots for extracellular transcript scatter plot (default: 5).

  • spot_size_cells (float) – Size of the spots for cell scatter plot (default: 10).

  • cmap_exrna (str) – Colormap for the extracellular transcript NMF factors (default: ‘YlGnBu’).

  • cmap_cells (str) – Colormap for the cell NMF factors (default: ‘Reds’).

  • vmax_exrna (str) – Maximum value for extracellular transcript color scale (default: ‘p99’).

  • vmax_cells (str) – Maximum value for cell color scale (default: None).