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

Changeset 3:140290de7986 (2016-10-30)
Previous changeset 2:09799fc16bc6 (2016-08-06) Next changeset 4:3017385625f6 (2018-01-11)
Commit message:
planemo upload for repository https://github.com/workflow4metabolomics/univariate.git commit 27bc6157f43574f038b3fb1be1f46ce4786e24b1
modified:
README.md
build.xml
runit/input/dataMatrix.tsv
runit/input/sampleMetadata.tsv
runit/input/variableMetadata.tsv
runit/output/information.txt
runit/output/variableMetadata.tsv
runit/univariate_runtests.R
runit/univariate_tests.R
test-data/dataMatrix.tsv
test-data/output-variableMetadata.tsv
test-data/sampleMetadata.tsv
test-data/variableMetadata.tsv
univariate_config.xml
univariate_script.R
univariate_wrapper.R
added:
runit/output/figure.pdf
b
diff -r 09799fc16bc6 -r 140290de7986 README.md
--- a/README.md Sat Aug 06 12:42:42 2016 -0400
+++ b/README.md Sun Oct 30 14:17:09 2016 -0400
[
@@ -7,8 +7,8 @@
 
 ### Description
 
-**Version:** 2.1.4   
-**Date:** 2016-08-05  
+**Version:** 2.2.0   
+**Date:** 2016-10-30  
 **Author:** Marie Tremblay-Franco (INRA, MetaToul, MetaboHUB, W4M Core Development Team) and Etienne A. Thevenot (CEA, LIST, MetaboHUB, W4M Core Development Team)    
 **Email:** [marie.tremblay-franco(at)toulouse.inra.fr](mailto:marie.tremblay-franco@toulouse.inra.fr); [etienne.thevenot(at)cea.fr](mailto:etienne.thevenot@cea.fr)  
 **Citation:** Thevenot E.A., Roux A., Xu Y., Ezan E. and Junot C. (2015). Analysis of the human adult urinary metabolome variations with age, body mass index and gender by implementing a comprehensive workflow for univariate and OPLS statistical analyses. *Journal of Proteome Research*, **14**:3322-3335. [doi:10.1021/acs.jproteome.5b00354](http://dx.doi.org/10.1021/acs.jproteome.5b00354)  
@@ -50,11 +50,25 @@
 
 ### News
 
+###### CHANGES IN VERSION 2.2.0  
+
+MAJOR MODIFICATION  
+
+ * ANOVA and Kruskal-Wallis: The p-values of the post-hoc tests (i.e. from pairwise comparisons) are now further corrected for multiple testing over all variables (previously, only the p-value of the -first- omnibus test was corrected over all variables)  
+
+MINOR MODIFICATION  
+
+ * All values in the 'dif', adjusted p-value, and 'sig' columns are now displayed (previously, the values were set to NA when the p-value of the omnibus test was not significant)  
+
+NEW FEATURE  
+
+ * Graphic: a single pdf file containing the graphics of all significant tests is now produced as '_figure.pdf' output: boxplots (respectively scatterplots with the regression line in red and the R2 value) are displayed when the factor of interest is qualitative (respectively quantitative). The corrected p-value is indicated in the title of each plot  
+
 ###### CHANGES IN VERSION 2.1.4
 
 NEW FEATURE  
 
-Level names are now separated by '.' instead of '-' previously in the column names of the output variableMetadata table (e.g., 'jour_ttest_J3.J10_fdr' instead of 'jour_ttest_J3-J10_fdr' previously)  
+ * Level names are now separated by '.' instead of '-' previously in the column names of the output variableMetadata table (e.g., 'jour_ttest_J3.J10_fdr' instead of 'jour_ttest_J3-J10_fdr' previously)  
 
 INTERNAL MODIFICATION  
 
b
diff -r 09799fc16bc6 -r 140290de7986 build.xml
--- a/build.xml Sat Aug 06 12:42:42 2016 -0400
+++ b/build.xml Sun Oct 30 14:17:09 2016 -0400
b
@@ -36,7 +36,7 @@
  <arg value="--conda_prefix"/>
  <arg value="${conda.dir}"/>
  <arg value="--galaxy_branch"/>
- <arg value="release_16.01"/>
+ <arg value="release_16.07"/>
  <arg value="--conda_dependency_resolution"/>
  <arg value="${tool.xml}"/>
  </exec>
b
diff -r 09799fc16bc6 -r 140290de7986 runit/input/dataMatrix.tsv
--- a/runit/input/dataMatrix.tsv Sat Aug 06 12:42:42 2016 -0400
+++ b/runit/input/dataMatrix.tsv Sun Oct 30 14:17:09 2016 -0400
b
@@ -1,4 +1,7 @@
-profile HU_017 HU_021 HU_027 HU_032 HU_041 HU_048 HU_049 HU_050 HU_052 HU_059 HU_060 HU_066 HU_072 HU_077 HU_090 HU_109 HU_110 HU_125 HU_126 HU_131 HU_134 HU_149 HU_150 HU_173 HU_179 HU_180 HU_182 HU_202 HU_204 HU_209
-HMDB01032 2569204.92420381 6222035.77434915 17070707.9912636 1258838.24348419 13039543.0754619 1909391.77026598 3495.09386434063 2293521.90928998 128503.275117713 81872.5276382213 8103557.56578035 149574887.036181 1544036.41049333 7103429.53933206 14138796.50382 4970265.57952158 263054.73056162 1671332.30008058 88433.1944958815 23602331.2894815 18648126.5206986 1554657.98756878 34152.3646391152 209372.71275317 33187733.370626 202438.591636003 13581070.0886437 354170.810678102 9120781.48986975 43419175.4051586
-HMDB03072 3628416.30251025 65626.9834353751 112170.118946651 3261804.34422417 42228.2787747563 343254.201250707 1958217.69317664 11983270.0435677 5932111.41638028 5511385.83359531 9154521.47755199 2632133.21209418 9500411.14556502 6551644.51726592 7204319.80891836 1273412.04795188 3260583.81592376 8932005.5351622 8340827.52597275 9256460.69197759 11217839.169041 5919262.81433556 11790077.0657915 9567977.80797097 73717.5811684739 9991787.29074293 4208098.14739633 623970.649925847 10904221.2642849 2171793.93621067
-HMDB00792 429568.609438384 3887629.50527037 1330692.11658995 1367446.73023821 844197.447472453 2948090.71886592 1614157.90566884 3740009.19379795 3292251.66531919 2310688.79492013 4404239.59008605 3043289.12780863 825736.467181043 2523241.91730649 6030501.02648005 474901.604069803 2885792.42617652 2955990.64049134 1917716.3427982 1767962.67737699 5926203.40397675 1639065.69474684 346810.763557826 1054776.22313737 2390258.27543894 1831346.37315857 1026696.36904362 7079792.50047866 4368341.01359769 3495986.87280275
+dataMatrix s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 s31 s32
+v1 7.416640524 6.9916690517 7.3404441347 7.0128372669 7.1702617447 6.820858055 7.2648178466 6.9561684785 7.2966652122 7.2695129676 7.2695129676 6.7986507145 6.9749720403 6.7788745443 7.0791812822 7.3617278549 7.4281348102 6.967548023 7.2304489469 6.6608655728 6.9614211415 6.8959747875 7.1398791179 7.2201081142 7.1673173643 6.6857418281 7.1789769761 6.7788745443 6.7291648707 6.7466342768 6.8954226013 6.9454686344
+v2 7.4563660483 6.9014583759 7.3873898441 6.9599948859 7.2095150414 6.7007038037 7.3159703664 6.8876173566 7.3010300174 7.2966652122 7.3138672415 6.7275413384 6.9863238219 6.7435098431 7.1038037552 7.3838153839 7.4409090978 6.7737865181 7.2174839705 6.48995862 6.8494194752 6.8344207673 7.1238516736 7.212187631 7.2041200098 6.6910815806 7.2900346336 6.7427252098 6.7185017719 6.6180482014 6.8512584099 6.9329808726
+v3 6.8785218529 6.7839036507 6.9025468337 7.0086002143 6.9314579215 6.8129134235 6.8305887328 7.0374265378 6.8767950339 6.8457180799 6.7888751864 6.9929951426 7.0374265378 6.8215135939 7.0718820441 6.809559782 6.8122447637 6.7795965634 6.8129134235 6.9599948859 6.8014037786 6.7355989795 6.8075350957 6.9929951426 6.7686381752 6.9339932144 6.7611758884 6.9740509489 6.9768083831 6.7058637978 6.9790929462 6.7032914641
+v4 7.1303338007 7.1398791179 7.0899051467 7.110589744 6.9947569885 6.9978231244 7.0374265378 7.1003705796 6.9698816903 6.8048207468 6.8543061025 6.6655810848 6.705008045 6.7275413384 6.7442930614 6.9498777528 7.1583625223 7.2013971516 7.1673173643 6.9169800999 7.1003705796 7.0453230179 7.0606978781 7.1003705796 7.0492180614 6.7693773999 6.7774268949 6.9211661027 6.8561245047 6.9656720182 7.0086002143 6.9758911823
+v5 7.0530784819 6.99122612 7.0569048894 6.9698816903 6.8603380665 6.8375885014 6.9633155586 7.0170333811 7.0681858989 6.9633155586 6.95375974 6.7481881046 6.7686381752 6.8175654357 6.8394781102 7.0492180614 7.1038037552 7.0681858989 7.0755469979 6.7259117139 6.9339932144 6.8948697121 6.9464523141 7.0043214168 6.9009131223 6.6875290504 6.7634280684 6.7209858267 6.6454223676 6.7923917595 6.7902852344 6.8312297579
+v6 6.9876663096 7.0969100478 7.1072100036 7.0569048894 7.0000000434 6.9973864281 7.0644580267 7.0863598663 7.0043214168 6.9772662582 6.9434945654 6.9680157607 6.9556877984 7.1553360678 6.9454686344 6.9309490821 7.0086002143 7.0334237957 7.0086002143 6.9206450535 7.0043214168 6.9749720403 6.9489018098 6.9400182049 6.8750613213 6.9434945654 6.9057959343 6.9614211415 6.9518230838 6.9415114823 6.9304396457 6.9304396457
b
diff -r 09799fc16bc6 -r 140290de7986 runit/input/sampleMetadata.tsv
--- a/runit/input/sampleMetadata.tsv Sat Aug 06 12:42:42 2016 -0400
+++ b/runit/input/sampleMetadata.tsv Sun Oct 30 14:17:09 2016 -0400
b
@@ -1,31 +1,33 @@
-sample age ageGroup
-HU_017 41 experienced
-HU_021 34 junior
-HU_027 37 experienced
-HU_032 38 experienced
-HU_041 28 junior
-HU_048 39 experienced
-HU_049 50 senior
-HU_050 30 junior
-HU_052 51 senior
-HU_059 81 senior
-HU_060 55 senior
-HU_066 25 junior
-HU_072 47 experienced
-HU_077 27 junior
-HU_090 46 experienced
-HU_109 32 junior
-HU_110 50 senior
-HU_125 58 senior
-HU_126 45 experienced
-HU_131 42 experienced
-HU_134 48 experienced
-HU_149 35 experienced
-HU_150 49 experienced
-HU_173 55 senior
-HU_179 33 junior
-HU_180 53 senior
-HU_182 43 experienced
-HU_202 42 experienced
-HU_204 31 junior
-HU_209 17.5 junior
+sampleMetadata quant qual
+s1 56 A
+s2 24 A
+s3 35 A
+s4 32 A
+s5 54 A
+s6 53 A
+s7 30 A
+s8 20 A
+s9 41 B
+s10 34 B
+s11 44 B
+s12 43 B
+s13 52 B
+s14 46 B
+s15 51 B
+s16 36 B
+s17 31 C
+s18 25 C
+s19 40 C
+s20 50 C
+s21 22 C
+s22 29 C
+s23 49 C
+s24 19 C
+s25 55 D
+s26 39 D
+s27 45 D
+s28 26 D
+s29 23 D
+s30 42 D
+s31 33 D
+s32 21 D
b
diff -r 09799fc16bc6 -r 140290de7986 runit/input/variableMetadata.tsv
--- a/runit/input/variableMetadata.tsv Sat Aug 06 12:42:42 2016 -0400
+++ b/runit/input/variableMetadata.tsv Sun Oct 30 14:17:09 2016 -0400
b
@@ -1,4 +1,7 @@
-variable name
-HMDB01032 Dehydroepiandrosterone sulfate
-HMDB03072 Quinic acid
-HMDB00792 Sebacic acid
+variableMetadata sample_mean
+v1 12620948.56
+v2 12661823.42
+v3 7680621.526
+v4 9901182.687
+v5 8311866.237
+v6 9792909.819
b
diff -r 09799fc16bc6 -r 140290de7986 runit/output/figure.pdf
b
Binary file runit/output/figure.pdf has changed
b
diff -r 09799fc16bc6 -r 140290de7986 runit/output/information.txt
--- a/runit/output/information.txt Sat Aug 06 12:42:42 2016 -0400
+++ b/runit/output/information.txt Sun Oct 30 14:17:09 2016 -0400
b
@@ -1,9 +1,11 @@
 
-Start of the 'Univariate' Galaxy module call: Sat 06 Aug 2016 06:22:18 PM
+Start of the 'Univariate' Galaxy module call: Sun 30 Oct 2016 07:06:06 PM
 
 Performing 'kruskal'
 
-The following 1 variable (33%) was found significant at the 0.05 level:
-HMDB01032
+The following 3 variables (50%) were found significant at the 0.05 level:
+v4
+v5
+v6
 
-End of 'Univariate' Galaxy module call: 2016-08-06 18:22:18
+End of 'Univariate' Galaxy module call: 2016-10-30 19:06:07
b
diff -r 09799fc16bc6 -r 140290de7986 runit/output/variableMetadata.tsv
--- a/runit/output/variableMetadata.tsv Sat Aug 06 12:42:42 2016 -0400
+++ b/runit/output/variableMetadata.tsv Sun Oct 30 14:17:09 2016 -0400
b
@@ -1,4 +1,7 @@
-variableMetadata name ageGroup_kruskal_fdr ageGroup_kruskal_sig ageGroup_kruskal_junior.experienced_dif ageGroup_kruskal_senior.experienced_dif ageGroup_kruskal_senior.junior_dif ageGroup_kruskal_junior.experienced_pva ageGroup_kruskal_senior.experienced_pva ageGroup_kruskal_senior.junior_pva ageGroup_kruskal_junior.experienced_sig ageGroup_kruskal_senior.experienced_sig ageGroup_kruskal_senior.junior_sig
-HMDB01032 Dehydroepiandrosterone sulfate 0.0117826825222329 1 7211389.71960377 -1703486.11807139 -8914875.83767516 0.204550960009346 0.123124593762726 0.00251932966039092 0 0 1
-HMDB03072 Quinic acid 0.461634758626427 0 -3747468.87812489 1512795.66143568 5260264.53956057 NA NA NA NA NA NA
-HMDB00792 Sebacic acid 0.469555338459932 0 1404223.43306179 959174.915801485 -445048.517260305 NA NA NA NA NA NA
+variableMetadata sample_mean qual_kruskal_fdr qual_kruskal_sig qual_kruskal_B.A_dif qual_kruskal_C.A_dif qual_kruskal_D.A_dif qual_kruskal_C.B_dif qual_kruskal_D.B_dif qual_kruskal_D.C_dif qual_kruskal_B.A_fdr qual_kruskal_C.A_fdr qual_kruskal_D.A_fdr qual_kruskal_C.B_fdr qual_kruskal_D.B_fdr qual_kruskal_D.C_fdr qual_kruskal_B.A_sig qual_kruskal_C.A_sig qual_kruskal_D.A_sig qual_kruskal_C.B_sig qual_kruskal_D.B_sig qual_kruskal_D.C_sig
+v1 12620948.56 0.147579228303049 0 0.0827976191000008 -0.0378359353499995 -0.254400932999999 -0.12063355445 -0.3371985521 -0.21656499765 0.999945671392641 0.99999320349658 0.185342280966466 0.997174540126794 0.401201067449129 0.580170916884995 0 0 0 0 0 0
+v2 12661823.42 0.246364577097618 0 0.11547952005 -0.0981193892499999 -0.2877631538 -0.2135989093 -0.40324267385 -0.18964376455 0.999945671392641 0.99999320349658 0.291618067987092 0.997174540126794 0.401201067449129 0.890397531402986 0 0 0 0 0 0
+v3 7680621.526 0.293234285978368 0 -0.0292777863999998 -0.0806444136 -0.0392186484999995 -0.0513666272000002 -0.00994086209999967 0.0414257651000005 0.999945671392641 0.99999320349658 0.593281055056761 0.997174540126794 0.593281055056761 0.999155846185138 0 0 0 0 0 0
+v4 9901182.687 0.000819466212247517 1 -0.32058095905 0.00523271645000012 -0.1517188027 0.3258136755 0.16886215635 -0.15695151915 0.0133536911280914 0.99999320349658 0.185342280966466 0.00430289478770107 0.593281055056761 0.143731083414931 1 0 0 1 0 0
+v5 8311866.237 0.0115079177714078 1 -0.0839349800499996 -0.00516703969999988 -0.203697253750001 0.0787679403499997 -0.119762273700001 -0.198530214050001 0.999945671392641 0.99999320349658 0.0336157236420893 0.997174540126794 0.401201067449129 0.073221827596323 0 0 1 0 0 0
+v6 9792909.819 0.00429379409695042 1 -0.0988296785000005 -0.0710347295000009 -0.124705894050001 0.0277949489999996 -0.0258762155500003 -0.0536711645499999 0.535700151485478 0.99999320349658 0.00294595180681068 0.997174540126794 0.401201067449129 0.302648332248575 0 0 1 0 0 0
b
diff -r 09799fc16bc6 -r 140290de7986 runit/univariate_runtests.R
--- a/runit/univariate_runtests.R Sat Aug 06 12:42:42 2016 -0400
+++ b/runit/univariate_runtests.R Sun Oct 30 14:17:09 2016 -0400
[
@@ -83,6 +83,7 @@
         defaultArgLs[["variableMetadata_in"]] <- file.path(dirname(scriptPathC), testInDirC, "variableMetadata.tsv")
 
     defaultArgLs[["variableMetadata_out"]] <- file.path(dirname(scriptPathC), testOutDirC, "variableMetadata.tsv")
+    defaultArgLs[["figure"]] <- file.path(dirname(scriptPathC), testOutDirC, "figure.pdf")
     defaultArgLs[["information"]] <- file.path(dirname(scriptPathC), testOutDirC, "information.txt")
 
     defaultArgLs
b
diff -r 09799fc16bc6 -r 140290de7986 runit/univariate_tests.R
--- a/runit/univariate_tests.R Sat Aug 06 12:42:42 2016 -0400
+++ b/runit/univariate_tests.R Sun Oct 30 14:17:09 2016 -0400
[
@@ -1,7 +1,24 @@
+test_input_anova <- function() {
+
+    testDirC <- "input"
+    argLs <- list(facC = "qual",
+                  tesC = "anova",
+                  adjC = "fdr",
+                  thrN = "0.05")
+
+    argLs <- c(defaultArgF(testDirC), argLs)
+    outLs <- wrapperCallF(argLs)
+
+    checkEqualsNumeric(outLs[["varDF"]]["v6", "qual_anova_fdr"], 1.924156e-03, tolerance = 1e-6)
+
+    checkEqualsNumeric(outLs[["varDF"]]["v4", "qual_anova_D.C_fdr"], 0.01102016, tolerance = 1e-6)
+
+}
+
 test_input_kruskal <- function() {
 
     testDirC <- "input"
-    argLs <- list(facC = "ageGroup",
+    argLs <- list(facC = "qual",
                   tesC = "kruskal",
                   adjC = "fdr",
                   thrN = "0.05")
@@ -9,7 +26,9 @@
     argLs <- c(defaultArgF(testDirC), argLs)
     outLs <- wrapperCallF(argLs)
 
-    checkEqualsNumeric(outLs[["varDF"]]["HMDB01032", "ageGroup_kruskal_senior.experienced_pva"], 0.1231246, tolerance = 1e-6)
+    checkEqualsNumeric(outLs[["varDF"]]["v4", "qual_kruskal_fdr"], 0.0008194662, tolerance = 1e-7)
+
+    checkEqualsNumeric(outLs[["varDF"]]["v6", "qual_kruskal_D.A_fdr"], 0.002945952, tolerance = 1e-7)
 
 }
 
b
diff -r 09799fc16bc6 -r 140290de7986 test-data/dataMatrix.tsv
--- a/test-data/dataMatrix.tsv Sat Aug 06 12:42:42 2016 -0400
+++ b/test-data/dataMatrix.tsv Sun Oct 30 14:17:09 2016 -0400
b
@@ -1,4 +1,7 @@
-profile HU_017 HU_021 HU_027 HU_032 HU_041 HU_048 HU_049 HU_050 HU_052 HU_059 HU_060 HU_066 HU_072 HU_077 HU_090 HU_109 HU_110 HU_125 HU_126 HU_131 HU_134 HU_149 HU_150 HU_173 HU_179 HU_180 HU_182 HU_202 HU_204 HU_209
-HMDB01032 2569204.92420381 6222035.77434915 17070707.9912636 1258838.24348419 13039543.0754619 1909391.77026598 3495.09386434063 2293521.90928998 128503.275117713 81872.5276382213 8103557.56578035 149574887.036181 1544036.41049333 7103429.53933206 14138796.50382 4970265.57952158 263054.73056162 1671332.30008058 88433.1944958815 23602331.2894815 18648126.5206986 1554657.98756878 34152.3646391152 209372.71275317 33187733.370626 202438.591636003 13581070.0886437 354170.810678102 9120781.48986975 43419175.4051586
-HMDB03072 3628416.30251025 65626.9834353751 112170.118946651 3261804.34422417 42228.2787747563 343254.201250707 1958217.69317664 11983270.0435677 5932111.41638028 5511385.83359531 9154521.47755199 2632133.21209418 9500411.14556502 6551644.51726592 7204319.80891836 1273412.04795188 3260583.81592376 8932005.5351622 8340827.52597275 9256460.69197759 11217839.169041 5919262.81433556 11790077.0657915 9567977.80797097 73717.5811684739 9991787.29074293 4208098.14739633 623970.649925847 10904221.2642849 2171793.93621067
-HMDB00792 429568.609438384 3887629.50527037 1330692.11658995 1367446.73023821 844197.447472453 2948090.71886592 1614157.90566884 3740009.19379795 3292251.66531919 2310688.79492013 4404239.59008605 3043289.12780863 825736.467181043 2523241.91730649 6030501.02648005 474901.604069803 2885792.42617652 2955990.64049134 1917716.3427982 1767962.67737699 5926203.40397675 1639065.69474684 346810.763557826 1054776.22313737 2390258.27543894 1831346.37315857 1026696.36904362 7079792.50047866 4368341.01359769 3495986.87280275
+dataMatrix s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 s31 s32
+v1 7.416640524 6.9916690517 7.3404441347 7.0128372669 7.1702617447 6.820858055 7.2648178466 6.9561684785 7.2966652122 7.2695129676 7.2695129676 6.7986507145 6.9749720403 6.7788745443 7.0791812822 7.3617278549 7.4281348102 6.967548023 7.2304489469 6.6608655728 6.9614211415 6.8959747875 7.1398791179 7.2201081142 7.1673173643 6.6857418281 7.1789769761 6.7788745443 6.7291648707 6.7466342768 6.8954226013 6.9454686344
+v2 7.4563660483 6.9014583759 7.3873898441 6.9599948859 7.2095150414 6.7007038037 7.3159703664 6.8876173566 7.3010300174 7.2966652122 7.3138672415 6.7275413384 6.9863238219 6.7435098431 7.1038037552 7.3838153839 7.4409090978 6.7737865181 7.2174839705 6.48995862 6.8494194752 6.8344207673 7.1238516736 7.212187631 7.2041200098 6.6910815806 7.2900346336 6.7427252098 6.7185017719 6.6180482014 6.8512584099 6.9329808726
+v3 6.8785218529 6.7839036507 6.9025468337 7.0086002143 6.9314579215 6.8129134235 6.8305887328 7.0374265378 6.8767950339 6.8457180799 6.7888751864 6.9929951426 7.0374265378 6.8215135939 7.0718820441 6.809559782 6.8122447637 6.7795965634 6.8129134235 6.9599948859 6.8014037786 6.7355989795 6.8075350957 6.9929951426 6.7686381752 6.9339932144 6.7611758884 6.9740509489 6.9768083831 6.7058637978 6.9790929462 6.7032914641
+v4 7.1303338007 7.1398791179 7.0899051467 7.110589744 6.9947569885 6.9978231244 7.0374265378 7.1003705796 6.9698816903 6.8048207468 6.8543061025 6.6655810848 6.705008045 6.7275413384 6.7442930614 6.9498777528 7.1583625223 7.2013971516 7.1673173643 6.9169800999 7.1003705796 7.0453230179 7.0606978781 7.1003705796 7.0492180614 6.7693773999 6.7774268949 6.9211661027 6.8561245047 6.9656720182 7.0086002143 6.9758911823
+v5 7.0530784819 6.99122612 7.0569048894 6.9698816903 6.8603380665 6.8375885014 6.9633155586 7.0170333811 7.0681858989 6.9633155586 6.95375974 6.7481881046 6.7686381752 6.8175654357 6.8394781102 7.0492180614 7.1038037552 7.0681858989 7.0755469979 6.7259117139 6.9339932144 6.8948697121 6.9464523141 7.0043214168 6.9009131223 6.6875290504 6.7634280684 6.7209858267 6.6454223676 6.7923917595 6.7902852344 6.8312297579
+v6 6.9876663096 7.0969100478 7.1072100036 7.0569048894 7.0000000434 6.9973864281 7.0644580267 7.0863598663 7.0043214168 6.9772662582 6.9434945654 6.9680157607 6.9556877984 7.1553360678 6.9454686344 6.9309490821 7.0086002143 7.0334237957 7.0086002143 6.9206450535 7.0043214168 6.9749720403 6.9489018098 6.9400182049 6.8750613213 6.9434945654 6.9057959343 6.9614211415 6.9518230838 6.9415114823 6.9304396457 6.9304396457
b
diff -r 09799fc16bc6 -r 140290de7986 test-data/output-variableMetadata.tsv
--- a/test-data/output-variableMetadata.tsv Sat Aug 06 12:42:42 2016 -0400
+++ b/test-data/output-variableMetadata.tsv Sun Oct 30 14:17:09 2016 -0400
b
@@ -1,4 +1,7 @@
-variableMetadata name ageGroup_kruskal_fdr ageGroup_kruskal_sig ageGroup_kruskal_junior.experienced_dif ageGroup_kruskal_senior.experienced_dif ageGroup_kruskal_senior.junior_dif ageGroup_kruskal_junior.experienced_pva ageGroup_kruskal_senior.experienced_pva ageGroup_kruskal_senior.junior_pva ageGroup_kruskal_junior.experienced_sig ageGroup_kruskal_senior.experienced_sig ageGroup_kruskal_senior.junior_sig
-HMDB01032 Dehydroepiandrosterone sulfate 0.0117826825222329 1 7211389.71960377 -1703486.11807139 -8914875.83767516 0.204550960009346 0.123124593762726 0.00251932966039092 0 0 1
-HMDB03072 Quinic acid 0.461634758626427 0 -3747468.87812489 1512795.66143568 5260264.53956057 NA NA NA NA NA NA
-HMDB00792 Sebacic acid 0.469555338459932 0 1404223.43306179 959174.915801485 -445048.517260305 NA NA NA NA NA NA
+variableMetadata sample_mean qual_kruskal_fdr qual_kruskal_sig qual_kruskal_B.A_dif qual_kruskal_C.A_dif qual_kruskal_D.A_dif qual_kruskal_C.B_dif qual_kruskal_D.B_dif qual_kruskal_D.C_dif qual_kruskal_B.A_fdr qual_kruskal_C.A_fdr qual_kruskal_D.A_fdr qual_kruskal_C.B_fdr qual_kruskal_D.B_fdr qual_kruskal_D.C_fdr qual_kruskal_B.A_sig qual_kruskal_C.A_sig qual_kruskal_D.A_sig qual_kruskal_C.B_sig qual_kruskal_D.B_sig qual_kruskal_D.C_sig
+v1 12620948.56 0.147579228303049 0 0.0827976191000008 -0.0378359353499995 -0.254400932999999 -0.12063355445 -0.3371985521 -0.21656499765 0.999945671392641 0.99999320349658 0.185342280966466 0.997174540126794 0.401201067449129 0.580170916884995 0 0 0 0 0 0
+v2 12661823.42 0.246364577097618 0 0.11547952005 -0.0981193892499999 -0.2877631538 -0.2135989093 -0.40324267385 -0.18964376455 0.999945671392641 0.99999320349658 0.291618067987092 0.997174540126794 0.401201067449129 0.890397531402986 0 0 0 0 0 0
+v3 7680621.526 0.293234285978368 0 -0.0292777863999998 -0.0806444136 -0.0392186484999995 -0.0513666272000002 -0.00994086209999967 0.0414257651000005 0.999945671392641 0.99999320349658 0.593281055056761 0.997174540126794 0.593281055056761 0.999155846185138 0 0 0 0 0 0
+v4 9901182.687 0.000819466212247517 1 -0.32058095905 0.00523271645000012 -0.1517188027 0.3258136755 0.16886215635 -0.15695151915 0.0133536911280914 0.99999320349658 0.185342280966466 0.00430289478770107 0.593281055056761 0.143731083414931 1 0 0 1 0 0
+v5 8311866.237 0.0115079177714078 1 -0.0839349800499996 -0.00516703969999988 -0.203697253750001 0.0787679403499997 -0.119762273700001 -0.198530214050001 0.999945671392641 0.99999320349658 0.0336157236420893 0.997174540126794 0.401201067449129 0.073221827596323 0 0 1 0 0 0
+v6 9792909.819 0.00429379409695042 1 -0.0988296785000005 -0.0710347295000009 -0.124705894050001 0.0277949489999996 -0.0258762155500003 -0.0536711645499999 0.535700151485478 0.99999320349658 0.00294595180681068 0.997174540126794 0.401201067449129 0.302648332248575 0 0 1 0 0 0
b
diff -r 09799fc16bc6 -r 140290de7986 test-data/sampleMetadata.tsv
--- a/test-data/sampleMetadata.tsv Sat Aug 06 12:42:42 2016 -0400
+++ b/test-data/sampleMetadata.tsv Sun Oct 30 14:17:09 2016 -0400
b
@@ -1,31 +1,33 @@
-sample age ageGroup
-HU_017 41 experienced
-HU_021 34 junior
-HU_027 37 experienced
-HU_032 38 experienced
-HU_041 28 junior
-HU_048 39 experienced
-HU_049 50 senior
-HU_050 30 junior
-HU_052 51 senior
-HU_059 81 senior
-HU_060 55 senior
-HU_066 25 junior
-HU_072 47 experienced
-HU_077 27 junior
-HU_090 46 experienced
-HU_109 32 junior
-HU_110 50 senior
-HU_125 58 senior
-HU_126 45 experienced
-HU_131 42 experienced
-HU_134 48 experienced
-HU_149 35 experienced
-HU_150 49 experienced
-HU_173 55 senior
-HU_179 33 junior
-HU_180 53 senior
-HU_182 43 experienced
-HU_202 42 experienced
-HU_204 31 junior
-HU_209 17.5 junior
+sampleMetadata quant qual
+s1 56 A
+s2 24 A
+s3 35 A
+s4 32 A
+s5 54 A
+s6 53 A
+s7 30 A
+s8 20 A
+s9 41 B
+s10 34 B
+s11 44 B
+s12 43 B
+s13 52 B
+s14 46 B
+s15 51 B
+s16 36 B
+s17 31 C
+s18 25 C
+s19 40 C
+s20 50 C
+s21 22 C
+s22 29 C
+s23 49 C
+s24 19 C
+s25 55 D
+s26 39 D
+s27 45 D
+s28 26 D
+s29 23 D
+s30 42 D
+s31 33 D
+s32 21 D
b
diff -r 09799fc16bc6 -r 140290de7986 test-data/variableMetadata.tsv
--- a/test-data/variableMetadata.tsv Sat Aug 06 12:42:42 2016 -0400
+++ b/test-data/variableMetadata.tsv Sun Oct 30 14:17:09 2016 -0400
b
@@ -1,4 +1,7 @@
-variable name
-HMDB01032 Dehydroepiandrosterone sulfate
-HMDB03072 Quinic acid
-HMDB00792 Sebacic acid
+variableMetadata sample_mean
+v1 12620948.56
+v2 12661823.42
+v3 7680621.526
+v4 9901182.687
+v5 8311866.237
+v6 9792909.819
b
diff -r 09799fc16bc6 -r 140290de7986 univariate_config.xml
--- a/univariate_config.xml Sat Aug 06 12:42:42 2016 -0400
+++ b/univariate_config.xml Sun Oct 30 14:17:09 2016 -0400
[
b'@@ -1,4 +1,4 @@\n-<tool id="Univariate" name="Univariate" version="2.1.4">\n+<tool id="Univariate" name="Univariate" version="2.2.0">\n   <description>Univariate statistics</description>\n   \n   <requirements>\n@@ -24,6 +24,7 @@\n   thrN "$thrN"\t  \n   \n   variableMetadata_out "$variableMetadata_out"\n+  figure "$figure"\n   information "$information"\n   ]]></command>\n   <inputs>\n@@ -54,6 +55,7 @@\n   \n   <outputs>\n     <data name="variableMetadata_out" label="${tool.name}_${variableMetadata_in.name}" format="tabular" ></data>\n+    <data name="figure" label="${tool.name}_figure.pdf" format="pdf"/>\n     <data name="information" label="${tool.name}_information.txt" format="txt"/>\n   </outputs>\n   \n@@ -62,7 +64,7 @@\n       <param name="dataMatrix_in" value="dataMatrix.tsv"/>\n       <param name="sampleMetadata_in" value="sampleMetadata.tsv"/>\n       <param name="variableMetadata_in" value="variableMetadata.tsv"/>\n-      <param name="facC" value="ageGroup"/>\n+      <param name="facC" value="qual"/>\n       <param name="tesC" value="kruskal"/>\n       <param name="adjC" value="fdr"/>\n       <param name="thrN" value="0.05"/>\n@@ -71,7 +73,7 @@\n   </tests>\n   \n   <help>\n-\n+    \n .. class:: infomark\n \n | **Tool update: See the \'NEWS\' section at the bottom of the page**\n@@ -188,12 +190,16 @@\n \t\n variableMetadata_out.tabular\n \t| **variableMetadata** file identical to the file given as argument, except that (at least) three columns have been added:\n-\t| 1) [factor]_[test]_[class\'a\']-[class\'b\']_dif or [factor]_[test]_cor: difference of the means (ttest) or the medians (wilcoxon) between the two classes, or \'pearson\' or \'spearman\' correlations\n-\t| 2) [factor]_[test]_[class\'a\']-[class\'b\']_[method] or [factor]_[test]_[method]: adjusted p-values\n-\t| 3) [factor]_[test]_[class\'a\']-[class\'b\']_sig or [factor]_[test]_sig: significance (coded as \'1\' if below the threshold and \'0\' otherwise)\n-\t| In the case of \'anova\' and \'kruskal\', the columns 2) and 3) appear first to give the results from the ANOVA or Kruskal Wallis test, and, when these tests are significant, the results of the pairwise comparisons are reported in additional columns (otherwise NA in these columns): in the case of ANOVA, the Tukey HSD post-hoc analysis is used (for each comparison, the difference between means, p value, and significance are provided); in the case of Kruskal Wallis, the Nemenyi is performed (PMCMR package) (for each pairwise comparison, the difference between medians, p value and significance are provided)\n+\t| 1) [factor]_[test]_[class\'a\'].[class\'b\']_dif or [factor]_[test]_cor: difference of the means (ttest) or the medians (wilcoxon) between the two classes, or \'pearson\' or \'spearman\' correlations\n+\t| 2) [factor]_[test]_[class\'a\'].[class\'b\']_[method] or [factor]_[test]_[method]: adjusted p-values\n+\t| 3) [factor]_[test]_[class\'a\'].[class\'b\']_sig or [factor]_[test]_sig: significance (coded as \'1\' if below the threshold and \'0\' otherwise)\n+\t| In the case of \'anova\' and \'kruskal\', the columns 2) and 3) appear first to give the results from the ANOVA or Kruskal Wallis test, and then the results of the pairwise comparisons are reported in additional columns (otherwise NA in these columns): in the case of ANOVA, the Tukey HSD post-hoc analysis is used (for each comparison, the difference between means, p value, and significance are provided); in the case of Kruskal Wallis, the Nemenyi is performed (PMCMR package) (for each pairwise comparison, the difference between medians, p value and significance are provided); note that since version 2.2.0, the p-values of the post-hoc pairwise comparisons (ANOVA or Kruskal) are further corrected for multiple testing over all variables (as the p-value of the omnibus test in column 2)\n \t|\n \t\n+figure.pdf\n+\t| File containing the graphics of all significant tests: boxplots (respectively scatterplots with the regression line in red and the R2 value) are displayed when the factor of interest is qualitative (respectively quantitative). The variable name'..b'1804.34422417 42228.2787747563 343254.201250707 1958217.69317664 11983270.0435677 5932111.41638028 5511385.83359531 9154521.47755199 2632133.21209418 9500411.14556502 6551644.51726592 7204319.80891836 1273412.04795188 3260583.81592376 8932005.5351622 8340827.52597275 9256460.69197759 11217839.169041 5919262.81433556 11790077.0657915 9567977.80797097 73717.5811684739 9991787.29074293 4208098.14739633 623970.649925847 10904221.2642849 2171793.93621067\n-\tHMDB00792 429568.609438384 3887629.50527037 1330692.11658995 1367446.73023821 844197.447472453 2948090.71886592 1614157.90566884 3740009.19379795 3292251.66531919 2310688.79492013 4404239.59008605 3043289.12780863 825736.467181043 2523241.91730649 6030501.02648005 474901.604069803 2885792.42617652 2955990.64049134 1917716.3427982 1767962.67737699 5926203.40397675 1639065.69474684 346810.763557826 1054776.22313737 2390258.27543894 1831346.37315857 1026696.36904362 7079792.50047866 4368341.01359769 3495986.87280275\n-\n-\t\n-**sampleMetadata file**::\n-\n-\tsampleMetadata age ageGrp\n-\tHU_017 41 experienced\n-\tHU_021 34 junior\n-\tHU_027 37 experienced\n-\tHU_032 38 experienced\n-\tHU_041 28 junior\n-\tHU_048 39 experienced\n-\tHU_049 50 senior\n-\tHU_050 30 junior\n-\tHU_052 51 senior\n-\tHU_059 81 senior\n-\tHU_060 55 senior\n-\tHU_066 25 junior\n-\tHU_072 47 experienced\n-\tHU_077 27 junior\n-\tHU_090 46 experienced\n-\tHU_109 32 junior\n-\tHU_110 50 senior\n-\tHU_125 58 senior\n-\tHU_126 45 experienced\n-\tHU_131 42 experienced\n-\tHU_134 48 experienced\n-\tHU_149 35 experienced\n-\tHU_150 49 experienced\n-\tHU_173 55 senior\n-\tHU_179 33 junior\n-\tHU_180 53 senior\n-\tHU_182 43 experienced\n-\tHU_202 42 experienced\n-\tHU_204 31 junior\n-\tHU_209 17.5 junior\n-\n-\t\n-**variableMetadata file**::\n-\n-\tvariableMetadata name\n-\tHMDB01032        Dehydroepiandrosterone sulfate\n-\tHMDB03072        Quinic acid\n-\tHMDB00792        Sebacic acid\n-\n-\t\n-Parameters\n-==========\n-\n-**Factor of interest:** "ageGroup"\n-\n-**Test:** "Kruskal-Wallis rank test (qualitative, > 2 levels)"\n- \n-**Method for multiple testing correction:** "fdr"\n-\n-**(Corrected) p-value significance threshold:** 0.05\n-\n-\n-Output files\n-============\n-\n-+------------------------------+------------+\n-| File                         |   Format   |\n-+==============================+============+\n-| 1)  dataMatrix               |   tabular  |\n-+------------------------------+------------+\n-| 2)  sampleMetadata           |   tabular  |\n-+------------------------------+------------+\n-| 3)  variableMetadata         |   tabular  |\n-+------------------------------+------------+\n-| 4)  information              |    text    |\n-+------------------------------+------------+\n-\n-\n----------------------------------------------------\n-\n-\n+    \n+  </help>\n+  \n+  <citations>\n+    <citation type="bibtex">@Manual{,\n+    title = {R: A Language and Environment for Statistical Computing},\n+    author = {{R Core Team}},\n+    organization = {R Foundation for Statistical Computing},\n+    address = {Vienna, Austria},\n+    year = {2016},\n+    url = {https://www.R-project.org/},\n+    }</citation>\n+    <citation type="bibtex">@Article{Thevenot2015,\n+    Title                    = {Analysis of the human adult urinary metabolome variations with age, body mass index and gender by implementing a comprehensive workflow for univariate and OPLS statistical analyses},\n+    Author                   = {Thevenot, Etienne A. and Roux, Aurelie and Xu, Ying and Ezan, Eric and Junot, Christophe},\n+    Journal                  = {Journal of Proteome Research},\n+    Year                     = {2015},\n+    Note                     = {PMID: 26088811},\n+    Number                   = {8},\n+    Pages                    = {3322-3335},\n+    Volume                   = {14},\n+    \n+    Doi                      = {10.1021/acs.jproteome.5b00354},\n+    Url                      = {http://pubs.acs.org/doi/full/10.1021/acs.jproteome.5b00354}\n+    }</citation>\n+    <citation type="doi">10.1093/bioinformatics/btu813</citation>\n+  </citations>\n+  \n </tool>\n'
b
diff -r 09799fc16bc6 -r 140290de7986 univariate_script.R
--- a/univariate_script.R Sat Aug 06 12:42:42 2016 -0400
+++ b/univariate_script.R Sun Oct 30 14:17:09 2016 -0400
[
b'@@ -4,16 +4,18 @@\n                         facC,\n                         tesC = c("ttest", "wilcoxon", "anova", "kruskal", "pearson", "spearman")[1],\n                         adjC = c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none")[7],\n-                        thrN = 0.05) {\n+                        thrN = 0.05,\n+                        pdfC) {\n \n \n     ## Option\n-    ##---------------\n \n     strAsFacL <- options()$stringsAsFactors\n     options(stingsAsFactors = FALSE)\n     options(warn = -1)\n \n+    ## Getting the response (either a factor or a numeric)\n+\n     if(mode(samDF[, facC]) == "character") {\n         facFcVn <- factor(samDF[, facC])\n         facLevVc <- levels(facFcVn)\n@@ -24,8 +26,10 @@\n \n     varPfxC <- paste0(make.names(facC), "_", tesC, "_")\n \n+    \n     if(tesC %in% c("ttest", "wilcoxon", "pearson", "spearman")) {\n \n+        \n         switch(tesC,\n                ttest = {\n                    staF <- function(y) diff(tapply(y, facFcVn, function(x) mean(x, na.rm = TRUE)))\n@@ -46,61 +50,168 @@\n \n         staVn <- apply(datMN, 2, staF)\n \n-        fdrVn <- p.adjust(apply(datMN,\n+        adjVn <- p.adjust(apply(datMN,\n                                 2,\n                                 tesF),\n                           method = adjC)\n \n-        sigVn <- as.numeric(fdrVn < thrN)\n+        sigVn <- as.numeric(adjVn < thrN)\n \n         if(tesC %in% c("ttest", "wilcoxon"))\n             varPfxC <- paste0(varPfxC, paste(rev(facLevVc), collapse = "."), "_")\n \n         varDF[, paste0(varPfxC, ifelse(tesC %in% c("ttest", "wilcoxon"), "dif", "cor"))] <- staVn\n \n-        varDF[, paste0(varPfxC, adjC)] <- fdrVn\n+        varDF[, paste0(varPfxC, adjC)] <- adjVn\n \n         varDF[, paste0(varPfxC, "sig")] <- sigVn\n \n+        ## graphic\n+\n+        pdf(pdfC, onefile = TRUE)\n+\n+        varVi <- which(sigVn > 0)\n+\n+        if(tesC %in% c("ttest", "wilcoxon")) {\n+\n+            facVc <- as.character(facFcVn)\n+            names(facVc) <- rownames(samDF)\n+\n+            for(varI in varVi) {\n+                \n+                varC <- rownames(varDF)[varI]\n+                \n+                boxF(facFcVn,\n+                     datMN[, varI],\n+                     paste0(varC, " (", adjC, " = ", signif(adjVn[varI], 2), ")"),\n+                     facVc)\n+                \n+            }\n+\n+        } else { ## pearson or spearman\n+\n+            for(varI in varVi) {\n+\n+                varC <- rownames(varDF)[varI]\n+\n+                mod <- lm(datMN[, varI] ~  facFcVn)\n+\n+                plot(facFcVn, datMN[, varI],\n+                     xlab = facC,\n+                     ylab = "",\n+                     pch = 18,\n+                     main = paste0(varC, " (", adjC, " = ", signif(adjVn[varI], 2), ", R2 = ", signif(summary(mod)$r.squared, 2), ")"))\n+            \n+                abline(mod, col = "red")\n+\n+                }\n+\n+        }\n+\n+        dev.off()\n+\n+        \n     } else if(tesC == "anova") {\n \n+        \n         ## getting the names of the pairwise comparisons \'class1Vclass2\'\n         prwVc <- rownames(TukeyHSD(aov(datMN[, 1] ~ facFcVn))[["facFcVn"]])\n \n         prwVc <- gsub("-", ".", prwVc, fixed = TRUE) ## 2016-08-05: \'-\' character in dataframe column names seems not to be converted to "." by write.table on ubuntu R-3.3.1\n \n+        ## omnibus and post-hoc tests\n+        \n         aovMN <- t(apply(datMN, 2, function(varVn) {\n \n             aovMod <- aov(varVn ~ facFcVn)\n             pvaN <- summary(aovMod)[[1]][1, "Pr(>F)"]\n             hsdMN <- TukeyHSD(aovMod)[["facFcVn"]]\n-            c(pvaN, c(hsdMN[, c("diff", "p adj")]), as.numeric(hsdMN[, "p adj"] < thrN))\n+            c(pvaN, c(hsdMN[, c("diff", "p adj")]))\n \n         }))\n \n-        aovMN[, 1] <- p.adjust(aovMN[, 1], method = adjC)\n-        sigVn <-  as.numeric(aovMN[, 1] < thrN)\n-        aovMN <- cbind(aovMN[, 1], sigVn, aovMN[, 2:ncol(aovMN)])\n-        ## aovMN[which(aovMN[, 2] < 1), (3 + length(prwVc)):ncol(aovMN)] <- NA\n-        colnames(aovMN) <- past'..b'mMN)[c(col(nemMN))][nemVl])\n         nemNamVc <- paste0(nemClaMC[, 1], ".", nemClaMC[, 2])\n-        nemNamVc <- paste0(varPfxC, nemNamVc)\n+        pfxNemVc <- paste0(varPfxC, nemNamVc)\n+\n+        ## omnibus and post-hoc tests\n         \n         nemMN <- t(apply(datMN, 2, function(varVn) {\n \n@@ -109,17 +220,24 @@\n             c(pvaN, c(varNemMN))\n \n         }))\n-        pvaVn <- nemMN[, 1]\n-        fdrVn <- p.adjust(pvaVn, method = adjC)\n-        sigVn <- as.numeric(fdrVn < thrN)\n+\n+        ## correction for multiple testing\n+        \n+        nemMN <- apply(nemMN, 2,\n+                       function(pvaVn) p.adjust(pvaVn, method = adjC))\n+        adjVn <- nemMN[, 1]\n+        sigVn <- as.numeric(adjVn < thrN)\n         nemMN <- nemMN[, c(FALSE, nemVl)]\n-        colnames(nemMN) <- paste0(nemNamVc, "_pva")\n+        colnames(nemMN) <- paste0(pfxNemVc, "_", adjC)\n+\n+        ## significance coding (0 = not significant, 1 = significant)\n+        \n         nemSigMN <- nemMN < thrN\n         mode(nemSigMN) <- "numeric"\n-        colnames(nemSigMN) <- paste0(nemNamVc, "_sig")\n-        nemMN[sigVn < 1, ] <- NA\n-        nemSigMN[sigVn < 1, ] <- NA\n+        colnames(nemSigMN) <- paste0(pfxNemVc, "_sig")\n \n+        ## difference of the medians for each pairwise comparison\n+        \n         difMN <- sapply(1:nrow(nemClaMC), function(prwI) {\n             prwVc <- nemClaMC[prwI, ]\n             prwVi <- which(facFcVn %in% prwVc)\n@@ -128,13 +246,52 @@\n         })\n         colnames(difMN) <- gsub("_sig", "_dif", colnames(nemSigMN))\n \n-        nemMN <- cbind(fdrVn, sigVn, difMN, nemMN, nemSigMN)\n-        colnames(nemMN)[1:2] <- paste0(varPfxC, c(adjC, "sig"))\n+        ## final aggregated table\n+        \n+        resMN <- cbind(adjVn, sigVn, difMN, nemMN, nemSigMN)\n+        colnames(resMN)[1:2] <- paste0(varPfxC, c(adjC, "sig"))\n+\n+        varDF <- cbind.data.frame(varDF, as.data.frame(resMN))\n+\n+        ## graphic\n+\n+        pdf(pdfC, onefile = TRUE)\n+        \n+        for(varI in 1:nrow(varDF)) {\n+            \n+            if(sum(nemSigMN[varI, ]) > 0) {\n+                \n+                varC <- rownames(varDF)[varI]\n \n-        varDF <- cbind.data.frame(varDF, as.data.frame(nemMN))\n+                boxplot(datMN[, varI] ~ facFcVn,\n+                        main = paste0(varC, " (", adjC, " = ", signif(adjVn[varI], 2), ")"))\n+                \n+                for(nemI in 1:length(nemNamVc)) {\n+                    \n+                    if(nemSigMN[varI, paste0(varPfxC, nemNamVc[nemI], "_sig")] == 1) {\n+                        \n+                        nemClaVc <- nemClaMC[nemI, ]\n+                        nemClaVl <- facFcVn %in% nemClaVc\n+                        nemFc <- facFcVn[nemClaVl, drop = TRUE]\n+                        nemVc <- as.character(nemFc)\n+                        names(nemVc) <- rownames(samDF)[nemClaVl]\n+                        boxF(nemFc,\n+                             datMN[nemClaVl, varI],\n+                             paste0(varC, " (", adjC, " = ", signif(nemMN[varI, paste0(varPfxC, nemNamVc[nemI], "_", adjC)], 2), ")"),\n+                             nemVc)\n+                        \n+                    }\n+                       \n+                }\n+                \n+            }\n+            \n+        }\n \n+        dev.off()\n+        \n     }\n-\n+    \n     names(sigVn) <- rownames(varDF)\n     sigSumN <- sum(sigVn, na.rm = TRUE)\n     if(sigSumN) {\n@@ -148,3 +305,28 @@\n     return(varDF)\n \n }\n+\n+\n+boxF <- function(xFc,\n+                 yVn,\n+                 maiC,\n+                 xVc) {\n+    \n+    boxLs <- boxplot(yVn ~  xFc,\n+                     main = maiC)\n+    \n+    outVn <- boxLs[["out"]]\n+    \n+    if(length(outVn)) {\n+        \n+        for(outI in 1:length(outVn)) {\n+            levI <- which(levels(xFc) == xVc[names(outVn)[outI]])\n+            text(levI,\n+                 outVn[outI],\n+                 labels = names(outVn)[outI],\n+                 pos = ifelse(levI == 2, 2, 4))\n+            }\n+        \n+    }\n+    \n+}\n'
b
diff -r 09799fc16bc6 -r 140290de7986 univariate_wrapper.R
--- a/univariate_wrapper.R Sat Aug 06 12:42:42 2016 -0400
+++ b/univariate_wrapper.R Sun Oct 30 14:17:09 2016 -0400
[
@@ -119,7 +119,8 @@
                      facC = argVc["facC"],
                      tesC = tesC,
                      adjC = argVc["adjC"],
-                     thrN = as.numeric(argVc["thrN"]))
+                     thrN = as.numeric(argVc["thrN"]),
+                     pdfC = argVc["figure"])
 
 
 ##------------------------------