anndict.annotate.kappa_adata

Contents

anndict.annotate.kappa_adata#

anndict.annotate.kappa_adata(adata, cols)[source]#

Calculate pairwise Cohen’s Kappa, average pairwise Kappa, and Fleiss’ Kappa for categorical data in adata.obs[cols].

Parameters:
adata AnnData

An AnnData object.

cols list[str]

List of columns in adata.obs to use for calculating agreement.

Return type:

dict

Returns:

dict A dictionary with the following keys:

  • pairwise: A dictionary with pairwise Cohen’s Kappa values.

  • average_pairwise: A dictionary with the average pairwise Kappa for each rater.

  • fleiss: The Fleiss’ Kappa value for the overall agreement across all raters.