Calculates the conditional probability of each cell belong to each cluster given all other cluster assignments

# S3 method for celda_C
clusterProbability(counts, celda.mod, log = FALSE, ...)

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

log

Logical. If FALSE, then the normalized conditional probabilities will be returned. If TRUE, then the unnormalized log probabilities will be returned. Default FALSE.

...

Additional parameters.

Value

A list containging a matrix for the conditional cell cluster probabilities.

Examples

celda.sim = simulateCells("celda_C") celda.mod = celda_C(celda.sim$counts, K=celda.sim$K)
#> --------------------------------------------------------------------
#> Starting Celda_C: Clustering cells.
#> --------------------------------------------------------------------
#> Thu Sep 06 12:56:32 2018 .. Initializing chain 1 with 'random' (seed=12345)
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 1 | logLik: -1403838.03777873
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 2 | logLik: -1400194.39761642
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 3 | logLik: -1377050.9603928
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 4 | logLik: -1377050.9603928
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 5 | logLik: -1377050.9603928
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 6 | logLik: -1377050.9603928
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 7 | logLik: -1377050.9603928
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 8 | logLik: -1377050.9603928
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 9 | logLik: -1377050.9603928
#> Thu Sep 06 12:56:32 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:32 2018 .... Cluster 1 was reassigned and cluster 4 was split in two.
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 10 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 11 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 12 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 13 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 14 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 15 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 16 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 17 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 18 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:32 2018 .... Completed iteration: 19 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:32 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:33 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 20 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .. Finished chain 1 with seed 12345
#> Thu Sep 06 12:56:33 2018 .. Initializing chain 2 with 'random' (seed=12346)
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 1 | logLik: -1383993.83150535
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 2 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 3 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 4 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 5 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 6 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 7 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 8 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 9 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:33 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 10 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 11 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:33 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 12 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .. Finished chain 2 with seed 12346
#> Thu Sep 06 12:56:33 2018 .. Initializing chain 3 with 'random' (seed=12347)
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 1 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 2 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 3 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 4 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 5 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 6 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 7 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 8 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 9 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:33 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 10 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:33 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:33 2018 .... Completed iteration: 11 | logLik: -1358078.99551138
#> Thu Sep 06 12:56:33 2018 .. Finished chain 3 with seed 12347
#> --------------------------------------------------------------------
#> Completed Celda_C. Total time: 1.213308 secs
#> --------------------------------------------------------------------
cluster.prob = clusterProbability(celda.sim$counts, celda.mod)