changeset 2:596320b84315 draft

planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 95d4658e5d9dd0421c9336b2232cc81f32879621
author ethevenot
date Thu, 11 Jan 2018 12:52:08 -0500
parents 6d3b7b6573d8
children acdf51018708
files README.md build.xml qualitymetrics_config.xml qualitymetrics_script.R runit/formatOrder/dataMatrix.tsv runit/formatOrder/sampleMetadata.tsv runit/formatOrder/variableMetadata.tsv runit/output/figure.pdf runit/output/information.txt runit/qualitymetrics_tests.R
diffstat 10 files changed, 180 insertions(+), 74 deletions(-) [+]
line wrap: on
line diff
--- a/README.md	Fri Oct 21 12:56:22 2016 -0400
+++ b/README.md	Thu Jan 11 12:52:08 2018 -0500
@@ -7,8 +7,8 @@
 
 ### Description
 
-**Version:** 2.2.6  
-**Date:** 2016-10-21  
+**Version:** 2.2.8  
+**Date:** 2018-01-11  
 **Author:** Marion Landi (INRA, PFEM), Mélanie Pétéra (INRA, PFEM), and Etienne A. Thévenot (CEA, LIST)  
 **Email:** [melanie.petera(at)clermont.inra.fr](mailto:melanie.petera@clermont.inra.fr), [etienne.thevenot(at)cea.fr](mailto:etienne.thevenot@cea.fr)  
 **Citation:**  
