troutpy.pl.rank_factor_genes_loadings_matrixplot

troutpy.pl.rank_factor_genes_loadings_matrixplot#

troutpy.pl.rank_factor_genes_loadings_matrixplot(sdata, layer, n_genes=5, cmap='Pinks', vmin=None, vmax=None, show=True, save=None, figsize=None)#

Plot ranking of genes using a matrixplot based on factor loadings.

Parameters:
  • sdata (SpatialData) – The spatial data object containing gene expression information.

  • layer (str) – The layer in sdata that contains the AnnData object.

  • n_genes (int (default: 5)) – Number of top genes to plot per factor.

  • cmap (str (default: 'Pinks')) – Colormap for visualization. If not a built-in Matplotlib colormap, it is resolved via troutpy.pl.get_colormap().

  • vmin (Optional[float] (default: None)) – Lower color scaling limit.

  • vmax (Optional[float] (default: None)) – Upper color scaling limit.

  • show (bool (default: True)) – Whether to display the plot.

  • save (Optional[str] (default: None)) – Path to save the figure. If None, the figure is not saved.

  • figsize (Optional[tuple] (default: None)) – Figure size. If None, it is derived from the number of factors and genes.

Returns:

If show=True, None. Otherwise, the current matplotlib.axes.Axes.