By @rpinho

Refereed correctness bugs in open-source research software, with patches and links to upstream PRs

c4bb77c / evocellnet-ksea/patches/PB001.patch

Raw
diff --git a/R/ksea.R b/R/ksea.R
index 34fc931..0289e0f 100755
--- a/R/ksea.R
+++ b/R/ksea.R
@@ -53,7 +53,7 @@ ksea <- function(ranking, norm_express, signature, p=1, display=TRUE,
   #Multiplication of hits and norm_express
   R <- norm_express * HITS
   #Accumulation of absolute norm_express-hit numbers at the power of p
-  hitCases <- cumsum(abs(R) ^ p)
+  hitCases <- cumsum((abs(norm_express) ^ p) * HITS)
   #Maximum value, would be the same as sum(abs(R)^p)
   NR <- max(hitCases)
   #This might happen if the HITS are in 0