monkeybread.plot.embedding_zoom

monkeybread.plot.embedding_zoom(adata, left_pct=None, top_pct=None, width_pct=None, height_pct=None, group=None, mask=None, basis='spatial', show=True, **kwargs)

Shows embeddings of cells in contact with zoomed focus. Can be spatial or any other basis.

Plots the results of monkeybread.calc.cell_contact(), highlighting the cells in contact. Zooms in on a specific rectangle in the plot, based on fractional coordinate space, for higher-resolution viewing.

Parameters
  • adata (AnnData) – Annotated data matrix.

  • left_pct (Optional[float] (default: None)) – The fraction of the plot width to use as the left bound of the zoomed-in rectangle, e.g. 0.1 represents 10% from the left of the plot.

  • top_pct (Optional[float] (default: None)) – The fraction of the plot height to use as the upper bound of the zoomed-in rectangle, e.g. 0.3 represents 30% from the top of the plot.

  • width_pct (Optional[float] (default: None)) – The fraction of the plot width to use for the zoomed-in rectangle, e.g. 0.5 represents a width half of the original plot.

  • height_pct (Optional[float] (default: None)) – The fraction of the plot height to use for the zoomed-in rectangle, e.g. 0.25 represents a height 25% of the original plot.

  • group (Optional[str] (default: None)) – Column in adata.obs to label cell contacts by.

  • mask (Union[List[bool], List[str], None] (default: None)) – A mask to apply to adata.obs.index. Can be a list of cell indices or a boolean mask with the same length as the index, as described in monkeybread.plot.embedding_filter().

  • basis (Optional[str] (default: 'spatial')) – Coordinates in adata.obsm[X_{basis}] to use. Defaults to spatial.

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

  • kwargs – Keyword arguments that will be passed to scanpy.pl.embedding().

Return type

Optional[Figure]

Returns

If show = True, returns nothing. Otherwise, returns the Figure object the plots are contained within.