classify putative cell types by given classifier.
predictCelltypes(classifier, data, prob = FALSE)
a gknn classifier exported by buildClassifier.
A data.frame, containing features for gknn prediction.
character specifying the return the class distribution for all k neighbors considered.
A list with celltype factors for each cell and the probability.
data(iris)
iris[, 1:4] <- apply(iris[, 1:4], 2, function(.ele){
(.ele-min(.ele))/max(.ele)
})
classifier <- buildClassifier(iris, colnames(iris)[1:4], iris$Species)
predictCelltypes(classifier, iris[c(1, 51, 101), ])
#> $celltypes
#> 1 51 101
#> setosa versicolor virginica
#> Levels: setosa versicolor virginica
#>
#> $prob
#> NULL
#>