Create a scatterplot for each row of a normalized gene expression matrix where x and y axis are from a data dimensionality reduction tool.

plotDimReduceGene(dim1, dim2, counts, features, exact.match = TRUE,
  trim = c(-2, 2), size = 1, xlab = "Dimension_1", ylab = "Dimension_2",
  color_low = "grey", color_mid = NULL, color_high = "blue")

Arguments

dim1

Numeric vector. First dimension from data dimensionality reduction output.

dim2

Numeric vector. Second dimension from data dimensionality reduction output.

counts

Integer matrix. Rows represent features and columns represent cells.

features

Character vector. Uses these genes for plotting.

exact.match

Logical. Whether to look for exact match of the gene name within counts matrix. Default TRUE.

trim

Numeric vector. Vector of length two that specifies the lower and upper bounds for the data. This threshold is applied after row scaling. Set to NULL to disable. Default c(-2,2).

size

Numeric. Sets size of point on plot. Default 1.

xlab

Character vector. Label for the x-axis. Default "Dimension_1".

ylab

Character vector. Label for the y-axis. Default "Dimension_2".

color_low

Character. A color available from `colors()`. The color will be used to signify the lowest values on the scale. Default 'grey'.

color_mid

Character. A color available from `colors()`. The color will be used to signify the midpoint on the scale.

color_high

Character. A color available from `colors()`. The color will be used to signify the highest values on the scale. Default 'blue'.

Examples

sim.res = simulateCells(model="celda_CG", K = 5, L = 5) celda_cg <- celda_CG(counts = sim.res$counts, K = 5, L = 5)
#> --------------------------------------------------------------------
#> Starting Celda_CG: Clustering cells and genes.
#> --------------------------------------------------------------------
#> Thu Sep 06 12:57:37 2018 .. Initializing chain 1 with 'random' (seed=12345)
#> Thu Sep 06 12:57:37 2018 .... Completed iteration: 1 | logLik: -1292432.99348905
#> Thu Sep 06 12:57:37 2018 .... Completed iteration: 2 | logLik: -1271152.8119707
#> Thu Sep 06 12:57:37 2018 .... Completed iteration: 3 | logLik: -1271146.08792976
#> Thu Sep 06 12:57:37 2018 .... Completed iteration: 4 | logLik: -1271142.13405322
#> Thu Sep 06 12:57:37 2018 .... Completed iteration: 5 | logLik: -1271138.7926281
#> Thu Sep 06 12:57:37 2018 .... Completed iteration: 6 | logLik: -1271139.37518801
#> Thu Sep 06 12:57:37 2018 .... Completed iteration: 7 | logLik: -1271135.02027059
#> Thu Sep 06 12:57:37 2018 .... Completed iteration: 8 | logLik: -1271133.69255723
#> Thu Sep 06 12:57:37 2018 .... Completed iteration: 9 | logLik: -1271131.24555386
#> Thu Sep 06 12:57:37 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:57:37 2018 .... Cluster 1 was reassigned and cluster 3 was split in two.
#> Thu Sep 06 12:57:37 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:57:37 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:37 2018 .... Completed iteration: 10 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:37 2018 .... Completed iteration: 11 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:38 2018 .... Completed iteration: 12 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:38 2018 .... Completed iteration: 13 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:38 2018 .... Completed iteration: 14 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:38 2018 .... Completed iteration: 15 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:38 2018 .... Completed iteration: 16 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:38 2018 .... Completed iteration: 17 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:38 2018 .... Completed iteration: 18 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:38 2018 .... Completed iteration: 19 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:38 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:57:38 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:38 2018 .... Completed iteration: 20 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:38 2018 .... Completed iteration: 21 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:38 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:57:38 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:38 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:57:39 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 22 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:39 2018 .. Finished chain 1 with seed 12345
#> Thu Sep 06 12:57:39 2018 .. Initializing chain 2 with 'random' (seed=12346)
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 1 | logLik: -1296147.64459921
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 2 | logLik: -1273614.61367925
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 3 | logLik: -1271640.01823375
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 4 | logLik: -1271150.85741638
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 5 | logLik: -1270826.33540845
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 6 | logLik: -1268220.93677393
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 7 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 8 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 9 | logLik: -1265981.10028326
#> Thu Sep 06 12:57:39 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:57:39 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:39 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:57:39 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 10 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 11 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 12 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 13 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 14 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 15 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:39 2018 .... Completed iteration: 16 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:39 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:57:39 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:39 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:57:40 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 17 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:40 2018 .. Finished chain 2 with seed 12346
#> Thu Sep 06 12:57:40 2018 .. Initializing chain 3 with 'random' (seed=12347)
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 1 | logLik: -1298276.1895605
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 2 | logLik: -1270053.97340606
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 3 | logLik: -1266751.51933782
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 4 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 5 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 6 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 7 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 8 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 9 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:40 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:57:40 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:40 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:57:40 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 10 | logLik: -1265977.42998371
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 11 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 12 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:40 2018 .... Completed iteration: 13 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:40 2018 .... Determining if any cell clusters should be split.
#> Thu Sep 06 12:57:40 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:40 2018 .... Determining if any gene clusters should be split.
#> Thu Sep 06 12:57:41 2018 .... No additional splitting was performed.
#> Thu Sep 06 12:57:41 2018 .... Completed iteration: 14 | logLik: -1265977.81160925
#> Thu Sep 06 12:57:41 2018 .. Finished chain 3 with seed 12347
#> --------------------------------------------------------------------
#> Completed Celda_CG. Total time: 4.145608 secs
#> --------------------------------------------------------------------
celda.tsne <- celdaTsne(counts = sim.res$counts, celda.mod = celda_cg) plotDimReduceGene(dim1 = celda.tsne[,1],dim2 = celda.tsne[,2], counts = sim.res$counts,features = c("Gene_99"), exact.match = TRUE)