@@ -50,7 +50,13 @@
 install.packages('RUnit', dependencies = TRUE)
 ```
 
-### News
+### News  
+
+##### CHANGES IN VERSION 2.2.8  
+
+MINOR MODIFICATION  
+
+In the case of a distinct sample order between dataMatrix and sampleMetadata, the sample order from the dataMatrix is matched to sampleMetadata internally for the computations and graphics without modifying the order in the sampleMetadata output (a warning is generated in the information file); to get the re-ordered dataMatrix as output, please use the Check Format module  
 
 ##### CHANGES IN VERSION 2.2.6  
 
--- a/build.xml	Fri Oct 21 12:56:22 2016 -0400
+++ b/build.xml	Thu Jan 11 12:52:08 2018 -0500
@@ -30,13 +30,13 @@
 	~ PLANEMO TEST ~
 	~~~~~~~~~~~~~-->
 
-	<target name="planemo.test" depends="planemo.conda.install">
+	<target name="planemo.test">
 		<exec executable="planemo" failonerror="true">
 			<arg value="test"/>
 			<arg value="--conda_prefix"/>
 			<arg value="${conda.dir}"/>
 			<arg value="--galaxy_branch"/>
-			<arg value="release_16.07"/>
+			<arg value="release_17.05"/>
 			<arg value="--conda_dependency_resolution"/>
 			<arg value="${tool.xml}"/>
 		</exec>
--- a/qualitymetrics_config.xml	Fri Oct 21 12:56:22 2016 -0400
+++ b/qualitymetrics_config.xml	Thu Jan 11 12:52:08 2018 -0500
@@ -1,8 +1,7 @@
-<tool id="quality_metrics" name="Quality Metrics" version="2.2.6">
+<tool id="quality_metrics" name="Quality Metrics" version="2.2.8">
   <description>Metrics and graphics to check the quality of the data</description>
 
   <requirements>
-    <requirement type="package" version="3.3.1">R</requirement>    
     <requirement type="package">r-batch</requirement>
     <requirement type="package">bioconductor-ropls</requirement>
   </requirements>
@@ -180,9 +179,11 @@
 	|
 
 Note:
-	| Required formats for the dataMatrix, sampleMetadata, and variableMetadata files are described in the **HowTo** entitled 'Format Data For Postprocessing' available on the main page of Workflow4Metabolomics.org; the formats of the 3 tables can be further checked with the **Check Format** module
+	| **Required formats** for the dataMatrix, sampleMetadata, and variableMetadata files are described in the **HowTo** entitled 'Format Data For Postprocessing' available on the main page of Workflow4Metabolomics.org (http://web11.sb-roscoff.fr/download/w4m/howto/w4m_HowToFormatDataForPostprocessing_v02.pdf)
+	| The formats of the 3 tables can be further checked with the **Check Format** module
 	|
 
+
 Coefficient of Variation
 	| If 'yes' (not default): variables are classed according to the Coefficient of Variation (CV)
 	| i.e.: CV of pools (and CV of samples if needed) are calculated and compared to a defined threshold;
@@ -251,8 +252,16 @@
 NEWS
 ----
 
+CHANGES IN VERSION 2.2.8
+========================
+
+MINOR MODIFICATION
+
+In the case of a distinct sample order between dataMatrix and sampleMetadata, the sample order from the dataMatrix is matched to sampleMetadata internally for the computations and graphics without modifying the order in the sampleMetadata output (a warning is generated in the information file); to get the re-ordered dataMatrix as output, please use the Check Format module
+
 CHANGES IN VERSION 2.2.6
 ========================
+
 MINOR MODIFICATION
 
 Graphic: pool_CV inferior to 30%: pools with a NaN value are now counted as having a superior to 30% value (to avoid generating an NA metric value)
@@ -291,70 +300,8 @@
   Pages                    = {396-406},
   Volume                   = {29},
   }</citation>
+  <citation type="doi">10.1016/j.biocel.2017.07.002</citation>
   <citation type="doi">10.1093/bioinformatics/btu813</citation>
 </citations>
 
-<!--
-
-Input files
-===========
-
-| **To generate the "dataMatrix", "sampleMetadata" and "variableMetadata" files:**
-|   **1) copy/paste the values below in three distinct .txt files**
-|   **2) use the "Get Data" / "Upload File" in the "Tools" (left) panel from the Galaxy page by choosing:**
-|     **Convert spaces to tabs: 'Yes'**
-| 
-
-**dataMatrix file**::
-
-	dataMatrix QC_4 sam_44 sam_18 sam_23 blk_3 sam_9 sam_22 QC_6 blk_4
-	met_031 5601185.9 4446133.4 4144765.4 3085899.9 NA 6748534.9 5819543.8 3256720.3 NA
-	met_032 4.07 4.08 4.11 4.1 NA 4.04 4.13 4.11 NA
-	met_033 1448205184 1456986135 993364802.3 1162711600 5569143.2 1043559922 1465003454 1052094028 5247494.3
-	met_034 4.11 4.21 4.18 4.1 4.09 4.1 4.14 4.11 4.08
-	met_035 3777580.7 2296751 1890711.7 1767424.6 6567.5 1906253.5 3043253.9 2856958.5 7940.8
-	met_036 4.12 4.21 4.26 4.1 4.11 4.22 4.27 4.12 4.2
-	met_037 4982658.7 3751181.8 4219033.2 2425759.9 NA 11978184.4 4306459.5 3352187 NA
-	met_038 4.45 4.38 4.4 4.4 NA 4.44 4.46 4.32 NA
-	met_039 6658087.7 3231434.7 2932986.5 4098788.3 NA 3691132.6 6108614.4 4541941.9 NA
-	met_040 4.49 4.56 4.48 4.5 NA 4.45 4.54 4.46 NA
-	
-**sampleMetadata file**::
-
-	sampleMetadata injectionOrder batch sampleType
-	QC_4 19 batch1 pool
-	sam_44 20 batch1 sample
-	sam_18 23 batch1 sample
-	sam_23 27 batch1 sample
-	blk_3 31 batch1 blank
-	sam_9 34 batch1 sample
-	sam_22 38 batch1 sample
-	QC_6 42 batch1 pool
-	blk_4 43 batch1 blank
-
-**variableMetadata file**::
-
-	variableMetadata number
-	met_031 31
-	met_032 32
-	met_033 33
-	met_034 34
-	met_035 35
-	met_036 36
-	met_037 37
-	met_038 38
-	met_039 39
-	met_040 40
-
-Figure output
-=============
-
-| You should obtain with this very simplified dataset the following figure:
-|
-
-.. image:: qualitymetrics_workingExampleImage.png
-        :width: 600
-
--->
-
 </tool>
--- a/qualitymetrics_script.R	Fri Oct 21 12:56:22 2016 -0400
+++ b/qualitymetrics_script.R	Thu Jan 11 12:52:08 2018 -0500
@@ -488,7 +488,6 @@
         par(mar = marLs[["msd"]])
         plot(apply(datMN, 2, function(y) mean(y, na.rm = TRUE)),
              apply(datMN, 2, function(y) sd(y, na.rm = TRUE)),
-             col=obsColVc,
              pch = 18,
              xlab = "",
              ylab = "")
@@ -642,6 +641,8 @@
     ## Constants
     ##----------
 
+    modNamC <- "Quality Metrics" ## module name
+    
     epsN <- .Machine[["double.eps"]] ## [1] 2.22e-16
 
 
@@ -649,9 +650,40 @@
     ## Start
     ##------------------------------
 
-    if(!is.null(log.txtC))
+    if(!is.null(log.txtC)) {
+        
         sink(log.txtC)
+        
+        cat("\nStart of the '", modNamC, "' Galaxy module call: ",
+            format(Sys.time(), "%a %d %b %Y %X"), "\n", sep="")
 
+    }
+
+    
+    ## Checking the numerical type of the dataMatrix
+    ##----------------------------------------------
+
+
+    if(mode(datMN) != "numeric") {
+        sink()
+        stop("dataMatrix is not of numeric type;\ncheck your tables with the Check Format module\n",
+             call. = FALSE)
+    }
+
+    
+    ## Re-ordering dataMatrix samples if need (internally only)
+    ##---------------------------------------------------------
+
+    
+    if(!identical(rownames(datMN), samDF[, 1])) {
+
+        cat("\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!   WARNING   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\nThe sample order is not identical in dataMatrix and sampleMetadata;\nRe-ordering of the dataMatrix samples will be performed internally in this module\nfor the computation of the metrics,\nwithout changing the orders in the sampleMetadata output;\n\nTo get a re-ordered dataMatrix as output, please use the Check Format module\n\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n")
+
+        datMN <- datMN[samDF[, 1], , drop = FALSE]
+        
+    }
+
+    
     ## Description
     ##------------
 
@@ -885,8 +917,28 @@
     ##------------------------------
 
 
-    if(!is.null(log.txtC))
+    if(!is.null(log.txtC)) {
+
+        cat("\nEnd of '", modNamC, "' Galaxy module call: ",
+            as.character(Sys.time()), "\n", sep = "")
+
+        cat("\n\n\n============================================================================")
+        cat("\nAdditional information about the call:\n")
+        cat("\n1) Parameters:\n")
+        print(args)
+
+        cat("\n2) Session Info:\n")
+        sessioninfo <- sessionInfo()
+        cat(sessioninfo$R.version$version.string,"\n")
+        cat("Main packages:\n")
+        for (pkg in names(sessioninfo$otherPkgs)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n")
+        cat("Other loaded packages:\n")
+        for (pkg in names(sessioninfo$loadedOnly)) { cat(paste(pkg,packageVersion(pkg)),"\t") }; cat("\n")        
+
+        cat("============================================================================\n")
+        
         sink()
+    }
 
     options(stingsAsFactors = strAsFacL)
     options(warn = optWrnN)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/runit/formatOrder/dataMatrix.tsv	Thu Jan 11 12:52:08 2018 -0500
@@ -0,0 +1,11 @@
+dataMatrix	QC_4	sam_44	sam_18	sam_23	blk_3	sam_9	sam_22	QC_6	blk_4
+met_031	5601185.9	4446133.4	4144765.4	3085899.9	NA	6748534.9	5819543.8	3256720.3	NA
+met_032	4.07	4.08	4.11	4.1	NA	4.04	4.13	4.11	NA
+met_033	1448205184	1456986135	993364802.3	1162711600	5569143.2	1043559922	1465003454	1052094028	5247494.3
+met_034	4.11	4.21	4.18	4.1	4.09	4.1	4.14	4.11	4.08
+met_035	3777580.7	2296751	1890711.7	1767424.6	6567.5	1906253.5	3043253.9	2856958.5	7940.8
+met_036	4.12	4.21	4.26	4.1	4.11	4.22	4.27	4.12	4.2
+met_037	4982658.7	3751181.8	4219033.2	2425759.9	NA	11978184.4	4306459.5	3352187	NA
+met_038	4.45	4.38	4.4	4.4	NA	4.44	4.46	4.32	NA
+met_039	6658087.7	3231434.7	2932986.5	4098788.3	NA	3691132.6	6108614.4	4541941.9	NA
+met_040	4.49	4.56	4.48	4.5	NA	4.45	4.54	4.46	NA
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/runit/formatOrder/sampleMetadata.tsv	Thu Jan 11 12:52:08 2018 -0500
@@ -0,0 +1,10 @@
+sampleMetadata	injectionOrder	batch	sampleType
+sam_44	20	batch1	sample
+QC_4	19	batch1	pool
+sam_18	23	batch1	sample
+sam_23	27	batch1	sample
+blk_3	31	batch1	blank
+sam_9	34	batch1	sample
+sam_22	38	batch1	sample
+QC_6	42	batch1	pool
+blk_4	43	batch1	blank
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/runit/formatOrder/variableMetadata.tsv	Thu Jan 11 12:52:08 2018 -0500
@@ -0,0 +1,11 @@
+variableMetadata	number
+met_031	31
+met_032	32
+met_033	33
+met_034	34
+met_035	35
+met_036	36
+met_037	37
+met_038	38
+met_039	39
+met_040	40
Binary file runit/output/figure.pdf has changed
--- a/runit/output/information.txt	Fri Oct 21 12:56:22 2016 -0400
+++ b/runit/output/information.txt	Thu Jan 11 12:52:08 2018 -0500
@@ -1,3 +1,5 @@
+
+Start of the 'Quality Metrics' Galaxy module call: Thu 11 Jan 2018 06:23:47 PM
 
 
 Data description:
@@ -34,3 +36,53 @@
 Observations: Profile deciles
 
 Plotting
+
+End of 'Quality Metrics' Galaxy module call: 2018-01-11 18:23:47
+
+
+
+============================================================================
+Additional information about the call:
+
+1) Parameters:
+$dataMatrix_in
+[1] "./input/dataMatrix.tsv"
+
+$sampleMetadata_in
+[1] "./input/sampleMetadata.tsv"
+
+$variableMetadata_in
+[1] "./input/variableMetadata.tsv"
+
+$sampleMetadata_out
+[1] "./output/sampleMetadata.tsv"
+
+$variableMetadata_out
+[1] "./output/variableMetadata.tsv"
+
+$figure
+[1] "./output/figure.pdf"
+
+$information
+[1] "./output/information.txt"
+
+$CV
+[1] "FALSE"
+
+$Compa
+[1] TRUE
+
+$seuil
+[1] 1
+
+$poolAsPool1L
+[1] TRUE
+
+
+2) Session Info:
+R version 3.3.1 (2016-06-21) 
+Main packages:
+ropls 1.6.2 	batch 1.1.4 	
+Other loaded packages:
+parallel 3.3.1 	Biobase 2.34.0 	methods 3.3.1 	BiocGenerics 0.20.0 	
+============================================================================
--- a/runit/qualitymetrics_tests.R	Fri Oct 21 12:56:22 2016 -0400
+++ b/runit/qualitymetrics_tests.R	Thu Jan 11 12:52:08 2018 -0500
@@ -12,3 +12,20 @@
     checkEqualsNumeric(outLs[["varDF"]]["met_033", "blankMean_over_sampleMean"], 0.004417387, tolerance = 1e-6)
  
 }
+
+test_formatOrder <- function() {
+
+    ## two first samples swapped in sampleMetadata
+
+    testDirC <- "formatOrder"
+    argLs <- list(CV = "FALSE",
+                  Compa = "TRUE",
+                  seuil = 1,
+                  poolAsPool1L = "TRUE")
+
+    argLs <- c(defaultArgF(testDirC), argLs)
+    outLs <- wrapperCallF(argLs)
+
+    checkEqualsNumeric(outLs[["varDF"]]["met_033", "blankMean_over_sampleMean"], 0.004417387, tolerance = 1e-6)
+ 
+}