Browse code

Bugfix to enforce DelayedMatrixStats::rowSds(), with matrixStats::rowSds() behind the scenes, giving an exact zero where base sd() would also give an exact zero. See https://github.com/rcastelo/GSVA/issues/54 and https://github.com/HenrikBengtsson/matrixStats/issues/204

[rcastelo] authored on 03/06/2021 15:42:11
Showing2 changed files

... ...
@@ -1,5 +1,5 @@
1 1
 Package: GSVA
2
-Version: 1.40.0
2
+Version: 1.40.1
3 3
 Title: Gene Set Variation Analysis for microarray and RNA-seq data
4 4
 Authors@R: c(person("Justin", "Guinney", role=c("aut", "cre"), email="justin.guinney@sagebase.org"),
5 5
              person("Robert", "Castelo", role="aut", email="robert.castelo@upf.edu"),
... ...
@@ -4,6 +4,10 @@
4 4
   ## DelayedMatrixStats::rowSds() works for both base and 
5 5
   ## DelayedArray matrices
6 6
   sdGenes <- DelayedMatrixStats::rowSds(expr)
7
+  ## the following fixes this bug, see issues
8
+  ## https://github.com/rcastelo/GSVA/issues/54
9
+  ## https://github.com/HenrikBengtsson/matrixStats/issues/204
10
+  sdGenes[sdGenes < 1e-10] <- 0
7 11
   if (any(sdGenes == 0) || any(is.na(sdGenes))) {
8 12
     warning(sum(sdGenes == 0 | is.na(sdGenes)),
9 13
             " genes with constant expression values throuhgout the samples.")