U
    md                     @   s  d Z ddlmZ ddlmZ ddlmZmZm	Z	 ddlm
Z
mZ ddlmZ ddlZddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddl m!Z!m"Z" ddl m#Z#m$Z$ ddl%m&Z&m'Z'm(Z( ee)e
e) f Z*dZ+G dd de,Z-dS )z4BasePlot for dotplot, matrixplot and stacked_violin
    N)
namedtuple)OptionalUnionMapping)SequenceIterable)Tuple)AnnData)Axes)pyplot)gridspec)	Normalize)warn   )logging)Literal   )make_grid_speccheck_colornorm)	ColorLike_AxesSubplot)_plot_dendrogram_get_dendrogram_key_prepare_dataframea  title
    Title for the figure
colorbar_title
    Title for the color bar. New line character (\n) can be used.
cmap
    String denoting matplotlib color map.
standard_scale
    Whether or not to standardize the given dimension between 0 and 1, meaning for
    each variable or group, subtract the minimum and divide each by its maximum.
swap_axes
     By default, the x axis contains `var_names` (e.g. genes) and the y axis
     the `groupby` categories. By setting `swap_axes` then x are the
     `groupby` categories and y the `var_names`.
return_fig
    Returns :class:`DotPlot` object. Useful for fine-tuning
    the plot. Takes precedence over `show=False`.
c                   @   s.  e Zd ZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdDeeeeeef f eeee f ee eeeee  ed eeeef  ee eeeeef   eee  ee ee ee ee ee ee ee dddZdEee dddZdFee ee ee dddZdGee ed ee eeeee f  dddZe	fee ddd Z dee
fee ee ee d!d"d#Z!d$d% Z"e#ed& d'd(d)Z$e#d*d+d,Z%d-d. Z&d/d0 Z'd1d2 Z(dHee d3d4d5Z)dIeee d7d8d9Z*d:d; Z+e,dJe#e-eeef  ee eeee ed& d?d@dAZ.dBdC Z/dS )KBasePlota      Generic class for the visualization of AnnData categories and
    selected `var` (features or genes).

    Takes care of the visual location of a main plot, additional plots
    in the margins (e.g. dendrogram, margin totals) and legends. Also
    understand how to adapt the visual parameter if the plot is rotated

    Classed based on BasePlot implement their own _mainplot() method.

    The BasePlot works by method chaining. For example:
    BasePlot(adata, ...).legend(title='legend').style(cmap='binary').show()
    Z	baseplot_g      @gffffff?gGz?r   Zwinter      ?zExpression
level in groupi  NF   str)adata	var_namesgroupbyuse_rawlognum_categoriescategories_ordertitlefigsizegene_symbolsvar_group_positionsvar_group_labelsvar_group_rotationlayeraxvminvmaxvcenternormc                 K   s  || _ || _|| _|| _|	d k	r$|	nd\| _| _|d k	rHt|dkrHdnd| _|   t	|| j ||||||
d\| _
| _t| j
| jkrtd| j d |d k	rt| jjj
t|krtdt| jjj
| d	| d
| dt| jjj
 d	 d S || _t|tr|gn|| _|| _|| _tdddddg}|||||d| _| j| _| j| _| j | _!d| _"|| _#d | _$| j%| _&| j'| _(|| _)d| _*d | _+d | _,d | _-|| _.d S )N)NNr   TF)r+   r'   zOver z, categories found. Plot would be very large.z{Please check that the categories given by the `order` parameter match the categories that want to be reordered.

Mismatch: z

Given order categories: z

z categories: 

VBoundNormr-   r.   r/   r0   )r-   r.   r/   r0   )/r   r)   r(   r*   widthheightlenhas_var_groups_update_var_groupsr   
categoriesobs_tidyMAX_NUM_CATEGORIESr   setindexloggerror
differencelistr   
isinstancer   r    r"   kwdsr   
vboundnormDEFAULT_COLOR_LEGEND_TITLEcolor_legend_titleDEFAULT_LEGENDS_WIDTHlegends_widthDEFAULT_COLORMAPcmapare_axes_swappedr$   var_names_idx_orderDEFAULT_WSPACEwspaceMIN_FIGURE_HEIGHTmin_figure_height	fig_titlegroup_extra_sizeplot_group_extrafigax_dictr,   )selfr   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   rB   r2    rV   X/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/scanpy/plotting/_baseplot_class.py__init__J   sh    

