Browse code

Fixed bug in perplexity of celda_G where phi was being recalculated

Joshua D. Campbell authored on 11/04/2022 22:51:45
Showing 1 changed files

... ...
@@ -209,16 +209,10 @@ setMethod(
209 209
         eta <- factorized$posterior$geneDistribution
210 210
         nGByTS <- factorized$counts$geneDistribution
211 211
 
212
-        
213 212
         if (is.null(newCounts)) {
214 213
             newCounts <- counts
215 214
         } else {
216 215
             newCounts <- .processCounts(newCounts)
217
-            beta <- params(celdaMod)$beta
218
-            L <- params(celdaMod)$L
219
-            y <- celdaMod@clusters$y
220
-            phi <- .rowSumByGroup(newCounts, group = y, L = L) + beta
221
-            phi <- normalizeCounts(phi, normalize = "proportion")
222 216
         }
223 217
         if (nrow(newCounts) != nrow(counts)) {
224 218
             stop("newCounts should have the same number of rows as counts.")
... ...
@@ -315,8 +309,6 @@ setMethod(
315 309
         newCounts <- counts
316 310
     } else {
317 311
         newCounts <- .processCounts(newCounts)
318
-        phi <- .rowSumByGroup(newCounts, group = y, L = L) + beta
319
-        phi <- normalizeCounts(phi, normalize = "proportion")
320 312
     }
321 313
     if (nrow(newCounts) != nrow(counts)) {
322 314
         stop("newCounts should have the same number of rows as counts.")