anndict.plot.plot_model_agreement#
- anndict.plot.plot_model_agreement(adata, group_by, sub_group_by, agreement_cols, granularity=2, legend=False)[source]#
Plots the average values of specified agreement columns across varying levels of granularity. See notes for which columns are ignored based on the granularity setting.
- Parameters:
- adata
AnnData an
AnnData.- group_by
str Column name in
adata.obsfor the main grouping (e.g.,'cell_type').- sub_group_by
str Column name in
adata.obsfor the sub-grouping (e.g.,'tissue').- agreement_cols
list[str] Column names specifying the agreement columns (e.g.,
['agreement_of_manual_with_model1', 'agreement_of_manual_with_model2']).- granularity
int(default:2) Level of detail in the plot (
0= models only,1= models within cell types,2= models within cell types and tissues).- legend
bool(default:False) If
Trueand ifgranularity=2, adds a legend forsub_group_by.
- adata
- Return type:
tuple[Figure,Axes] |ClusterGrid- Returns:
The plot of agreement, averaged according to the
granularitysetting.
Notes
If granularity is 0,
group_byandsub_group_byare not used. If granularity is 1,sub_group_byis not used.Examples
import anndict as adt adt.plot_model_agreement(adata, 'cell_type', 'tissue', ['agreement_of_manual_with_model1', 'agreement_of_manual_with_model2'], granularity=0)