6	zBasePlot.__init__T)	swap_axesc                 C   s   | j | j | _| _ || _| S )a  
        Plots a transposed image.

        By default, the x axis contains `var_names` (e.g. genes) and the y
        axis the `groupby` categories. By setting `swap_axes` then x are
        the `groupby` categories and y the `var_names`.

        Parameters
        ----------
        swap_axes
            Boolean to turn on (True) or off (False) 'swap_axes'. Default True


        Returns
        -------
        BasePlot

        )DEFAULT_CATEGORY_WIDTHDEFAULT_CATEGORY_HEIGHTrJ   )rU   rY   rV   rV   rW   rY      s
    
zBasePlot.swap_axes皙?)showdendrogram_keysizec                 C   sr   |sd| _ | S | jdks&t| jdkr4td | S || _| | t	t| jd }|| _d|||d| _ | S )a          Show dendrogram based on the hierarchical clustering between the `groupby`
        categories. Categories are reordered to match the dendrogram order.

        The dendrogram information is computed using :func:`scanpy.tl.dendrogram`.
        If `sc.tl.dendrogram` has not been called previously the function is called
        with default parameters.

        The dendrogram is by default shown on the right side of the plot or on top
        if the axes are swapped.

        `var_names` are reordered to produce a more pleasing output if:
            * The data contains `var_groups`
            * the `var_groups` match the categories.

        The previous conditions happen by default when using Plot
        to show the results from :func:`~scanpy.tl.rank_genes_groups` (aka gene markers), by
        calling `scanpy.tl.rank_genes_groups_(plot_name)`.


        Parameters
        ----------
        show
            Boolean to turn on (True) or off (False) 'add_dendrogram'
        dendrogram_key
            Needed if `sc.tl.dendrogram` saved the dendrogram using a key different
            than the default name.
        size
            size of the dendrogram. Corresponds to width when dendrogram shown on
            the right of the plot, or height when shown on top. The unit is the same
            as in matplotlib (inches).

        Returns
        -------
        BasePlot


        Examples
        --------
        >>> adata = sc.datasets.pbmc68k_reduced()
        >>> markers = {'T-cell': 'CD3D', 'B-cell': 'CD79A', 'myeloid': 'CST3'}
        >>> sc.pl.BasePlot(adata, markers, groupby='bulk_labels').add_dendrogram().show()

        Nr   zXDendrogram not added. Dendrogram is added only when the number of categories to plot > 2      ?
dendrogram)kindr3   r^   dendrogram_ticks)
rR   r    r5   r8   r=   warningrQ   $_reorder_categories_after_dendrogramnparange)rU   r]   r^   r_   Zdendro_ticksrV   rV   rW   add_dendrogram   s$    3
zBasePlot.add_dendrogram)	ascendingZ
descending)r]   sortr_   colorc                 C   sn   || _ |sd| _d| _ | S |dk	r&dnd}|dkr6dnd}| jjj||d}|rX|j| _d||||d| _| S )	aw          Show barplot for the number of cells in in `groupby` category.

        The barplot is by default shown on the right side of the plot or on top
        if the axes are swapped.


        Parameters
        ----------
        show
            Boolean to turn on (True) or off (False) 'add_totals'
        sort
            Set to either 'ascending' or 'descending' to reorder the categories
            by cell number
        size
            size of the barplot. Corresponds to width when shown on
            the right of the plot, or height when shown on top. The unit is the same
            as in matplotlib (inches).
        color
            Color for the bar plots or list of colors for each of the bar plots.
            By default, each bar plot uses the colors assigned in
            `adata.uns[{groupby}_colors]`.


        Returns
        -------
        BasePlot


        Examples
        --------
        >>> adata = sc.datasets.pbmc68k_reduced()
        >>> markers = {'T-cell': 'CD3D', 'B-cell': 'CD79A', 'myeloid': 'CST3'}
        >>> sc.pl.BasePlot(adata, markers, groupby='bulk_labels').add_totals().show()
        Nr   TFri   )rj   ri   group_totals)rb   r3   rj   	counts_dfrk   )rQ   rR   r9   r<   Zvalue_countsr$   )rU   r]   rj   r_   rk   Z_sortZ
