knnPredict: Predict annotations of query cells from the reference using...

View source: R/utils.R

knnPredictR Documentation

Predict annotations of query cells from the reference using k-NN method

Description

Predict annotations of query cells from the reference using k-NN method

Usage

knnPredict(
  query_obj,
  ref_obj,
  train_labels,
  k = 5,
  save_as = "cell_type_pred_knn",
  confidence = TRUE,
  seed = 0
)

Arguments

query_obj

Symphony query object

ref_obj

Symphony reference object

train_labels

vector of labels to train

k

number of neighbors

save_as

string that result column will be named in query metadata

confidence

return k-NN confidence scores (proportion of neighbors voting for the predicted annotation)

seed

random seed (k-NN has some stochasticity in the case of ties)

Value

Symphony query object, with predicted reference labels stored in the 'save_as' slot of the query$meta_data


symphony documentation built on Jan. 17, 2023, 1:13 a.m.