Yields assigments of genes/cells to clusters, depending on the provided model type.

celdaGridSearch(counts, model, params.test, params.fixed = NULL,
  max.iter = 200, nchains = 3, cores = 1, best.only = TRUE,
  seed = 12345, verbose = TRUE, logfile.prefix = "Celda")

Arguments

counts

A count matrix.

model

Celda model. Options available in `celda::available.models`.

params.test

List. A list denoting the combinations of parameters to run in a celda model. For example, "list(K=5:10, L=15:20)" will run all combinations of K from 5 to 10 and L from 15 to 20 in model 'celda_CG'.

params.fixed

List. A list denoting additional parameters to use in each celda model. Default NULL.

max.iter

Integer. Maximum number of iterations of Gibbs sampling to perform. Default 200.

nchains

Integer. Number of random cluster initializations. Default 1.

cores

Integer. The number of cores to use for parallel Gibbs sampling. Default 1.

best.only

Logical. Whether to return only the chain with the highest log likelihood per combination of parameters or return all chains. Default TRUE.

seed

Integer. Passed to set.seed(). Default 12345.

verbose

Logical. Whether to print log messages during celda chain execution. Default TRUE.

logfile.prefix

Character. Prefix for log files from worker threads and main process. Default "Celda".

Value

Object of class "celda_list", which contains results for all model parameter combinations and summaries of the run parameters

Examples

## Simulate a small dataset with 5 cell clusters and 10 feature modules celda.sim = simulateCells(model="celda_CG", K=5, L=10, G=100) ## Run various combinations of parameters with 'celdaGridSearch' cgs = celdaGridSearch(celda.sim$counts, model="celda_CG", params.test=list(K=4:6, L=9:11), params.fixed=list(sample.label=celda.sim$sample.label), best.only=TRUE, nchains=1)
#> --------------------------------------------------------------------
#> Starting celdaGridSearch with celda_CG
#> Number of cores: 1
#> --------------------------------------------------------------------
#> Error in { current.run = c(run.params[i, ]) chain.params = list() for (j in names(params.test)) { chain.params[[j]] = current.run[[j]] } chain.params$counts = counts chain.params$seed = all.seeds[ifelse(i%%nchains == 0, nchains, i%%nchains)] chain.params$max.iter = max.iter chain.params$nchain = 1 chain.params$count.checksum = count.checksum chain.params$verbose = verbose chain.params$logfile = paste0(logfile.prefix, "_", paste(paste(colnames(run.params), run.params[i, ], sep = "-"), collapse = "_"), "_Seed-", chain.params$seed, "_log.txt") res = do.call(model, c(chain.params, params.fixed)) return(list(res))}: task 1 failed - "unused argument (gamma)"