_ascendingrm   rV   rV   rW   
add_totals  s"    *zBasePlot.add_totalsrI   c                 C   s
   || _ dS )z        Set visual style parameters

        Parameters
        ----------
        cmap
            colormap

        Returns
        -------
        BasePlot
        Nro   )rU   rI   rV   rV   rW   style\  s    zBasePlot.style)r]   r%   r3   c                 C   s   |sd| _ n|| _|| _ | S )a;          Configure legend parameters

        Parameters
        ----------
        show
            Set to 'False' to hide the default plot of the legend. This sets the
            legend width to zero which will result in a wider main plot.
        title
            Legend title. Appears on top of the color bar. Use '\n' to add line breaks.
        width
            Width of the legend. The unit is the same as in matplotlib (inches)

        Returns
        -------
        BasePlot


        Examples
        --------

        Set legend title:

        >>> adata = sc.datasets.pbmc68k_reduced()
        >>> markers = {'T-cell': 'CD3D', 'B-cell': 'CD79A', 'myeloid': 'CST3'}
        >>> dp = sc.pl.BasePlot(adata, markers, groupby='bulk_labels')
        >>> dp.legend(colorbar_title='log(UMI counts + 1)').show()
        r   )rG   rE   )rU   r]   r%   r3   rV   rV   rW   legendl  s
    #zBasePlot.legendc                 C   s   | j d kr|   | j S )N)rT   make_figurerU   rV   rV   rW   get_axes  s    
zBasePlot.get_axes)topright)total_barplot_axorientationc           
   
   C   s  | j }|d }| jdk	r$|j| j }|d dkr`| j d| jjkrZ| jj| j d }qhd}n|d }|dkr@|jd|d|d	d
d tdd |jD }|jD ]}|	|
 d  | dkrtj| d dd d}ntj| dd}|j||
 | d  | |d  fdddddd q|d|d  n|dkr|jd|d|d	d
d tdd |jD }	|jD ]p}| dkrtj| d dd d}ntj| dd}|j|| | |  fdddddd qz|d|	d  |d  |d! dS )"z/
        Makes the bar plot for totals
        rm   Nrk   _colorsZsalmonru   barr`   blackg?)rb   rk   positionr,   Z	edgecolorr3   c                 S   s   g | ]}|  qS rV   )
get_height.0prV   rV   rW   
<listcomp>  s     z)BasePlot._plot_totals.<locals>.<listcomp>i  r   )Zdecimalskg       @g?center)r   
   zx-smallzoffset points)havaZxytextfontsizeZ
textcoordsr   gffffff?rv   Zbarh333333ӿc                 S   s   g | ]}|  qS rV   )	get_widthr~   rV   rV   rW   r     s     )r   r   Foff)rR   r$   locr    r   unsZplotmaxpatchesZset_xZget_xr}   rf   roundZannotater   set_ylimZget_yset_xlimgridaxis)
rU   rw   rx   paramsrm   rk   Zmax_yr   Zdisplay_numberZmax_xrV   rV   rW   _plot_totals  sx    

	
"



	
zBasePlot._plot_totals)color_legend_axc                 C   s`   t | j}ddl}ddlm} |||d}|jj||dd |j| j	dd |j
jdd	 dS )
z
        Plots a horizontal colorbar given the ax an normalize values

        Parameters
        ----------
        color_legend_ax
        normalize

        Returns
        -------
        None, updates color_legend_ax

        r   N)ScalarMappable)r0   rI   
horizontal)mappablerx   small)r   )	labelsize)plZget_cmaprI   Zmatplotlib.colorbarZmatplotlib.cmr   ZcolorbarZColorbar	set_titlerE   xaxisset_tick_params)rU   r   	normalizerI   
matplotlibr   r   rV   rV   rW   _plot_colorbar  s      zBasePlot._plot_colorbarc           	      C   sR   | j d }| j| |g}t|dd|d\}}||d }| || ||d< d S )Ng{Gz?r   r   )nrowsncolsheight_ratiosr   )rO   r4   r   add_subplotr   )	rU   	legend_axreturn_ax_dictr   Zlegend_heightr   rS   Z	legend_gsr   rV   rV   rW   _plot_legend
  s    
   
zBasePlot._plot_legendc                    s  | j }| j | jd k	r* fdd| jD  | jd k	r:| j}| jrX|   }|| j n|| j t	t
|d }|| || t	t
 d }|| |j dddd |jdd	d
 |d |t
|d |dt
  t| jj| jj| jj| jjS )Nc                    s   g | ]} | qS rV   rV   r   xZx_labelsrV   rW   r   %  s     z&BasePlot._mainplot.<locals>.<listcomp>r`   Z   r   F)rotationr   minorZbothr   )r   r   r   )r8   r   rK   r$   rJ   Z
