Browse code

Fix bug in absoluteProbabilityHeatmap (#256)

Fixes #254

Former-commit-id: 8f60b4313d7041ba465dfe003179ca56e0d2194c

Sean authored on 04/06/2018 03:19:52 • GitHub committed on 04/06/2018 03:19:52
Showing 3 changed files

... ...
@@ -26,5 +26,5 @@ vignettes/*.pdf
26 26
 .Rproj.user
27 27
 celda.Rproj
28 28
 .DS_Store
29
-.o
30
-.dll
29
+src/*.o
30
+src/*.dll
... ...
@@ -247,7 +247,7 @@ renderCeldaHeatmap <- function(counts, z = NULL, y = NULL,
247 247
 #' @import graphics
248 248
 #' @export 
249 249
 absoluteProbabilityHeatmap <- function(counts, celda.mod, main = NA){
250
-  factorized <- factorizeMatrix(celda.mod = model, counts = counts)
250
+  factorized <- factorizeMatrix(celda.mod = celda.mod, counts = counts)
251 251
   pop <- factorized$proportions$population.states
252 252
   z <- 1:ncol(pop)
253 253
   y <- 1:nrow(pop)
254 254
new file mode 100755
... ...
@@ -0,0 +1,15 @@
1
+# celda_C.R
2
+library(celda)
3
+library(Rtsne)
4
+context("Testing celda Visualization Experiments")
5
+
6
+load("../celdaCGsim.rda")
7
+load("../celdaCG.rda")
8
+model_CG = getModel(celdaCG.res, K = 5, L=3)[[1]]
9
+factorized <- factorizeMatrix(celda.mod = model_CG, counts = celdaCG.sim$counts)
10
+counts.matrix <- celdaCG.sim$counts
11
+
12
+test_that(desc = "Testing that absoluteProbabilityHeatmap runs",{
13
+  plot.obj = absoluteProbabilityHeatmap(counts=counts.matrix, celda.mod=model_CG)
14
+  expect_true(!is.null(plot.obj))
15
+})