monkeybread.plot.cell_neighbor_embedding
- monkeybread.plot.cell_neighbor_embedding(adata, cell_to_neighbors, group=None, basis='X_spatial', group1_name='Group 1', group2_name='Group 2', dot_size_group1=None, dot_size_group2=None, dot_size_unselected=None, palette=None, cell_color_unselected='lightgrey', show=True, ax=None, **kwargs)
Shows embeddings of cells with their neighbors.
Plots the results of
monkeybread.calc.cell_neighbors(), highlighting the cells and their neighbors within the tissue.- Parameters:
adata (
AnnData) – Annotated data matrix.cell_to_neighbors (
Dict[str,Set[str]]) – Cells and their associated neighbors as calculated bymonkeybread.calc.cell_neighbors().group (
Optional[str] (default:None)) – Column inadata.obsfor which to color cells. IfNone, cells will be labeled according to thegroup1_nameandgroup2_namearguments.basis (
Optional[str] (default:'X_spatial')) – Coordinates inadata.obsm[{basis}]to use. Defaults toX_spatial.group1_name (
Optional[str] (default:'Group 1')) – Name of the first group of cells. Used to label the cells in the first groupgroup2_name (
Optional[str] (default:'Group 2')) – Name of the second group of cells. Used to label the cells in the second groupdot_size_group1 (
Optional[float] (default:None)) – Size of the dots denoting cells in the first groupdot_size_group2 (
Optional[float] (default:None)) – Size of the dots denoting cells in the second groupdot_size_unselected (
Optional[float] (default:None)) – Size of the dots denoting cells in neither the first nor second grouppalette (
Optional[List[str]] (default:None)) – Color palette used to color the cellscell_color_unselected (
Optional[str] (default:'lightgrey')) – Color of cells that are neither in the first nor second groupshow (
Optional[bool] (default:True)) – Whether to show the plot or return the Axes object.ax (
Optional[Axes] (default:None)) – An Axes object to add the plots to.kwargs – Keyword arguments that will be passed to
scanpy.pl.embedding().
- Return type:
- Returns:
: If
show = True, returns nothing. Otherwise, returns the Axes object the plot is contained within.