set_xlabelr    Z
set_ylabelrf   rg   r5   Z
set_yticksZset_yticklabelsZ
set_xticksZset_xticklabelstick_paramsr   r   r   r   rC   r-   r.   r/   r0   )rU   r,   Zy_labelsZy_ticksZx_ticksrV   r   rW   	_mainplot   s4    






zBasePlot._mainplotc              	   C   s>  | j }| j}| jdkrnt| j| }t| j| | j }| jrH|| }}|d }t| j	|g| _|| j
 | _n | j| _	| j}| j| j
| j  }i }d| j }t| jp| j| jfdd||| j | j
gd\| _}| jr| jr|}	q|d }	nd}	|| j }| j|	 | }
| js$|
|	|g}|| jg}n|
| j|g}||	g}| jdk	rz| j dkrz| j|d }|d	 || j tjd
d| jd|d ||d}| j|d }||d< | js| jdk	r| jj|d |d}d}| jr>| jj|d |d}d}n@| jr| jj|d |d}d}| jr>| jj|d |d}d}| jdk	r| jd dkr~t|| j| j| jd | jd |d | jd dkr| || ||d< | jr| j|| j| j| j dd|d ||d< | !|}|j"j#dd d d! |j$j#dd d dd" |%d# | j
dkr4| j|d$ }| &||| || _'dS )%a  
        Renders the image but does not call :func:`matplotlib.pyplot.show`. Useful
        when several plots are put together into one figure.

        See also
        --------
        `show()`: Renders and shows the plot.
        `savefig()`: Saves the plot.

        Examples
        --------

        >>> import matplotlib.pyplot as plt
        >>> adata = sc.datasets.pbmc68k_reduced()
        >>> markers = ['C1QA', 'PSAP', 'CD79A', 'CD79B', 'CST3', 'LYZ']
        >>> fig, (ax0, ax1) = plt.subplots(1, 2)
        >>> sc.pl.MatrixPlot(adata, markers, groupby='bulk_labels', ax=ax0)        ...               .style(cmap='Blues', edge_color='none').make_figure()
        >>> sc.pl.DotPlot(adata, markers, groupby='bulk_labels', ax=ax1).make_figure()
        Nr   gffffff?r   )r   r   rM   width_ratiosr    )r   r   r      g        )r   r   rM   ZhspaceZsubplot_specr   r   )r   r   Zmainplot_ax)r   r   )Zshareyrv   )r   r   )Zsharexru   rb   ra   r^   rc   )r^   Zticksrx   rl   group_extra_axg?)group_positionsgroup_labelsr   left_adjustmentright_adjustmentrx   Zgene_group_axr   F)whichleftrv   )r   ru   bottomlengthd   )r   r   )(r[   rZ   r4   r5   r8   r   rQ   rJ   r   rO   rG   r3   r   r,   rS   r6   rP   stripr   r   r   r   ZGridSpecFromSubplotSpecrM   rR   r   r   r    r   _plot_var_groups_bracketsr(   r)   r*   r   Zyaxisr   r   Z
set_zorderr   rT   )rU   Zcategory_heightZcategory_widthZmainplot_heightZmainplot_widthr4   r   Zlegends_width_spacergsZvar_groups_heightZspacer_heightr   r   Z_axZmainplot_gsZmain_axr   Zgroup_extra_orientationgene_groups_axZvar_group_orientationr   r   rV   rV   rW   rr   H  s    






		

zBasePlot.make_figure)return_axesc                 C   s   |    |r| jS t  dS )a  
        Show the figure

        Parameters
        ----------
        return_axes
             If true return a dictionary with the figure axes. When return_axes is true
             then :func:`matplotlib.pyplot.show` is not called.

        Returns
        -------
        If `return_axes=True`: Dict of :class:`matplotlib.axes.Axes`. The dict key
        indicates the type of ax (eg. `mainplot_ax`)

        See also
        --------
        `render()`: Renders the plot but does not call :func:`matplotlib.pyplot.show`
        `savefig()`: Saves the plot.

        Examples
        -------
        >>> adata = sc.datasets.pbmc68k_reduced()
        >>> markers = ['C1QA', 'PSAP', 'CD79A', 'CD79B', 'CST3', 'LYZ']
        >>> sc.pl.Plot(adata, markers, groupby='bulk_labels').show()

        N)rr   rT   r   r]   )rU   r   rV   rV   rW   r]     s    zBasePlot.showtight)filenamebbox_inchesc                 K   s"   |    tj|fd|i| dS )a  
        Save the current figure

        Parameters
        ----------
        filename
            Figure filename. Figure *format* is taken from the file ending unless
            the parameter `format` is given.
        bbox_inches
            By default is set to 'tight' to avoid cropping of the legends.
        kwargs
            Passed to :func:`matplotlib.pyplot.savefig`

        See also
        --------
        `render()`: Renders the plot but does not call :func:`matplotlib.pyplot.show`
        `show()`: Renders and shows the plot

        Examples
        -------
        >>> adata = sc.datasets.pbmc68k_reduced()
        >>> markers = ['C1QA', 'PSAP', 'CD79A', 'CD79B', 'CST3', 'LYZ']
        >>> sc.pl.BasePlot(adata, markers, groupby='bulk_labels').savefig('plot.pdf')

        r   N)rr   r   savefig)rU   r   r   kwargsrV   rV   rW   r     s    zBasePlot.savefigc                    s  dd }t  j| j} jj| } j|d krNtd j d|d  d|d }|d }t jt|krtd	t| d
 jdt j d jdk	rtt	t j} j
