changeset 10:9a52306991b3 draft

planemo upload for repository https://github.com/HegemanLab/w4mcorcov_galaxy_wrapper/tree/master commit 5aeb583ae4a55cc24289f9d95590e02553a89552
author eschen42
date Sat, 01 Sep 2018 11:33:03 -0400
parents 06c51af11531
children ddcc33ff3205
files w4mcorcov.xml w4mcorcov_input.R
diffstat 2 files changed, 82 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/w4mcorcov.xml	Fri Aug 10 11:15:31 2018 -0400
+++ b/w4mcorcov.xml	Sat Sep 01 11:33:03 2018 -0400
@@ -1,4 +1,4 @@
-<tool id="w4mcorcov" name="OPLS-DA_Contrasts" version="0.98.13">
+<tool id="w4mcorcov" name="OPLS-DA_Contrasts" version="0.98.14">
     <description>OPLS-DA Contrasts of Univariate Results</description>
     <macros>
         <xml name="paramPairSigFeatOnly">
@@ -68,7 +68,16 @@
             type="data" help="variable metadata, one row per variable" />
         <param name="facC" type="text"
             label="Factor of interest"
-            help="REQUIRED - The name of the column of sampleMetadata corresponding to the qualitative variable used to define the contrasts.  Except when the 'Univariate Significance-test' is set to 'none', this also must be a portion of the column names in the variableMetadata file."/>
+            help="REQUIRED - The name of the column of sampleMetadata corresponding to the qualitative variable used to define the contrasts.  Except when the 'Univariate Significance-test' is set to 'none', this also must be a portion of the column names in the variableMetadata file.">
+            <sanitizer>
+                <valid initial="string.letters">
+                    <add preset="string.digits"/>
+                    <add value="&#46;"    /> <!-- dot, period -->
+                    <add value="&#95;"    /> <!-- underscore -->
+                    <!-- R does not permit dashes in column names; neither does SQL -->
+                </valid>
+            </sanitizer>
+        </param>
         <conditional name="signif_test">
             <param name="tesC" label="Univariate significance-test" type="select" help="Either 'none' or the name of the statistical test that was run by the 'Univariate' tool to produce the variableMetadata file; that name must also be a portion of the column names in that file.">
                 <option value="none">none - Display all features from variableMetadata (rather than choosing a subset based on significance in univariate testing)</option>
@@ -111,6 +120,7 @@
                     <add value="&#92;"  /> <!-- \ whack, backslash -->
                     <add value="&#93;"  /> <!-- ] r-squib, right-squre-bracket -->
                     <add value="&#94;"  /> <!-- ^ hat, caret -->
+                    <add value="&#95;"  /> <!-- underscore -->
                     <add value="&#123;" /> <!-- { l-cube, left-curly-bracket -->
                     <add value="&#124;" /> <!-- | pipe -->
                     <add value="&#125;" /> <!-- } r-cube, right-curly-bracket -->
@@ -119,8 +129,8 @@
             </sanitizer>
         </param>
         <param name="matchingC" label="Level-name matching" type="select" help="How to specify level-names generically. (See help below for details on using wild cards or regular expressions.)">
-            <option value="none">do no generic matching (default)</option>
-            <option value="wildcard" selected="true">use wild-cards for matching level-names</option>
+            <option value="none">do no generic matching</option>
+            <option value="wildcard" selected="true">use wild-cards for matching level-names (default)</option>
             <option value="regex">use regular expressions for matching level-names</option>
         </param>
         <param name="labelFeatures" type="text" value="3"
@@ -311,6 +321,7 @@
           <has_text text="0.0488654" />
         </assert_contents>
       </output>
+      <!-- test #4 -->
       <output name="contrast_salience">
         <assert_contents>
           <!-- column-labels line -->
@@ -386,6 +397,70 @@
         </assert_contents>
       </output>
     </test>
+    <!-- test #5 -->
+    <test>
+      <param name="dataMatrix_in" value="input_dataMatrix.tsv"/>
+      <param name="sampleMetadata_in" value="issue6_input_sampleMetadata.tsv"/>
+      <param name="variableMetadata_in" value="input_variableMetadata.tsv"/>
+      <param name="tesC" value="none"/>
+      <param name="facC" value="k._10"/>
+      <param name="labelFeatures" value="3"/>
+      <param name="levCSV" value="k1,k.2"/>
+      <param name="matchingC" value="none"/>
+      <output name="contrast_corcov">
+        <assert_contents>
+          <!-- column-labels line -->
+          <has_text text="featureID" />
+          <has_text text="factorLevel1" />
+          <has_text text="factorLevel2" />
+          <has_text text="correlation" />
+          <has_text text="covariance" />
+          <has_text text="vip4p" />
+          <has_text text="vip4o" />
+          <!-- first matched line -->
+          <has_text text="M349.2383T700" />
+          <has_text text="-0.37867079" />
+          <has_text text="-37.71066" />
+          <has_text text="0.5246766" />
+          <has_text text="0.0103341" />
+          <!-- second matched line -->
+          <has_text text="M207.9308T206" />
+          <has_text text="0.31570433" />
+          <has_text text="5.86655640" />
+          <has_text text="0.2111623" />
+          <has_text text="0.0488654" />
+        </assert_contents>
+      </output>
+    </test>
+    <!-- test #6 -->
+    <test>
+      <param name="dataMatrix_in" value="input_dataMatrix.tsv"/>
+      <param name="sampleMetadata_in" value="issue6_input_sampleMetadata.tsv"/>
+      <param name="variableMetadata_in" value="input_variableMetadata.tsv"/>
+      <param name="tesC" value="none"/>
+      <param name="facC" value="k._10"/>
+      <param name="labelFeatures" value="3"/>
+      <param name="levCSV" value="k_3,k-4"/>
+      <param name="matchingC" value="none"/>
+      <output name="contrast_corcov">
+        <assert_contents>
+          <!-- column-labels line -->
+          <has_text text="featureID" />
+          <has_text text="factorLevel1" />
+          <has_text text="factorLevel2" />
+          <has_text text="correlation" />
+          <has_text text="covariance" />
+          <has_text text="vip4p" />
+          <has_text text="vip4o" />
+          <!-- first matched line -->
+          <has_text text="M349.2383T700" />
+          <has_text text="-0.0435663" />
+          <has_text text="-1.9068114" />
+          <has_text text="0.0304592" />
+          <has_text text="0.104748883" />
+        </assert_contents>
+      </output>
+    </test>
   </tests>
   <help><![CDATA[
 
@@ -750,6 +825,6 @@
     <citation type="doi">10.1021/ac0713510</citation>
   </citations>
   <!--
-     vim:noet:sw=2:ts=2
+     vim:et:sw=4:ts=4
 -->
 </tool>
--- a/w4mcorcov_input.R	Fri Aug 10 11:15:31 2018 -0400
+++ b/w4mcorcov_input.R	Sat Sep 01 11:33:03 2018 -0400
@@ -1,6 +1,6 @@
 # read_data_frame - read a w4m data frame, with error handling
 #   e.g., data_matrix_input_env <- read_data_frame(dataMatrix_in, "data matrix input")
-read_data_frame <- function(file_path, kind_string, failure_action = failure_action) {
+read_data_frame <- function(file_path, kind_string, rdf_failure_action = failure_action) {
   my.env <- new.env()
   my.env$success <- FALSE
   my.env$msg <- sprintf("no message reading %s", kind_string)
@@ -14,7 +14,7 @@
     }
   )
   if (!my.env$success) {
-    failure_action(my.env$msg)
+    rdf_failure_action(my.env$msg)
     return ( FALSE )
   }
   return (my.env)