anndict.wrappers.ensure_label_consistency_adata_dict#
- anndict.wrappers.ensure_label_consistency_adata_dict(adata, cols, simplification_level='unified, typo-fixed', new_col_prefix='consistent')[source]#
Wrapper function to ensure label consistency across specified columns in an
AnnData
object.- Parameters:
- adata
AnnData
An
AnnData
object.- cols
list
[str
] List
of column names inadata.obs
to ensure label consistency.- simplification_level
str
(default:'unified, typo-fixed'
) Qualitative direction about how to process the labels.
- new_col_prefix
str
(default:'consistent'
) Prefix to use when creating new columns in
adata.obs
. Settingnew_col_prefix = ""
would overwrite the original columns.
- adata
- Return type:
dict
- Returns:
Dict
mapping original labels to the unified set of labels.
Notes
Updates
adata
in-place with a shared set of labels labels inadata.obs[new_col_prefix + cols]
.Useful when calculating inter-rater reliability. To calculate measures of inter-rater reliability, see below:
See also
kappa_adata()
To calculate both Cohen’s and Fleiss’s Kappa, a measure of inter-rater reliability.
krippendorff_alpha_adata()
To calculate Krippendorff’s Alpha, a measure of inter-rater reliability.