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

# S3 method for celda_C
celdaTsne(counts, celda.mod, max.cells = 25000,
  min.cluster.size = 100, initial.dims = 20, 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 object of class "celda_C".

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.

initial.dims

Integer. PCA will be used to reduce the dimentionality of the dataset. The top 'initial.dims' principal components will be used for tSNE. Default 20.

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