train_model: Train a Celmod model

View source: R/train_model.r

train_modelR Documentation

Train a Celmod model

Description

This function builds the paired bulk-single cell proportion model from input data, and returns the model object for prediction on new bulk data.

Usage

train_model(
  bdat,
  classprops,
  numgenevec = 3:10,
  crossval_times = 5,
  seedval = 1,
  method_type = "pearson",
  quantileval = 0.9,
  alphavals = seq(from = 0, to = 1, length.out = 11)
)

Arguments

bdat

Matrix of bulk data, with features (genes, proteins, metabolites) as rows and samples as columns.

classprops

Matrix of cell type proportions, with each cell type as a row, and each sample as column. The sample ordering must match those in the bdat bulk matrix.

numgenevec

A vector with range of the number of best-fit features to optimize the model over. Usually 10-20 features is sufficient to model ~10 different cell types

Value

outlist A list containing the following arrays: "cv_preds" with the cross-validation predictions for each value of the numgenevec or alphavals parameter, "cv_errs" with the cross-validation errors for each value of the numgenevec or alphavals parameter, "numgenevec" with the range of best-fit features tested, "cv_bestgenes" with the top features selected for each value of the numgenevec or alphavals parameter, "model" for the trained model, and "modelgenerank" for the final ranking of features used in the model trained on the full data


MenonLab/Celmod documentation built on April 24, 2022, 4:56 p.m.