Browse code

Fixed bug where sample labels were not stored correctly when using recurrsive split. Updated report to handle plotting of character cell annotations without trying to convert to numeric

Joshua D. Campbell authored on 14/04/2022 17:45:59
Showing 2 changed files

... ...
@@ -547,7 +547,7 @@ setMethod("recursiveSplitCell",
547 547
         beta = beta
548 548
       )
549 549
       tempModel <- .celda_CG(counts,
550
-        sampleLabel = s,
550
+        sampleLabel = sampleLabel,
551 551
         K = as.integer(currentK),
552 552
         L = as.integer(L),
553 553
         yInit = overallY,
... ...
@@ -660,7 +660,7 @@ setMethod("recursiveSplitCell",
660 660
       logfile = logfile
661 661
     )
662 662
     modelInitial <- .celda_C(countsY,
663
-      sampleLabel = s,
663
+      sampleLabel = sampleLabel,
664 664
       K = as.integer(initialK),
665 665
       zInitialize = "split",
666 666
       nchains = 1,
... ...
@@ -691,7 +691,7 @@ setMethod("recursiveSplitCell",
691 691
         beta = beta
692 692
       )
693 693
       tempModel <- .celda_C(countsY,
694
-        sampleLabel = s,
694
+        sampleLabel = sampleLabel,
695 695
         K = as.integer(currentK),
696 696
         nchains = 1,
697 697
         zInitialize = "random",
... ...
@@ -762,7 +762,7 @@ setMethod("recursiveSplitCell",
762 762
       logfile = logfile
763 763
     )
764 764
     modelInitial <- .celda_C(counts,
765
-      sampleLabel = s,
765
+      sampleLabel = sampleLabel,
766 766
       K = as.integer(initialK),
767 767
       zInitialize = "split",
768 768
       nchains = 1,
... ...
@@ -784,7 +784,7 @@ setMethod("recursiveSplitCell",
784 784
         beta = beta
785 785
       )
786 786
       tempModel <- .celda_C(counts,
787
-        sampleLabel = s,
787
+        sampleLabel = sampleLabel,
788 788
         K = as.integer(currentK),
789 789
         nchains = 1,
790 790
         zInitialize = "random",
... ...
@@ -135,7 +135,11 @@ if (!is.null(cellAnnotFinal)) {
135 135
   for (i in seq_along(cellAnnotFinal)) {
136 136
     cat(sprintf(tab4, cellAnnotFinal[i]))
137 137
 
138
-    conditionClass <- ifelse(plotLabels[i], "factor", "numeric")
138
+    if(isTRUE(plotLabels[i])) {
139
+      conditionClass <- "factor"  
140
+    } else {
141
+      conditionClass <- NULL
142
+    }
139 143
 
140 144
     print(
141 145
       plotSCEDimReduceColData(
... ...
@@ -339,17 +343,8 @@ The probability matrix on the left contains the probability of each module withi
339 343
 print(celdaProbabilityMap(sce))
340 344
 ```
341 345
 
342
-### Overview Heatmap
343
-This general heatmap shows the actual relative expression of the
344
-top 10 features in each module (rows) for each cell (columns). Rows are z-score
345
-normalized. The columns of the heatmap are semi-supervised by cell population and the rows are semi-supervised by module. 
346
-```{r celda_heatmap, fig.height = 15, fig.width = 9}
347
-grid.draw(celdaHeatmap(sce, nfeatures = 10))
348
-```
349
-
350
-## Session Information
346
+## Session Information {.unnumbered}
351 347
 ```{r session, eval = showSession, echo = showSession}
352 348
 sessionInfo()
353 349
 ```
354 350
 
355
-<br><br>