initSlalom {slalom} | R Documentation

## Initialize a SlalomModel object

### Description

Initialize a SlalomModel with sensible starting values for parameters before training the model.

### Usage

    initSlalom(object, alpha_priors = NULL, epsilon_priors = NULL,
      noise_model = "gauss", seed = NULL, pi_prior = NULL, n_hidden = NULL,
      design = NULL, verbose = FALSE, save_init = FALSE)

### Arguments

`object` | a `Rcpp_SlalomModel` object
`alpha_priors` | numeric(2) giving alpha and beta hyperparameters for a gamma prior distribution for alpha parameters (precision of factor weights)
`epsilon_priors` | numeric(2) giving alpha and beta hyperparameters for a gamma prior distribution for noise precision parameters
`noise_model` | character(1) defining noise model, defaults to "gauss" for Gaussian noise model
`seed` | integer(1) value supplying a random seed to make results reproducible (default is `NULL`)
`pi_prior` | numeric matrix (genes x factors) giving prior probability of a gene being active for a factor
`n_hidden` | integer(1), number of hidden factors in model. Required if `pi_prior` is not `NULL`, ignored otherwise.
`design` | matrix of known factors (covariates) to fit in the model. Optional if `pi_prior` is not `NULL`, ignored otherwise.
`verbose` | logical(1), should messages be printed about what the function is doing? Default is `TRUE`.
`save_init` | logical(1), save the initial X values (factor states for each cell) in the object? Default is `FALSE` as this is potentially a large N (number of cell) by K (number of factors) matrix.

### Details

It is strongly recommended to use `newSlalomModel` to create the `SlalomModel` object prior to applying `initSlalom`.

### Value

an 'Rcpp_SlalomModel' object

### Author(s)

Davis McCarthy

### Examples

    gmtfile <- system.file("extdata", "reactome_subset.gmt", package = "slalom")
    genesets <- GSEABase::getGmt(gmtfile)
    data("mesc")
    model <- newSlalomModel(mesc, genesets, n_hidden = 5, min_genes = 10)
    model <- initSlalom(model)

[Package slalom version 1.4.1 Index]