Teichlab / celltypist

A tool for semi-automatic cell type classification
https://www.celltypist.org/
MIT License
254 stars 40 forks source link

KeyError when insert conf of majority_voting under `porb match` mode #84

Closed songmingl closed 9 months ago

songmingl commented 9 months ago

https://github.com/Teichlab/celltypist/blob/dd7e6a5c7107a1a070389df7830cc215f89da66c/celltypist/classifier.py#L116

under prob match mode, some cells may be assigned to Unassigned, which is not present in probability_matrix. This will lead to a keyerror below:

KeyError: 'Unassigned'

Maybe use the max probability or just return a nan for these unassigned labels?

ChuanXu1 commented 9 months ago

@songmingl, thank you for pointing out this. Will fix this soon.

ChuanXu1 commented 9 months ago

This should be solved in the new version (1.6.1). Please reopen the issue if you have further questions.