rt jt jkr|g }g }	d}
g }|D ]} j|} j| } j|d |d d  }|t	|d |d d  ||
|
t| d f |
t|7 }
|	 j|  q|	 _| _n"td| j d| j  |dk	r fdd|D }nd}| _|d  _| _| _dS )aT          Function used by plotting functions that need to reorder the the groupby
        observations based on the dendrogram results.

        The function checks if a dendrogram has already been precomputed.
        If not, `sc.tl.dendrogram` is run with default parameters.

        The results found in `.uns[dendrogram_key]` are used to reorder
        `var_group_labels` and `var_group_positions`.


        Returns
        -------
        None internally updates
        'categories_idx_ordered', 'var_group_names_idx_ordered',
        'var_group_labels' and 'var_group_positions'
        c                 S   s0   t | } t| dkr&| dd dg } d| S )z used to clean up warning messager   Nzetc.z, )r@   r5   join)Z_categoriesrV   rV   rW   _format_first_three_categories?  s    zUBasePlot._reorder_categories_after_dendrogram.<locals>._format_first_three_categoriesr    zaIncompatible observations. The precomputed dendrogram contains information for the observation: 'z/' while the plot is made for the observation: 'z=. Please run `sc.tl.dendrogram` using the right observation.'categories_idx_orderedcategories_orderedz/Incompatible observations. Dendrogram data has z, categories but current groupby observation z
 contains z categories. Most likely the underlying groupby observation changed after the initial computation of `sc.tl.dendrogram`. Please run `sc.tl.dendrogram` again.'Nr   r   zpGroups are not reordered because the `groupby` categories and the `var_group_labels` are different.
categories: z
var_group_labels: c                    s   g | ]} j | qS rV   )r   r   rs   rV   rW   r     s     zABasePlot._reorder_categories_after_dendrogram.<locals>.<listcomp>)r   r   r    r   
ValueErrorr5   r8   r   r@   ranger6   r;   r)   r<   r(   extendappendr=   rd   r   r$   rK   var_names_ordered)rU   ra   r   keyZdendro_infor   r   Zvar_names_idx_orderedZpositions_orderedZlabels_orderedZposition_startZcat_nameidxr|   
_var_namesr   rV   rs   rW   re   ,  sV    "




z-BasePlot._reorder_categories_after_dendrogramr   333333?ru   )r   r   r   r   r   r   rx   c              
      s  ddl m} ddlm}  fdd|D }	fdd|D }
