annotate checkformat_script.R @ 1:b642f4f87022 draft

planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
author ethevenot
date Thu, 11 Jan 2018 10:26:11 -0500
parents 059eb452931e
children 7d59cbf49966
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
1 ## Etienne Thevenot
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
2 ## CEA, MetaboHUB Paris
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
3 ## etienne.thevenot@cea.fr
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
4
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
5
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
6
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
7 ## Reads the dataMatrix, sampleMetadata, and variableMetadata .tsv files
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
8 ## and checks the formats
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
9 readAndCheckF <- function(datFilC="dataMatrix.tsv",
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
10 samFilC="sampleMetadata.tsv",
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
11 varFilC="variableMetadata.tsv",
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
12 makNamL) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
13
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
14
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
15 ## options
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
16
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
17 optStrAsFacL <- options()[["stringsAsFactors"]]
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
18 options(stringsAsFactors = FALSE)
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
19
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
20
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
21 ## checking that the tables have no duplicated row or column names
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
22
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
23 for(tabC in c("dat", "sam", "var")) {
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
24
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
25 tabNamC <- switch(tabC, dat="dataMatrix", sam="sampleMetadata", var="variableMetadata")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
26
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
27 rowVc <- read.table(eval(parse(text=paste0(tabC, "FilC"))),
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
28 check.names = FALSE,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
29 header = TRUE,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
30 sep = "\t")[, 1]
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
31
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
32 colVc <- unlist(read.table(eval(parse(text=paste0(tabC, "FilC"))),
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
33 check.names = FALSE,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
34 nrow=1,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
35 sep = "\t"))[-1]
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
36
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
37 if(any(duplicated(rowVc)))
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
38 stop("The following row name(s) is/are duplicated in the ",
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
39 tabNamC,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
40 " table: '",
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
41 paste(rowVc[duplicated(rowVc)], collapse="', '"), "'",
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
42 call.=FALSE)
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
43
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
44 if(any(duplicated(colVc)))
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
45 stop("The following column name(s) is/are duplicated in the ",
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
46 tabNamC,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
47 " table: '",
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
48 paste(colVc[duplicated(colVc)], collapse="', '"), "'",
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
49 call.=FALSE)
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
50
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
51 }
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
52
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
53
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
54 ## reading tables
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
55
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
56 datMN <- t(as.matrix(read.table(datFilC,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
57 check.names = FALSE,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
58 header = TRUE,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
59 row.names = 1,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
60 sep = "\t")))
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
61
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
62 samDF <- read.table(samFilC,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
63 check.names = FALSE,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
64 header = TRUE,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
65 row.names = 1,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
66 sep = "\t")
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
67
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
68 varDF <- read.table(varFilC,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
69 check.names = FALSE,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
70 header = TRUE,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
71 row.names = 1,
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
72 sep = "\t")
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
73
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
74
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
75 ## checking that dataMatrix is numeric and that the sample and variable numbers are coherent
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
76
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
77 if(mode(datMN) != "numeric") {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
78 stop("The dataMatrix is not of the 'numeric' type",
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
79 call. = FALSE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
80 }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
81
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
82 if(nrow(datMN) != nrow(samDF)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
83 if(nrow(datMN) > nrow(samDF)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
84 print(setdiff(rownames(datMN), rownames(samDF)))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
85 stop("The sample names above from dataMatrix were not found in sampleMetadata")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
86 } else {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
87 print(setdiff(rownames(samDF), rownames(datMN)))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
88 stop("The sample names above from sampleMetadata were not found in dataMatrix")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
89 }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
90 }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
91
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
92 if(ncol(datMN) != nrow(varDF)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
93 if(ncol(datMN) > nrow(varDF)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
94 print(setdiff(colnames(datMN), rownames(varDF)))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
95 stop("The variable names above from dataMatrix were not found in variableMetadata")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
96 } else {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
97 print(setdiff(rownames(varDF), colnames(datMN)))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
98 stop("The variable names above from variableMetadata were not found in dataMatrix")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
99 }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
100 }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
101
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
102
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
103 ## making sample and variable names (optional)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
104
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
105 newL <- FALSE
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
106
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
107 if(makNamL) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
108
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
109 cat("\n\nMessage: Converting sample and variable names to the standard R format\n")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
110
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
111 rownames(datMN) <- make.names(rownames(datMN), unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
112 colnames(datMN) <- make.names(colnames(datMN), unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
113 rownames(samDF) <- make.names(rownames(samDF), unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
114 rownames(varDF) <- make.names(rownames(varDF), unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
115
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
116 newL <- TRUE
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
117
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
118 }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
119
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
120
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
121 ## checking sample and variable names
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
122
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
123 chkL <- TRUE
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
124
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
125 if(!identical(rownames(datMN), rownames(samDF))) {
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
126
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
127 if(identical(sort(rownames(datMN)), sort(rownames(samDF)))) {
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
128
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
129 cat("\n\nMessage: Re-ordering dataMatrix sample names to match sampleMetadata\n")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
130 datMN <- datMN[rownames(samDF), , drop = FALSE]
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
131
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
132 stopifnot(identical(sort(rownames(datMN)), sort(rownames(samDF))))
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
133
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
134 newL <- TRUE
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
135
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
136 } else {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
137
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
138 cat("\n\nStop: The sample names of dataMatrix and sampleMetadata do not match:\n")
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
139 print(cbind.data.frame(indice = 1:nrow(datMN),
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
140 dataMatrix=rownames(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
141 sampleMetadata=rownames(samDF))[rownames(datMN) != rownames(samDF), , drop = FALSE])
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
142 chkL <- FALSE
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
143
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
144 }
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
145
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
146 }
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
147
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
148 if(!identical(colnames(datMN), rownames(varDF))) {
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
149
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
150 if(identical(sort(colnames(datMN)), sort(rownames(varDF)))) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
151
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
152 cat("\n\nMessage: Re-ordering dataMatrix variable names to match variableMetadata\n")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
153 datMN <- datMN[, rownames(varDF), drop = FALSE]
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
154
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
155 stopifnot(identical(sort(colnames(datMN)), sort(rownames(varDF))))
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
156
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
157 newL <- TRUE
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
158
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
159 } else {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
160
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
161 cat("\n\nStop: The variable names of dataMatrix and variableMetadata do not match:\n")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
162 print(cbind.data.frame(indice = 1:ncol(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
163 dataMatrix=colnames(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
164 variableMetadata=rownames(varDF))[colnames(datMN) != rownames(varDF), , drop = FALSE])
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
165 chkL <- FALSE
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
166
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
167 }
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
168
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
169 }
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
170
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
171
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
172 options(stringsAsFactors=optStrAsFacL)
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
173
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
174 resLs <- list(chkL=chkL,
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
175 newL = newL,
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
176 datMN = datMN,
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
177 samDF = samDF,
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
178 varDF = varDF)
0
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
179
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
180 return(resLs)
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
181
059eb452931e planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit e17f78630b4d21b54a4edd6015d50969ac859d6b
ethevenot
parents:
diff changeset
182 } ## end of checkAndReadF
1
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
183
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
184
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
185
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
186
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
187 ## if(!identical(rownames(datMN), rownames(samDF))) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
188 ## ## checking sample names
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
189
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
190 ## chkL <- FALSE
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
191
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
192 ## datSamDifVc <- setdiff(rownames(datMN), rownames(samDF))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
193
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
194 ## if(length(datSamDifVc)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
195 ## cat("\nThe following samples were found in the dataMatrix column names but not in the sampleMetadata row names:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
196 ## print(cbind.data.frame(col = as.numeric(sapply(datSamDifVc, function(samC) which(rownames(datMN) == samC))),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
197 ## name = datSamDifVc))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
198 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
199
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
200 ## samDatDifVc <- setdiff(rownames(samDF), rownames(datMN))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
201
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
202 ## if(length(samDatDifVc)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
203 ## cat("\n\nThe following samples were found in the sampleMetadata row names but not in the dataMatrix column names:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
204 ## print(cbind.data.frame(row = as.numeric(sapply(samDatDifVc, function(samC) which(rownames(samDF) == samC))),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
205 ## name = samDatDifVc))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
206 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
207
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
208 ## if(nrow(datMN) != nrow(samDF)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
209 ## cat("\n\nThe dataMatrix has ", nrow(datMN), " columns (ie samples) whereas the sampleMetadata has ", nrow(samDF), " rows\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
210 ## } else if(identical(gsub("^X", "", rownames(datMN)), rownames(samDF))) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
211 ## cat("\n\nThe dataMatrix column names start with an 'X' but not the sampleMetadata row names\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
212 ## } else if(identical(gsub("^X", "", rownames(samDF)), rownames(datMN))) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
213 ## cat("\n\nThe sampleMetadata row names start with an 'X' but not the dataMatrix column names\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
214 ## } else if(identical(sort(rownames(datMN)), sort(rownames(samDF)))) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
215 ## cat("\n\nThe dataMatrix column names and the sampleMetadata row names are not in the same order:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
216 ## print(cbind.data.frame(indice = 1:nrow(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
217 ## dataMatrix_columnnames=rownames(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
218 ## sampleMetadata_rownames=rownames(samDF))[rownames(datMN) != rownames(samDF), , drop = FALSE])
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
219 ## } else {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
220 ## cat("\n\nThe dataMatrix column names and the sampleMetadata row names are not identical:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
221 ## print(cbind.data.frame(indice = 1:nrow(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
222 ## dataMatrix_columnnames=rownames(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
223 ## sampleMetadata_rownames=rownames(samDF))[rownames(datMN) != rownames(samDF), , drop = FALSE])
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
224 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
225
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
226 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
227 ## datRowVc <- rownames(datMN)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
228 ## datRowMakVc <- make.names(datRowVc, unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
229 ## if(datRowMakVc != datRowVc) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
230 ## rownames(datMN) <- datRowMakVc
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
231 ## cat("\n\nMessage: The sample names of the dataMatrix have been converted to the standard R format\n")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
232 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
233
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
234 ## datColVc <- colnames(datMN)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
235 ## datColMakVc <- make.names(datColVc, unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
236 ## if(datColMakVc != datColVc) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
237 ## colnames(datMN) <- datColMakVc
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
238 ## cat("\n\nMessage: The variable names of the dataMatrix have been converted to the standard R format\n")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
239 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
240
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
241 ## samRowVc <- rownames(datMN)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
242 ## samRowMakVc <- make.names(samRowVc, unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
243 ## if(samRowMakVc != samRowVc) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
244 ## rownames(datMN) <- samRowMakVc
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
245 ## cat("\n\nMessage: The sample names of the sampleMetadata have been converted to the standard R format\n")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
246 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
247
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
248 ## datRowVc <- rownames(datMN)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
249 ## datRowMakVc <- make.names(datRowVc, unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
250 ## if(datRowMakVc != datRowVc) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
251 ## rownames(datMN) <- datRowMakVc
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
252 ## cat("\n\nMessage: The sample names of the dataMatrix have been converted to the standard R format\n")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
253 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
254
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
255 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
256
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
257 ## checking names (optional)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
258
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
259
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
260
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
261
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
262 ## datRowMakVc <- make.names(datRowVc, unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
263 ## if(datRowMakVc != datRowVc) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
264 ## if(makNamL) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
265 ## rownames(datMN) <- datRowMakVc
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
266 ## cat("\n\nMessage: The sample names of the dataMatrix have been converted to the standard R format; select the make names argument to convert them\n")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
267 ## } else {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
268 ## cat("\n\nWarning: Some of the sample names of the dataMatrix are not in the standard R format; select the make names argument to convert them\n")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
269 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
270
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
271 ## if(makNamL) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
272
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
273 ## rownames(datMN) <- make.names(rownames(datMN), unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
274 ## colnames(datMN) <- make.names(colnames(datMN), unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
275 ## rownames(samDF) <- make.names(rownames(samDF), unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
276 ## rownames(varDF) <- make.names(rownames(varDF), unique = TRUE)
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
277
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
278 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
279 ## checking sample names
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
280
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
281 ## if(nrow(datMN) == nrow(samDF)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
282
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
283
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
284
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
285 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
286
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
287 ## chkL <- FALSE
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
288
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
289 ## datSamDifVc <- setdiff(rownames(datMN), rownames(samDF))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
290
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
291 ## if(length(datSamDifVc)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
292 ## cat("\nThe following samples were found in the dataMatrix column names but not in the sampleMetadata row names:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
293 ## print(cbind.data.frame(col = as.numeric(sapply(datSamDifVc, function(samC) which(rownames(datMN) == samC))),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
294 ## name = datSamDifVc))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
295 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
296
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
297 ## samDatDifVc <- setdiff(rownames(samDF), rownames(datMN))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
298
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
299 ## if(length(samDatDifVc)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
300 ## cat("\n\nThe following samples were found in the sampleMetadata row names but not in the dataMatrix column names:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
301 ## print(cbind.data.frame(row = as.numeric(sapply(samDatDifVc, function(samC) which(rownames(samDF) == samC))),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
302 ## name = samDatDifVc))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
303 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
304
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
305 ## if(nrow(datMN) != nrow(samDF)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
306 ## cat("\n\nThe dataMatrix has ", nrow(datMN), " columns (ie samples) whereas the sampleMetadata has ", nrow(samDF), " rows\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
307 ## } else if(identical(gsub("^X", "", rownames(datMN)), rownames(samDF))) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
308 ## cat("\n\nThe dataMatrix column names start with an 'X' but not the sampleMetadata row names\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
309 ## } else if(identical(gsub("^X", "", rownames(samDF)), rownames(datMN))) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
310 ## cat("\n\nThe sampleMetadata row names start with an 'X' but not the dataMatrix column names\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
311 ## } else if(identical(sort(rownames(datMN)), sort(rownames(samDF)))) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
312 ## cat("\n\nThe dataMatrix column names and the sampleMetadata row names are not in the same order:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
313 ## print(cbind.data.frame(indice = 1:nrow(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
314 ## dataMatrix_columnnames=rownames(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
315 ## sampleMetadata_rownames=rownames(samDF))[rownames(datMN) != rownames(samDF), , drop = FALSE])
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
316 ## } else {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
317 ## cat("\n\nThe dataMatrix column names and the sampleMetadata row names are not identical:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
318 ## print(cbind.data.frame(indice = 1:nrow(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
319 ## dataMatrix_columnnames=rownames(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
320 ## sampleMetadata_rownames=rownames(samDF))[rownames(datMN) != rownames(samDF), , drop = FALSE])
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
321 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
322
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
323 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
324
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
325
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
326 ## if(!identical(colnames(datMN), rownames(varDF))) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
327 ## ## checking variable names
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
328
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
329 ## chkL <- FALSE
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
330
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
331 ## datVarDifVc <- setdiff(colnames(datMN), rownames(varDF))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
332
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
333 ## if(length(datVarDifVc)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
334 ## cat("\nThe following variables were found in the dataMatrix row names but not in the variableMetadata row names:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
335 ## print(cbind.data.frame(row = as.numeric(sapply(datVarDifVc, function(varC) which(colnames(datMN) == varC))),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
336 ## name = datVarDifVc))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
337
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
338 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
339
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
340 ## varDatDifVc <- setdiff(rownames(varDF), colnames(datMN))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
341
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
342 ## if(length(varDatDifVc)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
343 ## cat("\n\nThe following variables were found in the variableMetadata row names but not in the dataMatrix row names:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
344 ## print(cbind.data.frame(row = as.numeric(sapply(varDatDifVc, function(varC) which(rownames(varDF) == varC))),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
345 ## name = varDatDifVc))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
346 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
347
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
348 ## if(ncol(datMN) != nrow(varDF)) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
349 ## cat("\n\nThe dataMatrix has ", nrow(datMN), " rows (ie variables) whereas the variableMetadata has ", nrow(varDF), " rows\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
350 ## } else if(identical(sort(colnames(datMN)), sort(rownames(varDF)))) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
351 ## cat("\n\nThe dataMatrix row names and the variableMetadata row names are not in the same order:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
352 ## print(cbind.data.frame(row = 1:ncol(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
353 ## dataMatrix_rownames=colnames(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
354 ## variableMetadata_rownames=rownames(varDF))[colnames(datMN) != rownames(varDF), , drop = FALSE])
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
355 ## } else {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
356 ## cat("\n\nThe dataMatrix row names and the variableMetadata row names are not identical:\n", sep="")
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
357 ## print(cbind.data.frame(row = 1:ncol(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
358 ## dataMatrix_rownames=colnames(datMN),
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
359 ## variableMetadata_rownames=rownames(varDF))[colnames(datMN) != rownames(varDF), , drop = FALSE])
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
360 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
361 ## }
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
362 ## checkF <- function(datInpMN,
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
363 ## samInpDF,
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
364 ## varInpDF) {
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
365
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
366 ## mode(datInpMN) == "numeric" &&
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
367 ## identical(rownames(datInpMN), rownames(samInpDF)) &&
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
368 ## identical(colnames(datInpMN), rownames(varInpDF))
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
369
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
370
b642f4f87022 planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 5cf3f6eb62c1396ade1b068a3dd3cc2e3f827e15
ethevenot
parents: 0
diff changeset
371 ## }