annotate runit/checkformat_tests.R @ 5:e7c5811ec12f draft default tip

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