g }g }|dkr<|dkrz|rztdd |D d	krvd
}nd}tt|	|
D ]\}\}}||df ||df ||df ||df ||j ||j	 ||j	 ||j	 |	| t
|
| |	|  d  }| j|d|| dd|d qn|	}|
}tt||D ]\}\}}|d|f |d|f |d|f |d|f ||j ||j	 ||j	 ||j	 || ||  }|| t
|d  }|d t|| k r || dt|d  d ||< | jd||| ddddd qR|||}|j|ddd}| | | d | d | jdddd | jddddd dS ) a          Draws brackets that represent groups of genes on the give axis.
        For best results, this axis is located on top of an image whose
        x axis contains gene names.

        The gene_groups_ax should share the x axis with the main ax.

        Eg: gene_groups_ax = fig.add_subplot(axs[0, 0], sharex=dot_ax)

        Parameters
        ----------
        gene_groups_ax
            In this axis the gene marks are drawn
        group_positions
            Each item in the list, should contain the start and end position that the
            bracket should cover.
            Eg. [(0, 4), (5, 8)] means that there are two brackets, one for the var_names (eg genes)
            in positions 0-4 and other for positions 5-8
        group_labels
            List of group labels
        left_adjustment
            adjustment to plot the bracket start slightly before or after the first gene position.
            If the value is negative the start is moved before.
        right_adjustment
            adjustment to plot the bracket end slightly before or after the last gene position
            If the value is negative the start is moved before.
        rotation
            rotation degrees for the labels. If not given, small labels (<4 characters) are not
            rotated, otherwise, they are rotated 90 degrees
        orientation
            location of the brackets. Either `top` or `right`
        Returns
        -------
        None
        r   N)Pathc                    s   g | ]}|d    qS )r   rV   r   )r   rV   rW   r     s     z6BasePlot._plot_var_groups_brackets.<locals>.<listcomp>c                    s   g | ]}|d    qS )r   rV   r   )r   rV   rW   r     s     ru   c                 S   s   g | ]}t |qS rV   )r5   r   rV   rV   rW   r     s        r   g333333?r   g?r   r   )r   r   r   g?.rv   i  r   )r   r   r   r   noner   )Z	facecolorZlwFr   y)r   r   Z	labelleftr   )r   r   ZlabelbottomZlabeltop)Zmatplotlib.patchesr   Zmatplotlib.pathr   r   	enumeratezipr   ZMOVETOZLINETOfloattextr5   intZ	PathPatchZ	add_patchr   r   r   )r   r   r   r   r   r   rx   r   r   r   rv   Zvertscodesr   Z	left_coorZ
right_coorZgroup_x_centerru   r   Ztop_coorZbottom_coordiffZgroup_y_centerpathpatchrV   )r   r   rW   r     s    -
 	 





   z"BasePlot._plot_var_groups_bracketsc                 C   s   t | jtjr| jrtd g }g }g }d}| j D ]V\}}t |trP|g}|	t
| || |||t| d f |t|7 }q8|| _|| _|| _d| _nt | jtr| jg| _dS )a  
        checks if var_names is a dict. Is this is the cases, then set the
        correct values for var_group_labels and var_group_positions

        updates var_names, var_group_labels, var_group_positions

        Returns
        -------
        None

        zp`var_names` is a dictionary. This will reset the current values of `var_group_labels` and `var_group_positions`.r   r   TN)rA   r   cabcr   r6   r=   rd   itemsr   r   r@   r   r5   r)   r(   )rU   r)   r   r(   startlabelZ	vars_listrV   rV   rW   r7     s,    

zBasePlot._update_var_groups)NFr   NNNNNNNNNNNNN)T)TNr\   )TNr\   N)N)r   )r   r   Nru   )0__name__
__module____qualname____doc__ZDEFAULT_SAVE_PREFIXrN   r[   rZ   rL   rH   rF   rD   r:   r	   r   	_VarNamesr   r   r   r   boolr   r   r   r   r   rX   rY   rh   r   r   rn   rp   rq   rt   r
   r   r   r   r   rr   r]   r   re   staticmethodr   r   r7   rV   rV   rV   rW   r   -   s                   

e   R    B, P( %#\    }r   ).r   collections.abcabcr   collectionsr   typingr   r   r   r   r   r   numpyrf   Zanndatar	   Zmatplotlib.axesr
   r   r   r   r   Zmatplotlib.colorsr   warningsr   r   r   r=   Z_compatr   _utilsr   r   r   r   Z_anndatar   r   r   r   r   Zdoc_common_groupby_plot_argsobjectr   rV   rV   rV   rW   <module>   s(   