Generate factorized matrices showing each feature's influence on cell / gene clustering

factorizeMatrix(counts, celda.mod, type)

Arguments

counts

Integer matrix. Rows represent features and columns represent cells. This matrix should be the same as the one used to generate `celda.mod`.

celda.mod

Celda object of class "celda_C", "celda_G", or "celda_CG".

type

A character vector containing one or more of "counts", "proportions", or "posterior". "counts" returns the raw number of counts for each entry in each matrix. "proportions" returns the counts matrix where each vector is normalized to a probability distribution. "posterior" returns the posterior estimates which include the addition of the Dirichlet concentration parameter (essentially as a pseudocount).

Examples

celda.sim = simulateCells("celda_CG") celda.mod = celda_CG(celda.sim$counts, K=celda.sim$K, L=celda.sim$L, nchains=1, max.iter=1)
#> --------------------------------------------------------------------
#> Starting Celda_CG: Clustering cells and genes.
#> --------------------------------------------------------------------
#> Thu Sep 06 12:57:01 2018 .. Initializing chain 1 with 'random' (seed=12345)
#> Thu Sep 06 12:57:01 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:57:01 2018 .... Cluster 4 was reassigned and cluster 3 was split in two.
#> Thu Sep 06 12:57:01 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:57:01 2018 .... Cluster 2 was reassigned and cluster 9 was split in two.
#> Thu Sep 06 12:57:01 2018 .... Completed iteration: 1 | logLik: -1272652.93151523
#> Thu Sep 06 12:57:01 2018 .. Finished chain 1 with seed 12345
#> --------------------------------------------------------------------
#> Completed Celda_CG. Total time: 0.5226991 secs
#> --------------------------------------------------------------------
factorized.matrices = factorizeMatrix(celda.sim$counts, celda.mod, "posterior")