Skip to content

Commit

Permalink
Fixed bug in perplexity of celda_G where phi was being recalculated
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-d-campbell committed Apr 11, 2022
1 parent a662ab4 commit 1c267f1
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions R/perplexity.R
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,10 @@ setMethod(
eta <- factorized$posterior$geneDistribution
nGByTS <- factorized$counts$geneDistribution


if (is.null(newCounts)) {
newCounts <- counts
} else {
newCounts <- .processCounts(newCounts)
beta <- params(celdaMod)$beta
L <- params(celdaMod)$L
y <- celdaMod@clusters$y
phi <- .rowSumByGroup(newCounts, group = y, L = L) + beta
phi <- normalizeCounts(phi, normalize = "proportion")
}
if (nrow(newCounts) != nrow(counts)) {
stop("newCounts should have the same number of rows as counts.")
Expand Down Expand Up @@ -315,8 +309,6 @@ setMethod(
newCounts <- counts
} else {
newCounts <- .processCounts(newCounts)
phi <- .rowSumByGroup(newCounts, group = y, L = L) + beta
phi <- normalizeCounts(phi, normalize = "proportion")
}
if (nrow(newCounts) != nrow(counts)) {
stop("newCounts should have the same number of rows as counts.")
Expand Down

0 comments on commit 1c267f1

Please sign in to comment.