troutpy.pl.factors_in_cells

troutpy.pl.factors_in_cells#

troutpy.pl.factors_in_cells(sdata, layer='table', method='matrixplot', celltype_key='cell_type', cmap='troutpy', **kwargs)#

Plot per-cell factor loadings from a specified table, grouped by cell type.

Parameters:
  • sdata (SpatialData) – The SpatialData object containing the data.

  • layer (str (default: 'table')) – The table in sdata from which to extract the factor loadings (.obsm["factors_cell_loadings"]).

  • method (str (default: 'matrixplot')) – The plotting method: "matrixplot", "dotplot", "violin", or "heatmap".

  • celltype_key (str (default: 'cell_type')) – The key in .obs to group by.

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

  • kwargs (dict[str, Any]) – Additional keyword arguments passed to the underlying scanpy.pl plotting function.

Returns:

None