compGoM: compGoM: compare GoM model fits across K or across different...

Description Usage Arguments Value Examples

View source: R/compGoM.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
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)

kkdey/CountClust documentation built on Jan. 17, 2021, 5:32 p.m.