monkeybread.plot.ligand_receptor_score_barplot_per_niche
- monkeybread.plot.ligand_receptor_score_barplot_per_niche(niche_to_lr_to_score, lr_pair, plot_niches=None, ax=None, title=None, show=True, **barplot_kwargs)
Create a barplot showing the ligand/receptor score for a specific ligand/receptor pair within each niche. This function plots the data returned by
monkeybread.calc.ligand_receptor_score_per_niche().- Parameters:
niche_to_lr_to_score (
Dict[str,Dict[Tuple[str,str],float]]) – A dictionary mapping each niche to a sub-dictionary mapping each ligand/receptor (represented as a tuple) to its score in that niche. This data structure is returned bymonkeybread.calc.ligand_receptor_score_per_niche()lr_pair (
List[Tuple[str,str]]) – Specific ligand/receptor pair to plotplot_niches (
Optional[List[str]] (default:None)) – Specific niches to plot. IfNone, all niches will be plottedshow (
Optional[bool] (default:True)) – IfTrue, show the plot. IfFalsereturn the Axes object the plot is contained withinbarplot_kwargs – Arguments passed to
seaborn.barplot()
- Return type:
- Returns:
: If
show = True, returns nothing. Otherwise, returns the Axes object the plot is contained within.
Example