Mercurial > repos > ethevenot > qualitymetrics
annotate easyrlibrary-lib/RcheckLibrary.R @ 3:acdf51018708 draft default tip
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit b7e47e59ea753fe9f73f2b83bcaae895b21269f6
author | ethevenot |
---|---|
date | Wed, 28 Feb 2018 09:32:42 -0500 |
parents | b4f5b5bc01dd |
children |
rev | line source |
---|---|
0
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
1 ###################################################### |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
2 # R check library |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
3 # Coded by: M.Petera, |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
4 # - - |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
5 # R functions to use in R scripts |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
6 # (management of various generic subroutines) |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
7 # - - |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
8 # V0: script structure + first functions |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
9 # V1: More detailed error messages in match functions |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
10 ###################################################### |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
11 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
12 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
13 # Generic function to return an error if problems have been encountered - - - - |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
14 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
15 check.err <- function(err.stock){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
16 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
17 # err.stock = vector of results returned by check functions |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
18 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
19 if(length(err.stock)!=0){ stop("\n- - - - - - - - -\n",err.stock,"\n- - - - - - - - -\n") } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
20 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
21 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
22 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
23 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
24 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
25 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
26 # Table match check functions - - - - - - - - - - - - - - - - - - - - - - - - - |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
27 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
28 # To check if dataMatrix and (variable or sample)Metadata match regarding identifiers |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
29 match2 <- function(dataMatrix, Metadata, Mtype){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
30 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
31 # dataMatrix = data.frame containing dataMatrix |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
32 # Metadata = data.frame containing sampleMetadata or variableMetadata |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
33 # Mtype = "sample" or "variable" depending on Metadata content |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
34 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
35 err.stock <- NULL # error vector |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
36 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
37 id2 <- Metadata[,1] |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
38 if(Mtype=="sample"){ id1 <- colnames(dataMatrix)[-1] } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
39 if(Mtype=="variable"){ id1 <- dataMatrix[,1] } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
40 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
41 if( length(which(id1%in%id2))!=length(id1) || length(which(id2%in%id1))!=length(id2) ){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
42 err.stock <- c("\nData matrix and ",Mtype," metadata do not match regarding ",Mtype," identifiers.") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
43 if(length(which(id1%in%id2))!=length(id1)){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
44 if(length(which(!(id1%in%id2)))<4){ err.stock <- c(err.stock,"\n The ") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
45 }else{ err.stock <- c(err.stock,"\n For example, the ") } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
46 err.stock <- c(err.stock,"following identifiers found in the data matrix\n", |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
47 " do not appear in the ",Mtype," metadata file:\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
48 identif <- id1[which(!(id1%in%id2))][1:min(3,length(which(!(id1%in%id2))))] |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
49 err.stock <- c(err.stock," ",paste(identif,collapse="\n "),"\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
50 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
51 if(length(which(id2%in%id1))!=length(id2)){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
52 if(length(which(!(id2%in%id1)))<4){ err.stock <- c(err.stock,"\n The ") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
53 }else{ err.stock <- c(err.stock,"\n For example, the ") } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
54 err.stock <- c(err.stock,"following identifiers found in the ",Mtype," metadata file\n", |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
55 " do not appear in the data matrix:\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
56 identif <- id2[which(!(id2%in%id1))][1:min(3,length(which(!(id2%in%id1))))] |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
57 err.stock <- c(err.stock," ",paste(identif,collapse="\n "),"\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
58 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
59 err.stock <- c(err.stock,"\nPlease check your data.\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
60 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
61 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
62 return(err.stock) |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
63 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
64 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
65 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
66 # To check if the 3 standard tables match regarding identifiers |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
67 match3 <- function(dataMatrix, sampleMetadata, variableMetadata){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
68 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
69 # dataMatrix = data.frame containing dataMatrix |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
70 # sampleMetadata = data.frame containing sampleMetadata |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
71 # variableMetadata = data.frame containing variableMetadata |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
72 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
73 err.stock <- NULL # error vector |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
74 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
75 id1 <- colnames(dataMatrix)[-1] |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
76 id2 <- sampleMetadata[,1] |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
77 id3 <- dataMatrix[,1] |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
78 id4 <- variableMetadata[,1] |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
79 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
80 if( length(which(id1%in%id2))!=length(id1) || length(which(id2%in%id1))!=length(id2) ){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
81 err.stock <- c(err.stock,"\nData matrix and sample metadata do not match regarding sample identifiers.") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
82 if(length(which(id1%in%id2))!=length(id1)){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
83 if(length(which(!(id1%in%id2)))<4){ err.stock <- c(err.stock,"\n The ") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
84 }else{ err.stock <- c(err.stock,"\n For example, the ") } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
85 err.stock <- c(err.stock,"following identifiers found in the data matrix\n", |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
86 " do not appear in the sample metadata file:\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
87 identif <- id1[which(!(id1%in%id2))][1:min(3,length(which(!(id1%in%id2))))] |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
88 err.stock <- c(err.stock," ",paste(identif,collapse="\n "),"\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
89 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
90 if(length(which(id2%in%id1))!=length(id2)){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
91 if(length(which(!(id2%in%id1)))<4){ err.stock <- c(err.stock,"\n The ") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
92 }else{ err.stock <- c(err.stock,"\n For example, the ") } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
93 err.stock <- c(err.stock,"following identifiers found in the sample metadata file\n", |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
94 " do not appear in the data matrix:\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
95 identif <- id2[which(!(id2%in%id1))][1:min(3,length(which(!(id2%in%id1))))] |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
96 err.stock <- c(err.stock," ",paste(identif,collapse="\n "),"\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
97 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
98 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
99 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
100 if( length(which(id3%in%id4))!=length(id3) || length(which(id4%in%id3))!=length(id4) ){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
101 err.stock <- c(err.stock,"\nData matrix and variable metadata do not match regarding variable identifiers.") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
102 if(length(which(id3%in%id4))!=length(id3)){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
103 if(length(which(!(id3%in%id4)))<4){ err.stock <- c(err.stock,"\n The ") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
104 }else{ err.stock <- c(err.stock,"\n For example, the ") } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
105 err.stock <- c(err.stock,"following identifiers found in the data matrix\n", |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
106 " do not appear in the variable metadata file:\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
107 identif <- id3[which(!(id3%in%id4))][1:min(3,length(which(!(id3%in%id4))))] |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
108 err.stock <- c(err.stock," ",paste(identif,collapse="\n "),"\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
109 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
110 if(length(which(id4%in%id3))!=length(id4)){ |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
111 if(length(which(!(id4%in%id3)))<4){ err.stock <- c(err.stock,"\n The ") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
112 }else{ err.stock <- c(err.stock,"\n For example, the ") } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
113 err.stock <- c(err.stock,"following identifiers found in the variable metadata file\n", |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
114 " do not appear in the data matrix:\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
115 identif <- id4[which(!(id4%in%id3))][1:min(3,length(which(!(id4%in%id3))))] |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
116 err.stock <- c(err.stock," ",paste(identif,collapse="\n "),"\n") |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
117 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
118 } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
119 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
120 if(length(err.stock)!=0){ err.stock <- c(err.stock,"\nPlease check your data.\n") } |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
121 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
122 return(err.stock) |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
123 |
b4f5b5bc01dd
planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
ethevenot
parents:
diff
changeset
|
124 } |