addResultsToSingleCellExperiment {slalom} | R Documentation

## Add results to SingleCellExperiment object

### Description

Add results to SingleCellExperiment object

### Usage

    addResultsToSingleCellExperiment(sce_object, slalom_object, n_active = 20,
      mad_filter = 0.4, annotated = TRUE, unannotated_dense = FALSE,
      unannotated_sparse = FALSE, add_loadings = TRUE, dimred = "slalom",
      check_convergence = TRUE)

### Arguments

`sce_object` | an object of class `SingleCellExperiment`
`slalom_object` | an object of class `Rcpp_SlalomModel`
`n_active` | number of terms (factors) to be added (default is 20)
`mad_filter` | numeric(1), filter factors by this mean absolute deviation to ensure variability in the factor states. For large datasets this can be set to 0
`annotated` | logical(1), should annotated factors be included? Default is `TRUE`
`unannotated_dense` | logical(1), should dense unannotated factors be included? Default is `FALSE`
`unannotated_sparse` | logical(1), should sparse unannotated factors be included? Default is `FALSE`
`add_loadings` | logical(1), should gene/feature loadings be added to the `rowData` of the object?
`dimred` | character(1), name of the reduced-dimension slot to save the factor states to. Default is `"slalom"`
`check_convergence` | logical(1), check that model has converged before adding `slalom` results. If `TRUE` and model has not converged it throws an error.

### Value

a `SingleCellExperiment` object with factor states (X) in a reduced-dimension slot, and gene loadings for factors added to `rowData`.

### 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)
    model <- trainSlalom(model, nIterations = 10)
    mesc <- addResultsToSingleCellExperiment(mesc, model,
    check_convergence = FALSE)

[Package slalom version 1.9.0 Index]