spateo.plotting.static.agg ========================== .. py:module:: spateo.plotting.static.agg .. autoapi-nested-parse:: Plotting functions for aggregated UMI counts. Functions --------- .. autoapisummary:: spateo.plotting.static.agg.imshow spateo.plotting.static.agg.box_qc_regions spateo.plotting.static.agg.qc_regions Module Contents --------------- .. py:function:: imshow(adata: anndata.AnnData, layer: str = SKM.X_LAYER, ax: Optional[matplotlib.axes.Axes] = None, show_cbar: bool = False, use_scale: bool = True, absolute: bool = False, labels: bool = False, downscale: float = 1.0, downscale_interpolation: Optional[int] = None, background: Optional[str] = None, save_show_or_return: typing_extensions.Literal[save, show, return, both, all] = 'show', save_kwargs: Optional[Dict] = None, **kwargs) -> Optional[Tuple[matplotlib.figure.Figure, matplotlib.axes.Axes]] Display raw data within an AnnData. :param adata: Anndata containing aggregated UMI counts. :param layer: Layer to display. Defaults to X. :param ax: Axes to plot. :param show_cbar: Whether or not to show a colorbar next to the plot. :param use_scale: Whether or not to plot in physical units. Only valid when appropriate scale keys are present in .uns :param absolute: Whether to set the axes to be in absolute coordinates. By default, relative coordinates are used (i.e. the axes start at zero). :param labels: Whether the input data contains labels, encoded as positive integers. :param downscale: Downscale image by this amount for faster plotting. :param downscale_interpolation: Use this CV2 interpolation method when downscaling. By default, bilinear interpolation is used when `labels=True` and nearest neighbor interpolation when `labels=False`. Available options are located here: https://docs.opencv.org/3.4/da/d54/group__imgproc__transform.html#ga5bb5a1fea74ea38e1a5445ca803ff121 Only has an effect when `downscale` < 1. :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 save_show_or_return: Whether to save, show or return the figure. If "both", it will save and plot the figure at the same time. If "all", the figure will be saved, displayed and the associated axis and other object will be return. :param save_kwargs: A dictionary that will passed to the save_fig function. By default it is an empty dictionary and the save_fig function will use the {"path": None, "prefix": 'scatter', "dpi": None, "ext": 'pdf', "transparent": True, "close": True, "verbose": True} as its parameters. Otherwise you can provide a dictionary that properly modify those keys according to your needs. :param \*\*kwargs: Additional keyword arguments are all passed to :func:`imshow`. :returns: The figure and axis if `ax` is not provided. .. py:function:: box_qc_regions(adata: anndata.AnnData, layer: str = SKM.X_LAYER, use_scale: bool = True, box_kwargs: Optional[Dict] = None, ax: Optional[matplotlib.axes.Axes] = None, background: Optional[str] = None, save_show_or_return: typing_extensions.Literal[save, show, return, both, all] = 'show', save_kwargs: Optional[Dict] = None, **kwargs) Indicate selected QC regions with boxes on the full tissue. :param adata: Input Anndata :param layer: Layer to display :param use_scale: Whether or not to plot in physical units. Only valid when appropriate scale keys are present in .uns :param box_kwargs: Keyword arguments to pass to :func:`patches.Rectangle`. By default, the boxes will be transparent with red outlines of 1 point thickness. :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 save_show_or_return: Whether to save, show or return the figure. If "both", it will save and plot the figure at the same time. If "all", the figure will be saved, displayed and the associated axis and other object will be return. :param save_kwargs: A dictionary that will passed to the save_fig function. By default it is an empty dictionary and the save_fig function will use the {"path": None, "prefix": 'scatter', "dpi": None, "ext": 'pdf', "transparent": True, "close": True, "verbose": True} as its parameters. Otherwise you can provide a dictionary that properly modify those keys according to your needs. :param \*\*kwargs: Additional keyword arguments are all passed to :func:`imshow`. .. py:function:: qc_regions(adata: anndata.AnnData, layer: str = SKM.X_LAYER, axes: Optional[numpy.ndarray] = None, ncols: int = 1, background: Optional[str] = None, save_show_or_return: typing_extensions.Literal[save, show, return, both, all] = 'show', save_kwargs: Optional[Dict] = None, **kwargs) -> Optional[Tuple[matplotlib.figure.Figure, numpy.ndarray]] Display QC regions. :param adata: Input Anndata :param layer: Layer to display :param axes: Numpy array (possibly 2D) of Matplotlib axes to plot each region. This option is useful when trying to overlay multiple layers together. :param ncols: Number of columns when displaying multiple panels. :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 save_show_or_return: Whether to save, show or return the figure. If "both", it will save and plot the figure at the same time. If "all", the figure will be saved, displayed and the associated axis and other object will be return. :param save_kwargs: A dictionary that will passed to the save_fig function. By default it is an empty dictionary and the save_fig function will use the {"path": None, "prefix": 'scatter', "dpi": None, "ext": 'pdf', "transparent": True, "close": True, "verbose": True} as its parameters. Otherwise you can provide a dictionary that properly modify those keys according to your needs. :param \*\*kwargs: Additional keyword arguments are all passed to :func:`imshow`. :returns: The figure and axes if `axes` is not provided.