troutpy.pl.intra_extra_density

troutpy.pl.intra_extra_density#

troutpy.pl.intra_extra_density(sdata, genes, layer='transcripts', gene_key='feature_name', coord_keys=None, intra_kde_kwargs=None, extra_kde_kwargs=None, figsize=None)#

Plots kernel density estimates (KDE) for the spatial distribution of intracellular and extracellular transcripts for a list of genes. Each gene is displayed in a separate row with intracellular and extracellular KDEs in side-by-side subplots.

Parameters:
  • sdata (spatialdata.SpatialData) – SpatialData object containing transcript locations and metadata.

  • genes (list) – list of str, gene names to plot.

  • layer (str) – layer within sdata.points where transcripts are stored (default: “transcripts”).

  • gene_key (str) – column name where the gene name is stored (default: “feature_name”).

  • coord_keys (list) – column names for spatial coordinates (default: [“x”, “y”]).

  • intra_kde_kwargs (dict) – optional arguments for seaborn’s kdeplot for intracellular data.

  • extra_kde_kwargs (dict) – optional arguments for seaborn’s kdeplot for extracellular data.