monkeybread.plot.ligand_receptor_score_heatmap_per_niche
- monkeybread.plot.ligand_receptor_score_heatmap_per_niche(niche_to_lr_to_score, lr_pairs=None, plot_niches=None, z_score=True, clip_z=2.0, show=True, **clustermap_kwargs)
Create a heatmap showing the ligand/receptor scores for a specific set of ligand/receptor pairs within each niche. The rows represent ligand/receptors and the columns represent niches. 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_pairs (
Optional[List[Tuple[str,str]]] (default:None)) – Specific set of ligand/receptor pairs to plot. IfNone, all ligand/receptor pairs in theniche_to_lr_to_scoredata structure will be plottedplot_niches (
Optional[List[str]] (default:None)) – Specific niches to plot. IfNone, all niches will be plottedz_score (
Optional[List[str]] (default:True)) – IfTrueplot the z-score normalized ligand-receptor scores, where the scores are normalized for each ligand/receptor pairs accross all nichesclip_z (
Optional[float] (default:2.0)) – Ifz_scoreis True, this clips the plotted z-score values at +/-clip_zshow (
Optional[bool] (default:True)) – IfTrue, show the plot. IfFalsereturn the ClusterGrid object output byseaborn.clustermap()clustermap_kwargs – Arguments passed to
seaborn.clustermap()
- Return type:
Optional[ClusterGrid]- Returns:
: If
show = True, returns nothing. Otherwise, returns the ClusterGrid object output byseaborn.clustermap()
Example