Skip to contents

This function runs viewmastR using the new Rust implementation to generate various forms of training and test data from the given query and reference cell data sets.

Usage

viewmastR(
  query_cds,
  ref_cds,
  ref_celldata_col,
  query_celldata_col = NULL,
  FUNC = c("mlr", "nn", "nb"),
  norm_method = c("log", "binary", "size_only", "none"),
  selected_genes = NULL,
  train_frac = 0.8,
  tf_idf = F,
  scale = F,
  hidden_layers = c(500, 100),
  learning_rate = 0.001,
  max_epochs = 10,
  LSImethod = 1,
  verbose = T,
  backend = c("wgpu", "nd", "candle"),
  threshold = NULL,
  keras_model = NULL,
  dir = "/tmp/sc_local",
  return_probs = F,
  return_type = c("object", "list"),
  debug = F,
  ...
)

Arguments

query_cds

A cell data set (cds) to query.

ref_cds

A reference cell data set (cds).

ref_celldata_col

The column in the reference cell data set containing cell data.

query_celldata_col

The column in the query cell data set containing cell data. Defaults to "viewmastR_pred" if not provided.

FUNC

The machine learning model to use (multinomial linear regression - 'mlr' or multilayer neural network - 'nn'). Default is "mlr".

norm_method

The normalization method to use. Options are "log", "binary", "size_only", or "none".

selected_genes

A vector of pre-selected genes for analysis. If NULL, common features between reference and query are used.

train_frac

The fraction of data to use for training. Default is 0.8.

tf_idf

Boolean indicating whether to perform TF-IDF transformation. Default is FALSE.

scale

Boolean indicating whether to scale the data. Default is FALSE.

hidden_layers

A vector specifying the number of neurons in hidden layers for neural network models. Default is c(500, 100). To use one hidden layer supply a vector of length 1.

learning_rate

The learning rate for training the model. Default is 1e-3.

max_epochs

The maximum number of epochs for training the model. Default is 10.

LSImethod

The method for Latent Semantic Indexing. Default is 1.

verbose

Boolean indicating whether to display verbose output. Default is TRUE.

dir

The directory to save output files. Default is "/tmp/sc_local".

return_type

The type of output to return. Options are "object" or "list". Default is "object".

debug

Run in debug mode

...

Additional arguments.

Value

If return_type is "object", returns the modified query cell data set or seurat object. If return_type is "list", returns a list containing the query cell data set and training output.