Browse code

add some tests to detect potential differences in quantile normalization results across platforms

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/preprocessCore@85741 bc3139a8-67e5-0310-9ffc-ced21a209358

Ben Bolstad authored on 23/01/2014 15:25:56
Showing 2 changed files

... ...
@@ -1,5 +1,5 @@
1 1
 Package: preprocessCore
2
-Version: 1.25.3
2
+Version: 1.25.4
3 3
 Title: A collection of pre-processing functions
4 4
 Author: Benjamin Milo Bolstad <bmb@bmbolstad.com>
5 5
 Maintainer: Benjamin Milo Bolstad <bmb@bmbolstad.com>
6 6
new file mode 100644
... ...
@@ -0,0 +1,51 @@
1
+library(preprocessCore)
2
+
3
+err.tol <- 10^-8
4
+
5
+x <- matrix(c(100,15,200,250,110,16.5,220,275,120,18,240,300),ncol=3)
6
+x
7
+normalize.quantiles(x)
8
+
9
+x.norm.truth <- matrix(rep(c(110.0,16.5,220,275.0),3),ncol=3)
10
+
11
+if (all(abs(x.norm.truth - normalize.quantiles(x)) < err.tol) != TRUE){
12
+	stop("Disagreement in normalize.quantiles(x)")
13
+}
14
+
15
+normalize.quantiles.determine.target(x)
16
+
17
+x.norm.target.truth <- c(16.5,110.0,220.0,275.0)
18
+
19
+if (all(abs(x.norm.target.truth - normalize.quantiles.determine.target(x)) < err.tol) != TRUE){
20
+	stop("Disagreement in normalize.quantiles.determine.target(x)")
21
+}
22
+
23
+
24
+y <- x
25
+y[2,2] <- NA
26
+y
27
+normalize.quantiles(y)
28
+
29
+y.norm.target.truth <- c(47.6666666666667,134.4444444444444,226.1111111111111,275.0000000000000)
30
+
31
+y.norm.truth <- matrix(c(134.4444444444444,  47.6666666666667, 134.4444444444444,
32
+                         47.6666666666667,                NA,  47.6666666666667,
33
+                        226.1111111111111, 180.2777777777778, 226.1111111111111,
34
+                        275.0000000000000, 275.0000000000000, 275.0000000000000),byrow=TRUE,ncol=3)
35
+
36
+
37
+if (all(abs(y.norm.truth - normalize.quantiles(y)) < err.tol,na.rm=TRUE) != TRUE){
38
+	stop("Disagreement in normalize.quantiles(y)")
39
+}
40
+
41
+
42
+
43
+if (all(abs(y.norm.target.truth - normalize.quantiles.determine.target(y)) < err.tol) != TRUE){
44
+	stop("Disagreement in normalize.quantiles.determine.target(y)")
45
+}
46
+
47
+
48
+
49
+if (all(abs(normalize.quantiles.use.target(y,y.norm.target.truth) - y.norm.truth) < err.tol,na.rm=TRUE) != TRUE){
50
+		stop("Disagreement in normalize.quantiles.use.target(y)")
51
+}