comparison runit/checkformat_tests.R @ 3:80a38d36f946 draft

planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
author ethevenot
date Thu, 11 Jan 2018 10:24:56 -0500
parents e194eec8e70c
children
comparison
equal deleted inserted replaced
2:b6a6b4cc932a 3:80a38d36f946
1 test_input_default <- function() { 1 test_input_default <- function() {
2 2
3 testDirC <- "input" 3 testDirC <- "input"
4 argLs <- list() 4 argLs <- list(makeNameL = FALSE)
5 5
6 argLs <- c(defaultArgF(testDirC), argLs) 6 argLs <- c(defaultArgF(testDirC), argLs)
7 outLs <- wrapperCallF(argLs) 7 outLs <- wrapperCallF(argLs)
8 8
9 checkEquals(outLs[['infVc']][4], 'Table formats are OK; enjoy your analyses!') 9 checkEquals(outLs[['infVc']][4], 'The input tables have a correct format and can be used for your analyses.')
10 10
11 } 11 }
12
13 test_datSamInv <- function() {
14
15 ## first two samples inverted in dataMatrix
16
17 testDirC <- "datSamInv"
18 argLs <- list(makeNameL = FALSE)
19
20 argLs <- c(defaultArgF(testDirC), argLs)
21 outLs <- wrapperCallF(argLs)
22
23 checkEquals(outLs[['infVc']][7], 'Warning: The sample and/or variable names or orders from the input tables have been modified')
24
25 }
26
27 test_datSamFls <- function() {
28
29 ## first sample name in dataMatrix is 17, and in sampleMetadata is X17
30
31 ## also used in test-data
32
33 testDirC <- "datSamFls"
34 argLs <- list(makeNameL = TRUE)
35
36 argLs <- c(defaultArgF(testDirC), argLs)
37 outLs <- wrapperCallF(argLs)
38
39 checkEquals(outLs[['infVc']][5], 'Message: Converting sample and variable names to the standard R format')
40
41 checkEquals(outLs[['infVc']][7], 'Warning: The sample and/or variable names or orders from the input tables have been modified')
42
43 checkEquals(rownames(outLs[['datMN']])[1], 'X17')
44
45 }
46
47 test_datSamFlsInv <- function() {
48
49 ## first sample name in dataMatrix is X17, and in sampleMetadata is 17
50
51 testDirC <- "datSamFlsInv"
52 argLs <- list(makeNameL = TRUE)
53
54 argLs <- c(defaultArgF(testDirC), argLs)
55 outLs <- wrapperCallF(argLs)
56
57 checkEquals(outLs[['infVc']][5], 'Message: Converting sample and variable names to the standard R format')
58
59 checkEquals(outLs[['infVc']][7], 'Warning: The sample and/or variable names or orders from the input tables have been modified')
60
61 checkEquals(rownames(outLs[['samDF']])[1], 'X17')
62
63 }
64
65 test_datVarInv <- function() {
66
67 ## first two variables inverted in variableMetadata
68
69 testDirC <- "datVarInv"
70 argLs <- list(makeNameL = FALSE)
71
72 argLs <- c(defaultArgF(testDirC), argLs)
73 outLs <- wrapperCallF(argLs)
74
75 checkEquals(outLs[['infVc']][7], 'Warning: The sample and/or variable names or orders from the input tables have been modified')
76
77 }
78
79 test_datVarFls <- function() {
80
81 ## second variable name in dataMatrix is 3072, and in variableMetadata is X3072
82
83 testDirC <- "datVarFls"
84 argLs <- list(makeNameL = TRUE)
85
86 argLs <- c(defaultArgF(testDirC), argLs)
87 outLs <- wrapperCallF(argLs)
88
89 checkEquals(outLs[['infVc']][5], 'Message: Converting sample and variable names to the standard R format')
90
91 checkEquals(outLs[['infVc']][7], 'Warning: The sample and/or variable names or orders from the input tables have been modified')
92
93 checkEquals(colnames(outLs[['datMN']])[2], 'X3072')
94
95 }