troutpy.pl.spatial_inout_expression

troutpy.pl.spatial_inout_expression#

troutpy.pl.spatial_inout_expression(sdata, gene, layer_cells='table', layer_extra='segmentation_free_table', spot_size_cells=7, spot_size_extra=12, extra_cmap='Aquas_contrast', cells_cmap='Pinks_contrast', title=None, save=False, figures_path='', custom_plot_filename=None)#

Plot intracellular and extracellular expression of a selected gene side by side.

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

  • gene (str) – Name of the gene to plot.

  • layer_cells (str (default: 'table')) – Key in sdata where cell expression is stored.

  • layer_extra (str (default: 'segmentation_free_table')) – Key in sdata where extracellular expression is stored.

  • spot_size_cells (float (default: 7)) – Size of the marker for cells.

  • spot_size_extra (float (default: 12)) – Size of the marker for extracellular spots.

  • extra_cmap (str (default: 'Aquas_contrast')) – Colormap for extracellular expression, resolved via troutpy.pl.get_colormap().

  • cells_cmap (str (default: 'Pinks_contrast')) – Colormap for cellular expression, resolved via troutpy.pl.get_colormap().

  • title (Optional[str] (default: None)) – Custom title for the plot. If None, defaults to f"Expression of {gene}".

  • save (bool (default: False)) – Whether to save the figure to figures_path instead of showing it.

  • figures_path (str (default: '')) – Directory to save the figure in, if save is True.

  • custom_plot_filename (Optional[str] (default: None)) – Custom filename for the saved figure. If None, defaults to f"spatial_inout_{gene}.pdf".

Return type:

None

Returns:

None