Repository 'checkformat'
hg clone https://toolshed.g2.bx.psu.edu/repos/ethevenot/checkformat

Changeset 4:9590fac86f63 (2018-02-28)
Previous changeset 3:80a38d36f946 (2018-01-11) Next changeset 5:e7c5811ec12f (2018-03-01)
Commit message:
planemo upload for repository https://github.com/workflow4metabolomics/checkformat.git commit 46e92656192f2714265cc525b283c7cbb87b9093
modified:
checkformat_config.xml
checkformat_script.R
b
diff -r 80a38d36f946 -r 9590fac86f63 checkformat_config.xml
--- a/checkformat_config.xml Thu Jan 11 10:24:56 2018 -0500
+++ b/checkformat_config.xml Wed Feb 28 05:47:44 2018 -0500
b
@@ -2,7 +2,7 @@
   <description>Checking/formatting the sample and variable names of the dataMatrix, sampleMetadata, and variableMetadata files</description>
   
   <requirements>
-    <requirement type="package">r-batch</requirement>
+    <requirement type="package" version="1.1_4">r-batch</requirement>
   </requirements>
 
   <stdio>
b
diff -r 80a38d36f946 -r 9590fac86f63 checkformat_script.R
--- a/checkformat_script.R Thu Jan 11 10:24:56 2018 -0500
+++ b/checkformat_script.R Wed Feb 28 05:47:44 2018 -0500
[
b'@@ -82,20 +82,24 @@\n     if(nrow(datMN) != nrow(samDF)) {\n         if(nrow(datMN) > nrow(samDF)) {\n             print(setdiff(rownames(datMN), rownames(samDF)))\n-            stop("The sample names above from dataMatrix were not found in sampleMetadata")\n+            stop("The sample names above from dataMatrix were not found in sampleMetadata",\n+                 call. = FALSE)\n         } else {\n             print(setdiff(rownames(samDF), rownames(datMN)))\n-            stop("The sample names above from sampleMetadata were not found in dataMatrix")\n+            stop("The sample names above from sampleMetadata were not found in dataMatrix",\n+                 call. = FALSE)\n         }\n     }\n \n     if(ncol(datMN) != nrow(varDF)) {\n         if(ncol(datMN) > nrow(varDF)) {\n             print(setdiff(colnames(datMN), rownames(varDF)))\n-            stop("The variable names above from dataMatrix were not found in variableMetadata")\n+            stop("The variable names above from dataMatrix were not found in variableMetadata",\n+                 call. = FALSE)\n         } else {\n             print(setdiff(rownames(varDF), colnames(datMN)))\n-            stop("The variable names above from variableMetadata were not found in dataMatrix")\n+            stop("The variable names above from variableMetadata were not found in dataMatrix",\n+                 call. = FALSE)\n         }\n     }\n     \n@@ -181,191 +185,3 @@\n \n } ## end of checkAndReadF\n \n-\n-\n-\n-    ## if(!identical(rownames(datMN), rownames(samDF))) {\n-    ##     ## checking sample names\n-\n-    ##     chkL <- FALSE\n-\n-    ##     datSamDifVc <- setdiff(rownames(datMN), rownames(samDF))\n-\n-    ##     if(length(datSamDifVc)) {\n-    ##         cat("\\nThe following samples were found in the dataMatrix column names but not in the sampleMetadata row names:\\n", sep="")\n-    ##         print(cbind.data.frame(col = as.numeric(sapply(datSamDifVc, function(samC) which(rownames(datMN) == samC))),\n-    ##                                name = datSamDifVc))\n-    ##     }\n-\n-    ##     samDatDifVc <- setdiff(rownames(samDF), rownames(datMN))\n-\n-    ##     if(length(samDatDifVc)) {\n-    ##         cat("\\n\\nThe following samples were found in the sampleMetadata row names but not in the dataMatrix column names:\\n", sep="")\n-    ##         print(cbind.data.frame(row = as.numeric(sapply(samDatDifVc, function(samC) which(rownames(samDF) == samC))),\n-    ##                                name = samDatDifVc))\n-    ##     }\n-\n-    ##     if(nrow(datMN) != nrow(samDF)) {\n-    ##         cat("\\n\\nThe dataMatrix has ", nrow(datMN), " columns (ie samples) whereas the sampleMetadata has ", nrow(samDF), " rows\\n", sep="")\n-    ##     } else if(identical(gsub("^X", "", rownames(datMN)), rownames(samDF))) {\n-    ##         cat("\\n\\nThe dataMatrix column names start with an \'X\' but not the sampleMetadata row names\\n", sep="")\n-    ##     } else if(identical(gsub("^X", "", rownames(samDF)), rownames(datMN))) {\n-    ##         cat("\\n\\nThe sampleMetadata row names start with an \'X\' but not the dataMatrix column names\\n", sep="")\n-    ##     } else if(identical(sort(rownames(datMN)), sort(rownames(samDF)))) {\n-    ##         cat("\\n\\nThe dataMatrix column names and the sampleMetadata row names are not in the same order:\\n", sep="")\n-    ##         print(cbind.data.frame(indice = 1:nrow(datMN),\n-    ##                                dataMatrix_columnnames=rownames(datMN),\n-    ##                                sampleMetadata_rownames=rownames(samDF))[rownames(datMN) != rownames(samDF), , drop = FALSE])\n-    ##     } else {\n-    ##         cat("\\n\\nThe dataMatrix column names and the sampleMetadata row names are not identical:\\n", sep="")\n-    ##         print(cbind.data.frame(indice = 1:nrow(datMN),\n-    ##                                dataMatrix_columnnames=rownames(datMN),\n-    ##                                sampleMetadata_rownames=rownames(samDF))[rownames(datMN) != rownames(samDF), , drop = FALSE])\n-    ##     }\n-\n'..b'  ##                                name = samDatDifVc))\n-    ##     }\n-\n-    ##     if(nrow(datMN) != nrow(samDF)) {\n-    ##         cat("\\n\\nThe dataMatrix has ", nrow(datMN), " columns (ie samples) whereas the sampleMetadata has ", nrow(samDF), " rows\\n", sep="")\n-    ##     } else if(identical(gsub("^X", "", rownames(datMN)), rownames(samDF))) {\n-    ##         cat("\\n\\nThe dataMatrix column names start with an \'X\' but not the sampleMetadata row names\\n", sep="")\n-    ##     } else if(identical(gsub("^X", "", rownames(samDF)), rownames(datMN))) {\n-    ##         cat("\\n\\nThe sampleMetadata row names start with an \'X\' but not the dataMatrix column names\\n", sep="")\n-    ##     } else if(identical(sort(rownames(datMN)), sort(rownames(samDF)))) {\n-    ##         cat("\\n\\nThe dataMatrix column names and the sampleMetadata row names are not in the same order:\\n", sep="")\n-    ##         print(cbind.data.frame(indice = 1:nrow(datMN),\n-    ##                                dataMatrix_columnnames=rownames(datMN),\n-    ##                                sampleMetadata_rownames=rownames(samDF))[rownames(datMN) != rownames(samDF), , drop = FALSE])\n-    ##     } else {\n-    ##         cat("\\n\\nThe dataMatrix column names and the sampleMetadata row names are not identical:\\n", sep="")\n-    ##         print(cbind.data.frame(indice = 1:nrow(datMN),\n-    ##                                dataMatrix_columnnames=rownames(datMN),\n-    ##                                sampleMetadata_rownames=rownames(samDF))[rownames(datMN) != rownames(samDF), , drop = FALSE])\n-    ##     }\n-\n-    ## }\n-\n-\n-    ## if(!identical(colnames(datMN), rownames(varDF))) {\n-    ##     ## checking variable names\n-\n-    ##     chkL <- FALSE\n-\n-    ##     datVarDifVc <- setdiff(colnames(datMN), rownames(varDF))\n-\n-    ##     if(length(datVarDifVc)) {\n-    ##         cat("\\nThe following variables were found in the dataMatrix row names but not in the variableMetadata row names:\\n", sep="")\n-    ##         print(cbind.data.frame(row = as.numeric(sapply(datVarDifVc, function(varC) which(colnames(datMN) == varC))),\n-    ##                     name = datVarDifVc))\n-\n-    ##     }\n-\n-    ##     varDatDifVc <- setdiff(rownames(varDF), colnames(datMN))\n-\n-    ##     if(length(varDatDifVc)) {\n-    ##         cat("\\n\\nThe following variables were found in the variableMetadata row names but not in the dataMatrix row names:\\n", sep="")\n-    ##         print(cbind.data.frame(row = as.numeric(sapply(varDatDifVc, function(varC) which(rownames(varDF) == varC))),\n-    ##                     name = varDatDifVc))\n-    ##     }\n-\n-    ##     if(ncol(datMN) != nrow(varDF)) {\n-    ##         cat("\\n\\nThe dataMatrix has ", nrow(datMN), " rows (ie variables) whereas the variableMetadata has ", nrow(varDF), " rows\\n", sep="")\n-    ##     } else if(identical(sort(colnames(datMN)), sort(rownames(varDF)))) {\n-    ##         cat("\\n\\nThe dataMatrix row names and the variableMetadata row names are not in the same order:\\n", sep="")\n-    ##         print(cbind.data.frame(row = 1:ncol(datMN),\n-    ##                                dataMatrix_rownames=colnames(datMN),\n-    ##                                variableMetadata_rownames=rownames(varDF))[colnames(datMN) != rownames(varDF), , drop = FALSE])\n-    ##     } else {\n-    ##         cat("\\n\\nThe dataMatrix row names and the variableMetadata row names are not identical:\\n", sep="")\n-    ##         print(cbind.data.frame(row = 1:ncol(datMN),\n-    ##                                dataMatrix_rownames=colnames(datMN),\n-    ##                                variableMetadata_rownames=rownames(varDF))[colnames(datMN) != rownames(varDF), , drop = FALSE])\n-    ##     }\n-    ## }\n-## checkF <- function(datInpMN,\n-##                    samInpDF,\n-##                    varInpDF) {\n-\n-##     mode(datInpMN) == "numeric" &&\n-##         identical(rownames(datInpMN), rownames(samInpDF)) &&\n-##         identical(colnames(datInpMN), rownames(varInpDF))\n-    \n-\n-## }\n'