Skip to contents

Function that gives models trained to differentiate all pairwise matchups.

Usage

GetModels(
  marker_genes,
  ref_bpcells,
  ref_metadata,
  tree,
  metadata_cluster_column = "cluster_label",
  metadata_cell_id_column = "cell_label",
  n_cells_sampled = 500,
  models_to_include = NULL,
  npcs = 5
)

Arguments

marker_genes

List with marker genes returned by the FindMarkerGenes function.

ref_bpcells

BPCells obj with reference dataset GE values

ref_metadata

Dataframe with metadata on each cell in reference dataset.

tree

Tree structure in treedata format.

metadata_cluster_column

Metadata celltype label column.

metadata_cell_id_column

Metadata cell ID column

n_cells_sampled

Number of cells used in pairwise model determination for each class.

models_to_include

Optional vector which provides the names of models to include. If using this parameter, include a subset of the following (make sure the names match or it won't work): "linear_svm", "polynomial_svm", "naive_bayes", "ridge", "lasso", "elastic_net", "linear_da", "knn", "rf", "quadratic_da"

npcs

Optional parameter giving number of PCs to use in model creation.

Value

List of models that differentiates each pairwise matchup.

Examples

GetModels(marker_genes, ref_bpcells, ref_metadata, tree,
metadata_cluster_column = "cluster_label",
metadata_cell_id_column = "cell_label",
n_cells_sampled = 500, models_to_include = NULL, npcs = 5)
#> ── Error: ref_metadata is a dataframe (not a tibble) ───────────────────────────
#> Error in `eval(expr, envir, enclos)`: object 'ref_metadata' not found
#> Backtrace:
#>     
#>  1. ├─testthat::expect_true(is.data.frame(ref_metadata) & !is.tbl(ref_metadata))
#>  2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
#>  3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
#>  4. └─base::is.data.frame(ref_metadata)
#> 
#> Error: Test failed