compGoM {CountClust}R Documentation

compGoM: compare GoM model fits across K or across different runs through log-likelihood, BIC and null loglikelihood

Description

This function takes the FitGoM/maptpx fitted model and computes log likelihood, BIC and null model loglikelihood for the fitted GoM models.

Usage

compGoM(data, model)

Arguments

data

matrix on which GoM model is fitted (samples along rows, genes along columns)

model

FitGoM ormaptpx::topics function output (either a class topics or a list of class topics).

Value

compGoM_models a vector list that returns the BIC and loglikelihood values for each of the fitted models in model.

Examples


read.data <- function() {
  x <- tempfile()
  download.file(paste0("https://cdn.rawgit.com/kkdey/",
                         "singleCellRNASeqMouseDeng2014",
                         "/master/data/Deng2014MouseEsc.rda"),
                destfile = x, quiet = TRUE)
  z <- get(load((x)))
  return(z)
  }
Deng2014MouseESC <-read.data()

# Extract observed counts
deng.counts <- Biobase::exprs(Deng2014MouseESC)

# Import GoM fitting results
data("MouseDeng2014.FitGoM")
names(MouseDeng2014.FitGoM)

compGoM(data = t(deng.counts),
           model = MouseDeng2014.FitGoM)
compGoM(data = t(deng.counts),
           model = MouseDeng2014.FitGoM$clust_3)


[Package CountClust version 1.23.1 Index]