spateo.plotting.interactive.agg =============================== .. py:module:: spateo.plotting.interactive.agg .. autoapi-nested-parse:: Interactive plotting functions for aggregated UMI counts. Functions --------- .. autoapisummary:: spateo.plotting.interactive.agg.contours spateo.plotting.interactive.agg.select_polygon spateo.plotting.interactive.agg.cellbin_select Module Contents --------------- .. py:function:: contours(adata: anndata.AnnData, layer: str, colors: Optional[List] = None, scale: float = 0.05) -> plotly.graph_objects.Figure Interactively display UMI density bins. :param adata: Anndata containing aggregated UMI counts. :param layer: Layer to display :param colors: List of colors. :param scale: Scale width and height by this amount. :returns: A Plotly figure .. py:function:: select_polygon(adata: anndata.AnnData, layer: str, out_layer: Optional[str] = None, ax: Optional[matplotlib.axes.Axes] = None, background: Optional[str] = None, **kwargs) -> matplotlib.widgets.PolygonSelector Display raw data within an AnnData with interactive polygon selection. :param adata: Anndata containing aggregated UMI counts. :param layer: Layer to display. Defaults to X. :param out_layer: Layer to output selection result as a boolean mask. Defaults to `{layer}_selection`. :param ax: Axes to plot. :param background: string or None (optional, default 'None`) The color of the background. Usually this will be either 'white' or 'black', but any color name will work. Ideally one wants to match this appropriately to the colors being used for points etc. This is one of the things that themes handle for you. Note that if theme is passed then this value will be overridden by the corresponding option of the theme. :param \*\*kwargs: Additional keyword arguments are all passed to :func:`spateo.pl.imshow`. .. py:function:: cellbin_select(adata: anndata.AnnData, binsize: int = 50, spatial_key: str = 'spatial', layer: Optional[str] = None, scale: float = 0.5, scale_unit: str = 'um', return_all: bool = False) -> Union[matplotlib.widgets.PolygonSelector, Tuple[matplotlib.widgets.PolygonSelector, anndata.AnnData]] Select cells by drawing a polygon on a binning image of the spatial transcriptomics data. :param adata: Anndata containing segmented cells. :param binsize: Size of bins to use for aggregating the expression data. :param spatial_key: The key to the spatial coordinates in the `adata.obsm` attribute. :param layer: The layer to use for the expression data. Defaults to None (adata.X will be used). :param scale: The scale of the spatial coordinates. :param scale_unit: The unit of the spatial coordinates. :param return_all: Whether to return both the `PolygonSelector` and the aggregated image. :returns: When return_all is False, only a `PolygonSelector` object will be returned; otherwise both a tuple of both the aggregated image data and the `PolygonSelector` object will be used.