Skip to contents

This function infers cell labels using a trained model and updates the input dataset with the inferred labels.

Usage

viewmastR_infer(
  query_cds,
  model_path,
  vg,
  query_celldata_col = "viewmastR_inferred",
  labels = NULL,
  verbose = T,
  return_probs = F,
  return_type = c("object", "list")
)

Arguments

query_cds

Seurat or cell_data_set object - The dataset for which cell labels are to be inferred.

model_path

character path to the trained model file.

vg

character vector - Features used for inference (must be the same used during model creation).

query_celldata_col

character vector - names of the column to store inferred cell labels in the query dataset. Default is "viewmastR_inferred".

labels

character vector - optional labels corresponding to the class indices. Default is NULL.

verbose

bool - show messaging

return_probs

logical If TRUE, returns the class probabilities. Default is FALSE.

Value

If return_probs is TRUE, returns a data frame containing class probabilities. If return_probs is FALSE, updates the query_cds object with inferred cell labels and returns it.