Generate factorized matrices showing each feature's influence on the celda_G model clustering

# S3 method for celda_G
factorizeMatrix(counts, celda.mod, type = c("counts",
  "proportion", "posterior"))

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_G".

type

Character vector. A vector containing one or more of "counts", "proportion", or "posterior". "counts" returns the raw number of counts for each factorized matrix. "proportions" returns the normalized probabilities for each factorized matrix, which are calculated by dividing the raw counts in each factorized matrix by the total counts in each column. "posterior" returns the posterior estimates. Default `c("counts", "proportion", "posterior")`.

Examples

celda.sim = simulateCells("celda_G") celda.mod = celda_G(celda.sim$counts, L=celda.sim$L)
#> --------------------------------------------------------------------
#> Starting Celda_G: Clustering genes.
#> --------------------------------------------------------------------
#> Thu Sep 06 12:56:57 2018 .. Initializing chain 1 with 'random' (seed=12345)
#> Thu Sep 06 12:56:57 2018 .... Completed iteration: 1 | logLik: -291426.665356919
#> Thu Sep 06 12:56:57 2018 .... Completed iteration: 2 | logLik: -286595.332370062
#> Thu Sep 06 12:56:57 2018 .... Completed iteration: 3 | logLik: -286579.864858824
#> Thu Sep 06 12:56:57 2018 .... Completed iteration: 4 | logLik: -286579.864858824
#> Thu Sep 06 12:56:57 2018 .... Completed iteration: 5 | logLik: -286579.864858824
#> Thu Sep 06 12:56:57 2018 .... Completed iteration: 6 | logLik: -286579.864858824
#> Thu Sep 06 12:56:57 2018 .... Completed iteration: 7 | logLik: -286579.864858824
#> Thu Sep 06 12:56:57 2018 .... Completed iteration: 8 | logLik: -286579.864858824
#> Thu Sep 06 12:56:57 2018 .... Completed iteration: 9 | logLik: -286579.864858824
#> Thu Sep 06 12:56:57 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:56:58 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:58 2018 .... Completed iteration: 10 | logLik: -286579.864858824
#> Thu Sep 06 12:56:58 2018 .... Completed iteration: 11 | logLik: -286579.864858824
#> Thu Sep 06 12:56:58 2018 .... Completed iteration: 12 | logLik: -286579.864858824
#> Thu Sep 06 12:56:58 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:56:58 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:58 2018 .... Completed iteration: 13 | logLik: -286579.864858824
#> Thu Sep 06 12:56:58 2018 .. Finished chain 1 with seed 12345
#> Thu Sep 06 12:56:58 2018 .. Initializing chain 2 with 'random' (seed=12346)
#> Thu Sep 06 12:56:59 2018 .... Completed iteration: 1 | logLik: -287718.041765169
#> Thu Sep 06 12:56:59 2018 .... Completed iteration: 2 | logLik: -286579.864858824
#> Thu Sep 06 12:56:59 2018 .... Completed iteration: 3 | logLik: -286579.864858824
#> Thu Sep 06 12:56:59 2018 .... Completed iteration: 4 | logLik: -286579.864858824
#> Thu Sep 06 12:56:59 2018 .... Completed iteration: 5 | logLik: -286579.864858824
#> Thu Sep 06 12:56:59 2018 .... Completed iteration: 6 | logLik: -286579.864858824
#> Thu Sep 06 12:56:59 2018 .... Completed iteration: 7 | logLik: -286579.864858824
#> Thu Sep 06 12:56:59 2018 .... Completed iteration: 8 | logLik: -286579.864858824
#> Thu Sep 06 12:56:59 2018 .... Completed iteration: 9 | logLik: -286579.864858824
#> Thu Sep 06 12:56:59 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:56:59 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:59 2018 .... Completed iteration: 10 | logLik: -286579.864858824
#> Thu Sep 06 12:56:59 2018 .... Completed iteration: 11 | logLik: -286579.864858824
#> Thu Sep 06 12:56:59 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:57:00 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 12 | logLik: -286579.864858824
#> Thu Sep 06 12:57:00 2018 .. Finished chain 2 with seed 12346
#> Thu Sep 06 12:57:00 2018 .. Initializing chain 3 with 'random' (seed=12347)
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 1 | logLik: -290090.898941072
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 2 | logLik: -286579.864858824
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 3 | logLik: -286579.864858824
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 4 | logLik: -286579.864858824
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 5 | logLik: -286579.864858824
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 6 | logLik: -286579.864858824
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 7 | logLik: -286579.864858824
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 8 | logLik: -286579.864858824
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 9 | logLik: -286579.864858824
#> Thu Sep 06 12:57:00 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:57:00 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 10 | logLik: -286579.864858824
#> Thu Sep 06 12:57:00 2018 .... Completed iteration: 11 | logLik: -286579.864858824
#> Thu Sep 06 12:57:00 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:57:01 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:01 2018 .... Completed iteration: 12 | logLik: -286579.864858824
#> Thu Sep 06 12:57:01 2018 .. Finished chain 3 with seed 12347
#> --------------------------------------------------------------------
#> Completed Celda_G. Total time: 3.597956 secs
#> --------------------------------------------------------------------
factorized.matrices = factorizeMatrix(celda.sim$counts, celda.mod, "posterior")