comparison runit/batchcorrection_tests.R @ 0:b74d1d533dea draft default tip

planemo upload for repository https://github.com/workflow4metabolomics/batchcorrection.git commit 241fb99a843e13195c5054cd9731e1561f039bde
author ethevenot
date Thu, 04 Aug 2016 11:40:35 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:b74d1d533dea
1 test_input_allLoessPool <- function() {
2
3 testDirC <- "input"
4 determineL <- FALSE
5 allLoessL <- TRUE
6 argLs <- list(method = "all_loess_pool",
7 span = "1")
8
9 if(!allLoessL)
10 argLs[["analyse"]] <- ifelse(determineL, "determine_bc", "batch_correction")
11
12 argLs <- c(defaultArgF(testDirC, determineL = determineL), argLs)
13 outLs <- wrapperCallF(argLs, allLoessL = allLoessL)
14
15 checkEqualsNumeric(outLs[['datMN']][1, 1], 25803076, tolerance = 1e-3)
16
17 }
18
19 test_input_allLoessSample <- function() {
20
21 testDirC <- "input"
22 determineL <- FALSE
23 allLoessL <- TRUE
24 argLs <- list(method = "all_loess_sample",
25 span = "1")
26
27 if(!allLoessL)
28 argLs[["analyse"]] <- ifelse(determineL, "determine_bc", "batch_correction")
29
30 argLs <- c(defaultArgF(testDirC, determineL = determineL), argLs)
31 outLs <- wrapperCallF(argLs, allLoessL = allLoessL)
32
33 checkEqualsNumeric(outLs[['datMN']][1, 1], 23402048, tolerance = 1e-3)
34
35 }
36
37 test_example1_allLoessSample <- function() {
38
39 testDirC <- "example1"
40 determineL <- FALSE
41 allLoessL <- TRUE
42 argLs <- list(method = "all_loess_sample",
43 span = "1")
44
45 if(!allLoessL)
46 argLs[["analyse"]] <- ifelse(determineL, "determine_bc", "batch_correction")
47
48 argLs <- c(defaultArgF(testDirC, determineL = determineL), argLs)
49 outLs <- wrapperCallF(argLs, allLoessL = allLoessL)
50
51 checkEqualsNumeric(outLs[['datMN']][1, 1], 21732604, tolerance = 1e-3)
52
53 }
54
55 test_example1_allLoessSampleSpan06 <- function() {
56
57 testDirC <- "example1"
58 determineL <- FALSE
59 allLoessL <- TRUE
60 argLs <- list(method = "all_loess_sample",
61 span = "0.6")
62
63 if(!allLoessL)
64 argLs[["analyse"]] <- ifelse(determineL, "determine_bc", "batch_correction")
65
66 argLs <- c(defaultArgF(testDirC, determineL = determineL), argLs)
67 outLs <- wrapperCallF(argLs, allLoessL = allLoessL)
68
69 checkEqualsNumeric(outLs[['datMN']][1, 1], 134619170, tolerance = 1e-3)
70
71 }
72
73 test_sacurine_allLoessPool <- function() {
74
75 testDirC <- "sacurine"
76 determineL <- FALSE
77 allLoessL <- TRUE
78 argLs <- list(method = "all_loess_pool",
79 span = "1")
80
81 if(!allLoessL)
82 argLs[["analyse"]] <- ifelse(determineL, "determine_bc", "batch_correction")
83
84 argLs <- c(defaultArgF(testDirC, determineL = determineL), argLs)
85 outLs <- wrapperCallF(argLs, allLoessL = allLoessL)
86
87 checkEqualsNumeric(outLs[['datMN']]["HU_neg_017", "M53T345"], 7902.366, tolerance = 1e-3)
88
89
90 }
91
92 test_sacurine_determinebc <- function() {
93
94 testDirC <- "sacurine"
95 determineL <- TRUE
96 allLoessL <- FALSE
97 argLs <- list(ref_factor = "batch",
98 span = "none")
99
100 if(!allLoessL)
101 argLs[["analyse"]] <- ifelse(determineL, "determine_bc", "batch_correction")
102
103 argLs <- c(defaultArgF(testDirC, determineL = determineL), argLs)
104 outLs <- wrapperCallF(argLs, allLoessL = allLoessL)
105
106 checkEqualsNumeric(outLs[['sumDF']]["M59T62", "batch.2.linear"], 3, tolerance = 1e-3)
107
108
109 }