monkeybread.plot.cell_contact_histplot
- monkeybread.plot.cell_contact_histplot(adata, groupby, contacts, expected_contacts, show=True, ax=None, **kwargs)
Plots a histogram highlighting the observed cell contact compared to permutations.
Uses the results of
monkeybread.calc.cell_contact()andmonkeybread.stat.cell_contact().Creates a histogram displaying the distribution of contacts from the permutation test with a line indicating the actual distribution of contact counts.
- Parameters
adata (
AnnData) – Annotated data matrix.groupby (
str) – A column inadata.obsto group cells by.contacts (
Dict[str,Set[str]]) – The actual cell contacts, as calculated bymonkeybread.calc.cell_contact().expected_contacts (
Tuple[ndarray,float]) – The expected cell contacts, as calculated bymonkeybread.stat.cell_contact().show (
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
seaborn.histplot.
- Return type
- Returns
If
show = True, returns nothing. Otherwise, returns the Axes object the plot is contained within.