anndict.plot.plot_model_agreement_categorical#
- anndict.plot.plot_model_agreement_categorical(adata, group_by, sub_group_by, agreement_cols, granularity=2)[source]#
Plots the relative proportions of categories within specified model columns across varying levels of granularity.
- Parameters:
- adata
AnnData An
AnnData.- group_by
str key in
adata.obsfor the main grouping (e.g.,'cell_type').- sub_group_by
str key in
adata.obsfor the sub-grouping (e.g.,'tissue').- agreement_cols
list[str] Column names specifying the agreement columns (e.g.,
['categorical_agreement_of_manual_with_model1', 'categorical_agreement_of_manual_with_model2']). These should be categorical.- 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).
- adata
- Return type:
tuple[Figure,Axes] |FacetGrid|Figure- Returns:
The plot of agreement, averaged according to the
granularitysetting, split by quality of agreement.
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_categorical(adata, 'cell_type', 'tissue', ['agreement_of_manual_with_model1', 'agreement_of_manual_with_model2'], granularity=0)