monkeybread.plot.cell_transcript_proximity

monkeybread.plot.cell_transcript_proximity(adata, cells, transcripts=None, label=None, legend=False, pairwise=False, show=True, ax=None, **kwargs)

Plots cell boundaries and optionally transcripts in the surrounding area.

Parameters
  • adata (AnnData) – Annotated data matrix.

  • cells (List[str]) – A list of cell ids to plot.

  • transcripts (Optional[DataFrame] (default: None)) – Transcripts to plot, as calculated by monkeybread.calc.cell_transcript_proximity().

  • label (Optional[str] (default: None)) – A column in adata to use to color cells.

  • legend (Optional[bool] (default: False)) – Whether to include cell/transcript labels in a legend.

  • pairwise (Optional[bool] (default: False)) – Whether to draw a matrix of subplots [i, j] where the plot at [i, j] contains only the genes demarcated by the row and column. Allows for more fine-tuned observation of specific genes.

  • show (Optional[bool] (default: True)) – Whether to show the plot or return the Axes object.

  • ax (Optional[Axes] (default: None)) – An axis object to use, only used if pairwise = False.

  • kwargs – Keyword arguments passed to seaborn.scatterplot() for transcripts.

Return type

Union[Axes, Figure, None]

Returns

A matplotlib Axes containing the plot if pairwise = False, otherwise a matplotlib Figure containing all of the subplots. Only returned if show = False.