scib.metrics.kBET
- scib.metrics.kBET(adata, batch_key, label_key, scaled=True, embed='X_pca', type_=None, return_df=False, verbose=False)
kBET score
Compute the average of k-nearest neighbour batch effect test (kBET) score per label.
- Parameters
adata – anndata object to compute kBET on
batch_key – name of batch column in adata.obs
label_key – name of cell identity labels column in adata.obs
scaled – whether to scale between 0 and 1 with 0 meaning low batch mixing and 1 meaning optimal batch mixing if scaled=False, 0 means optimal batch mixing and 1 means low batch mixing
- Returns
kBET score (average of kBET per label) based on observed rejection rate. If
return_df=True
, also return apd.DataFrame
with kBET observed rejection rate per cluster