Assigns the label that most neighbors have, given it is more than
min_knn_prob
.
I've found empirically on the MALT data that min_knn_prob=0.5
gives
good results, whether you classify the entire data set or just a single
cell type.
It simply excludes some of the cells that have more than 2 cell types in their
neighborhood and none is much stronger than the others,
so this is a reasonable, conservative filtering.
knn_refine(labels, neighbors, min_knn_prob = 0.5)
Character vector with refined labels.
Cell type labels as character or factor.
Neighbor graph, pass obj$neighbors
.
Value between 0 and 1, defaults to 0.5. If the 'winning label' is below this proportion of kNN that have it, knn_refine will return "Unassigned".