Embeds cells in two dimensions using tSNE based on celda_CG results.

# S3 method for celda_CG
celdaTsne(counts, celda.mod, max.cells = 25000,
  min.cluster.size = 100, modules = NULL, perplexity = 20,
  max.iter = 2500, seed = 12345, ...)

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 model. Options available in `celda::available.models`.

max.cells

Integer. Maximum number of cells to plot. Cells will be randomly subsampled if ncol(counts) > max.cells. Larger numbers of cells requires more memory. Default 25000.

min.cluster.size

Integer. Do not subsample cell clusters below this threshold. Default 100.

modules

Integer vector. Determines which features modules to use for tSNE. If NULL, all modules will be used. Default NULL.

perplexity

Numeric. Perplexity parameter for tSNE. Default 20.

max.iter

Integer. Maximum number of iterations in tSNE generation. Default 2500.

seed

Integer. Passed to set.seed(). Default 12345.

...

Additional parameters.

Examples

celda.sim = simulateCells("celda_CG") celda.mod = celda_CG(celda.sim$counts, K=celda.sim$K, L=celda.sim$L)
#> --------------------------------------------------------------------
#> Starting Celda_CG: Clustering cells and genes.
#> --------------------------------------------------------------------
#> Thu Sep 06 12:56:00 2018 .. Initializing chain 1 with 'random' (seed=12345)
#> Thu Sep 06 12:56:00 2018 .... Completed iteration: 1 | logLik: -1302242.28026966
#> Thu Sep 06 12:56:00 2018 .... Completed iteration: 2 | logLik: -1270044.02532694
#> Thu Sep 06 12:56:00 2018 .... Completed iteration: 3 | logLik: -1262209.15789703
#> Thu Sep 06 12:56:00 2018 .... Completed iteration: 4 | logLik: -1261712.35040107
#> Thu Sep 06 12:56:00 2018 .... Completed iteration: 5 | logLik: -1261712.57070977
#> Thu Sep 06 12:56:00 2018 .... Completed iteration: 6 | logLik: -1261711.00382116
#> Thu Sep 06 12:56:00 2018 .... Completed iteration: 7 | logLik: -1261716.24159949
#> Thu Sep 06 12:56:00 2018 .... Completed iteration: 8 | logLik: -1261479.73933942
#> Thu Sep 06 12:56:00 2018 .... Completed iteration: 9 | logLik: -1259874.14368698
#> Thu Sep 06 12:56:00 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:00 2018 .... Cluster 1 was reassigned and cluster 4 was split in two.
#> Thu Sep 06 12:56:00 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:56:01 2018 .... Cluster 2 was reassigned and cluster 9 was split in two.
#> Thu Sep 06 12:56:01 2018 .... Completed iteration: 10 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:01 2018 .... Completed iteration: 11 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:01 2018 .... Completed iteration: 12 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:01 2018 .... Completed iteration: 13 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:01 2018 .... Completed iteration: 14 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:01 2018 .... Completed iteration: 15 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:01 2018 .... Completed iteration: 16 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:01 2018 .... Completed iteration: 17 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:01 2018 .... Completed iteration: 18 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:01 2018 .... Completed iteration: 19 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:01 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:01 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:01 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:56:02 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 20 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:02 2018 .. Finished chain 1 with seed 12345
#> Thu Sep 06 12:56:02 2018 .. Initializing chain 2 with 'random' (seed=12346)
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 1 | logLik: -1288484.90567663
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 2 | logLik: -1252316.73202744
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 3 | logLik: -1250339.95568952
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 4 | logLik: -1249564.71677654
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 5 | logLik: -1249563.6294892
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 6 | logLik: -1249564.31589985
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 7 | logLik: -1249563.24732323
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 8 | logLik: -1249563.4198964
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 9 | logLik: -1249563.4198964
#> Thu Sep 06 12:56:02 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:02 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:02 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:56:02 2018 .... Cluster 1 was reassigned and cluster 5 was split in two.
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 10 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 11 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 12 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 13 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 14 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 15 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 16 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 17 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 18 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:02 2018 .... Completed iteration: 19 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:02 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:03 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:03 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:56:03 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:03 2018 .... Completed iteration: 20 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:03 2018 .. Finished chain 2 with seed 12346
#> Thu Sep 06 12:56:03 2018 .. Initializing chain 3 with 'random' (seed=12347)
#> Thu Sep 06 12:56:03 2018 .... Completed iteration: 1 | logLik: -1272446.65246189
#> Thu Sep 06 12:56:03 2018 .... Completed iteration: 2 | logLik: -1251530.86145074
#> Thu Sep 06 12:56:03 2018 .... Completed iteration: 3 | logLik: -1251528.38544994
#> Thu Sep 06 12:56:03 2018 .... Completed iteration: 4 | logLik: -1251523.68686302
#> Thu Sep 06 12:56:03 2018 .... Completed iteration: 5 | logLik: -1251527.44696783
#> Thu Sep 06 12:56:03 2018 .... Completed iteration: 6 | logLik: -1251522.13351871
#> Thu Sep 06 12:56:03 2018 .... Completed iteration: 7 | logLik: -1251526.73996701
#> Thu Sep 06 12:56:03 2018 .... Completed iteration: 8 | logLik: -1251529.06808316
#> Thu Sep 06 12:56:03 2018 .... Completed iteration: 9 | logLik: -1251527.40248727
#> Thu Sep 06 12:56:03 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:03 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:03 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:56:04 2018 .... Cluster 1 was reassigned and cluster 5 was split in two.
#> Thu Sep 06 12:56:04 2018 .... Completed iteration: 10 | logLik: -1248422.30438372
#> Thu Sep 06 12:56:04 2018 .... Completed iteration: 11 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:04 2018 .... Completed iteration: 12 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:04 2018 .... Completed iteration: 13 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:04 2018 .... Completed iteration: 14 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:04 2018 .... Completed iteration: 15 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:04 2018 .... Completed iteration: 16 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:04 2018 .... Completed iteration: 17 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:04 2018 .... Completed iteration: 18 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:04 2018 .... Completed iteration: 19 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:04 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:56:04 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:04 2018 .... Completed iteration: 20 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:04 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:56:04 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:04 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:56:05 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:56:05 2018 .... Completed iteration: 21 | logLik: -1248355.63470669
#> Thu Sep 06 12:56:05 2018 .. Finished chain 3 with seed 12347
#> --------------------------------------------------------------------
#> Completed Celda_CG. Total time: 4.827253 secs
#> --------------------------------------------------------------------
tsne.res = celdaTsne(celda.sim$counts, celda.mod)