theislab/scib

Metrics fail when there are unused labels

Opened this issue · 1 comments

Some of the metrics fail if adata.obs[label_key] is categorical and contains categories that aren't used. Can probably be fixed fairly easily by adding a adata.obs[label_key] = adata.obs[label_key].cat.remove_unused_categories(), changing how the present labels are calculated or doing something else to avoid this situation.

The same happens also if one of the labels is not present in one of the batches. Would be helpful to return a user error with description of the problem or subsetting as proposed by @lazappi