diff w4mcorcov.xml @ 6:7bd523ca1f9a draft

planemo upload for repository https://github.com/HegemanLab/w4mcorcov_galaxy_wrapper/tree/master commit cafda5095a79ce2376325b57337302f95137195d
author eschen42
date Wed, 18 Jul 2018 12:35:55 -0400
parents 50f60f94c034
children 066b1f409e9f
line wrap: on
line diff
--- a/w4mcorcov.xml	Fri Mar 30 14:59:19 2018 -0400
+++ b/w4mcorcov.xml	Wed Jul 18 12:35:55 2018 -0400
@@ -1,7 +1,7 @@
-<tool id="w4mcorcov" name="OPLS-DA_Contrasts" version="0.98.8">
+<tool id="w4mcorcov" name="OPLS-DA_Contrasts" version="0.98.10">
 
   <description>OPLS-DA Contrasts of Univariate Results</description>
-  
+
   <macros>
     <xml name="paramPairSigFeatOnly">
 			<param
@@ -13,13 +13,35 @@
 				label="Retain only pairwise-significant features"
 				help="When this option is set to 'Yes', analysis will be performed including only features that differ significantly for the pair of levels being contrasted; when set to 'No', any feature that varies significantly across all levels will be included (i.e., exclude any feature that is not significantly different across all levels).  See examples below." />
     </xml>
+    <xml name="cplots">
+			<param name="cplot_y" label="C-plot Y-axis" type="select" help="Choose the Y-axis for C-plots.">
+				<option value="correlation">Plot VIP versus correlation</option>
+				<option value="covariance">Plot VIP versus covariance</option>
+			</param>
+			<param
+				name="cplot_p"
+				type="boolean"
+				checked="TRUE"
+				truevalue="TRUE"
+				falsevalue="FALSE"
+				label="Produce predictor C-plot"
+				help="When this option is set to 'Yes', correlation will be plotted against vip4 for predictor loadings." />
+			<param
+				name="cplot_o"
+				type="boolean"
+				checked="TRUE"
+				truevalue="TRUE"
+				falsevalue="FALSE"
+				label="Produce orthogonal C-plot"
+				help="When this option is set to 'Yes', correlation will be plotted against vip4 for orthogonal loadings." />
+    </xml>
 	</macros>
 
   <requirements>
     <requirement type="package">r-batch</requirement>
     <requirement type="package">bioconductor-ropls</requirement>
   </requirements>
-  
+
   <stdio>
     <exit_code range="1:" level="fatal" />
   </stdio>
@@ -40,6 +62,15 @@
     levCSV '$levCSV'
     matchingC '$matchingC'
     labelFeatures '$labelFeatures'
+    #if str( $xplots.expPlot ) == "none":
+      cplot_p "FALSE"
+      cplot_o "FALSE"
+      cplot_y "correlation"
+    #else if str( $xplots.expPlot ) == "cplot":
+      cplot_p "$xplots.cplot_p"
+      cplot_o "$xplots.cplot_o"
+      cplot_y "$xplots.cplot_y"
+    #end if
     contrast_detail '$contrast_detail'
     contrast_corcov '$contrast_corcov'
     contrast_salience '$contrast_salience'
@@ -55,7 +86,7 @@
 				<option value="none">none - Display all features from variableMetadata (rather than choosing a subset based on significance in univariate testing)</option>
 				<option value="ttest">ttest - Student's t-test (parametric test, qualitative factor with exactly 2 levels)</option>
 				<option value="anova">anova - Analysis of variance (parametric test, qualitative factor with more than 2 levels)</option>
-				<option value="wilcoxon">wilcoxon - Wilcoxon rank test (nonparametric test, qualitative factor with exactly 2 levels)</option>      
+				<option value="wilcoxon">wilcoxon - Wilcoxon rank test (nonparametric test, qualitative factor with exactly 2 levels)</option>
 				<option value="kruskal">kruskal - Kruskal-Wallis rank test (nonparametric test, qualitative factor with more than 2 levels)</option>
 			</param>
 			<when value="none" />
@@ -104,6 +135,16 @@
       <option value="regex">use regular expressions for matching level-names</option>
     </param>
     <param name="labelFeatures" type="text" value="3" label="How many features having extreme loadings should be labelled on cov-vs.-cor plot" help="Specify the number of features at each of the loading-extremes that should be labelled (with the name of the feature) on the covariance-vs.-correlation plot; specify 'ALL' to label all features or '0' to label no features; this choice has no effect on the OPLS-DA loadings plot."/>
+    <conditional name="xplots">
+			<param name="expPlot" label="Extra plots to include" type="select" help="Choosing 'none' hides further choices.">
+				<option value="none">none - Do not include additonal extra plots.</option>
+				<option value="cplot">cplot - Include C-plots (predictor-loading vs. 'vip4p' and orthogonal-loading versus 'vip4o')</option>
+			</param>
+			<when value="none" />
+			<when value="cplot">
+				<expand macro="cplots" />
+			</when>
+    </conditional>
   </inputs>
 
   <outputs>
@@ -137,6 +178,7 @@
   </outputs>
 
   <tests>
+    <!-- test #1 -->
     <test>
       <param name="dataMatrix_in" value="input_dataMatrix.tsv"/>
       <param name="sampleMetadata_in" value="input_sampleMetadata.tsv"/>
@@ -160,22 +202,22 @@
           <has_text text="level1Level2Sig" />
           <!-- first matched line -->
           <has_text text="M349.2383T700" />
-          <has_text text="-0.05007" />
-          <has_text text="-5.8455" />
-          <has_text text="0.0961269" />
-          <has_text text="0.1848301" />
+          <has_text text="-0.04051509" />
+          <has_text text="-0.001964912" />
+          <has_text text="0.02106343" />
+          <has_text text="0.2446366813" />
           <!-- second matched line -->
           <has_text text="M207.9308T206" />
-          <has_text text="-0.2967565" />
-          <has_text text="-19.56942" />
-          <has_text text="1.6023" />
-          <has_text text="1.35368" />
+          <has_text text="0.504885262" />
+          <has_text text="0.020749097" />
+          <has_text text="0.207196379" />
+          <has_text text="0.04438632" />
           <!-- third matched line -->
           <has_text text="M211.0607T263" />
-          <has_text text="0.47052" />
-          <has_text text="15.910087" />
-          <has_text text="0.89838" />
-          <has_text text="0.125372" />
+          <has_text text="0.0680900" />
+          <has_text text="0.0020163" />
+          <has_text text="0.0201345" />
+          <has_text text="0.0690773" />
         </assert_contents>
       </output>
       <output name="contrast_salience">
@@ -200,6 +242,7 @@
         </assert_contents>
       </output>
     </test>
+    <!-- test #2 -->
     <test>
       <param name="dataMatrix_in" value="input_dataMatrix.tsv"/>
       <param name="sampleMetadata_in" value="input_sampleMetadata.tsv"/>
@@ -222,21 +265,11 @@
           <has_text text="vip4o" />
           <has_text text="level1Level2Sig" />
           <!-- first matched line -->
-          <has_text text="M349.2383T700" />
-          <has_text text="-0.99601577" />
-          <has_text text="-947.55795176" />
-          <!-- second matched line -->
-          <has_text text="M207.9308T206" />
-          <has_text text="0.688549" />
-          <has_text text="58.22352" />
-          <has_text text="1.394687" />
-          <has_text text="0.06049885" />
-          <!-- third matched line -->
-          <has_text text="M211.0607T263" />
-          <has_text text="-0.572018" />
-          <has_text text="-14.57769" />
-          <has_text text="0.7780899" />
-          <has_text text="0.3678166776" />
+          <has_text text="M200.005T296" />
+          <has_text text="-0.2803571" />
+          <has_text text="-0.0115899" />
+          <has_text text="0.1157346" />
+          <has_text text="0.0647860" />
         </assert_contents>
       </output>
       <output name="contrast_salience">
@@ -261,6 +294,7 @@
         </assert_contents>
       </output>
     </test>
+    <!-- test #3 -->
     <test>
       <param name="dataMatrix_in" value="input_dataMatrix.tsv"/>
       <param name="sampleMetadata_in" value="input_sampleMetadata.tsv"/>
@@ -282,22 +316,16 @@
           <has_text text="vip4o" />
           <!-- first matched line -->
           <has_text text="M349.2383T700" />
-          <has_text text="-0.64331257" />
-          <has_text text="-161.82220" />
-          <has_text text="1.862455" />
-          <has_text text="0.2105143" />
+          <has_text text="-0.4732226" />
+          <has_text text="-0.0506172" />
+          <has_text text="0.5246766" />
+          <has_text text="0.0103341" />
           <!-- second matched line -->
           <has_text text="M207.9308T206" />
-          <has_text text="-0.313507" />
-          <has_text text="-20.0476" />
-          <has_text text="1.6956987" />
-          <has_text text="1.19247" />
-          <!-- third matched line -->
-          <has_text text="M211.0607T263" />
-          <has_text text="-0.38986114" />
-          <has_text text="-23.747718" />
-          <has_text text="1.064296856" />
-          <has_text text="1.16507455" />
+          <has_text text="0.4927151" />
+          <has_text text="0.0203715" />
+          <has_text text="0.2111623" />
+          <has_text text="0.0488654" />
         </assert_contents>
       </output>
       <output name="contrast_salience">
@@ -322,6 +350,59 @@
         </assert_contents>
       </output>
     </test>
+    <!-- test #4 -->
+    <test>
+      <param name="dataMatrix_in" value="issue1_input_dataMatrix.tsv"/>
+      <param name="sampleMetadata_in" value="issue1_input_sampleMetadata.tsv"/>
+      <param name="variableMetadata_in" value="issue1_input_variableMetadata.tsv"/>
+      <param name="tesC" value="none"/>
+      <param name="facC" value="tissue_flowering"/>
+      <param name="labelFeatures" value="3"/>
+      <param name="levCSV" value="*"/>
+      <param name="matchingC" value="wildcard"/>
+      <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="NM516T251" />
+          <has_text text="flower_yes" />
+          <has_text text="other" />
+          <has_text text="0.3490559" />
+          <has_text text="0.0260147" />
+          <has_text text="0.4377872" />
+          <has_text text="0.5916089" />
+          <has_text text="0.0260147" />
+          <has_text text="0.0438942" />
+          <has_text text="516.0845" />
+          <has_text text="250.8762" />
+        </assert_contents>
+      </output>
+      <output name="contrast_salience">
+        <assert_contents>
+          <!-- column-labels line -->
+          <has_text text="featureID" />
+          <has_text text="salientLevel" />
+          <has_text text="salientRCV" />
+          <has_text text="salience" />
+          <has_text text="mz" />
+          <has_text text="rt" />
+          <!-- first matched line -->
+          <has_text text="PM518T369" />
+          <has_text text="flower_yes" />
+          <has_text text="0.58655260" />
+          <has_text text="4.414469" />
+          <has_text text="518.1656" />
+          <has_text text="368.59817" />
+        </assert_contents>
+      </output>
+    </test>
   </tests>
   <help><![CDATA[
 
@@ -356,11 +437,11 @@
 - A column of variableMetadata would be labelled 'cluster_kruskal_sig' and would have values '1' and '0'; when the samples are grouped by 'cluster', '1' means that there is strong evidence against the hypothesis that there is no difference among the intensities for the feature across all sample-groups.
 - A column of variableMetadata would be labelled 'cluster_kruskal_k1.k2_sig' and would have values '1' and '0', where '1' means that there is significant evidence against the hypothesis that samples from sampleMetadata whose 'cluster' column contains 'k1' or 'k2' have the same intensity for that feature.
 
-The 'PLS-DA Contrasts' tool produces graphics and data for OPLS-DA contrasts of feature-intensities between significantly different pairs of factor-levels.  For each factor-level, the tool performs a contrast with all other factor-levels combined and then separately with each other factor-level.  
+The 'PLS-DA Contrasts' tool produces graphics and data for OPLS-DA contrasts of feature-intensities between significantly different pairs of factor-levels.  For each factor-level, the tool performs a contrast with all other factor-levels combined and then separately with each other factor-level.
 
 **Along the left-to-right axis, the plots show the supervised projection of the variation explained by the predictor** (i.e., the factor specified when invoking the tool); **the top-to-bottom axis displays the variation that is orthogonal to the predictor level** (i.e., independent of it).
 
-Although this tool can be used in a purely exploratory manner by supplying the variableMetadata file without the columns added by the W4M 'Univariate' tool, **the preferred workflow is to use univariate testing to exclude features that are not significantly different and use OPLS-DA to visualize the differences identified in univariate testing** (Th]]>&#233;<![CDATA[venot *et al.*, 2015); an appropriate exception would be to visualize contrasts of a specific list of metabolites.
+Although this tool can be used in a purely exploratory manner by supplying the variableMetadata file without the columns added by the W4M 'Univariate' tool, **the preferred workflow may be to use univariate testing to exclude features that are not significantly different and then to use OPLS-DA to visualize the differences identified in univariate testing** (Th]]>&#233;<![CDATA[venot *et al.*, 2015); an appropriate exception would be to visualize contrasts of a specific list of metabolites.
 
 It must be stressed that there may be no *single* definitive computational approach to select features that are reliable biomarkers, especially from a small number of samples or experiments.  A few possible choices are:
 
@@ -369,7 +450,7 @@
 - examining "variable importance in projection VIP for OPLS-DA" (Galindo-Prieto *et al.* 2014), and
 - examining a feature's "selectivity ratio" (Rajalahti *et al.*, 2009).
 
-In this spirit, this tool reports the S-PLOT covariance and correlation (Wiklund *op. cit.*) and VIP metrics, and it introduces an informal "salience" metric to flag features that may merit attention without dimensional reduction; future versions may add selectivity ratio.  
+In this spirit, this tool reports the S-PLOT covariance and correlation (Wiklund *op. cit.*) and VIP metrics, and it introduces an informal "salience" metric to flag features that may merit attention without dimensional reduction; future versions may add selectivity ratio.
 
 For a more systematic approach to biomarker identification, please consider the W4M 'biosigner' tool (Rinuardo *et al.* 2016), which applies three different identification metrics to the selection process.
 
@@ -453,10 +534,12 @@
 [OUT] Contrast-detail output PDF
   | Several plots for each two-projection OPLS-DA analysis:
 
-- (top-left) **correlation-versus-covariance plot** of OPLS-DA results (a work-alike for the S-PLOT, computed using formula in Supplement to Wiklund, *op. cit.*); point-color becomes saturated as the "variable importance in projection to the predictive components" (VIP\ :subscript:`4,p` from Galindo-Prieto *et al.* 2014) ranges from 0.83 and 1.21 (Mehmood *et al.* 2012)
-- (bottom-left) **model-overview plot** for the two projections; grey bars are the correlation coefficient for the fitted data; black bars indicate performance in cross-validation tests (Th]]>&#233;<![CDATA[venot, 2017)
-- (top-right) OPLS-DA **scores-plot** for the two projections (Th]]>&#233;<![CDATA[venot *et al.*, 2015)
-- (bottom-right) OPLS-DA **loadings-plot** for the two projections (*ibid.*)
+- (first row, left) **correlation-versus-covariance plot** of OPLS-DA results (a work-alike for the S-PLOT, computed using formula in Supplement to Wiklund, *op. cit.*); point-color becomes saturated as the "variable importance in projection to the predictive components" (VIP\ :subscript:`4,p` from Galindo-Prieto *et al.* 2014) ranges from 0.83 and 1.21 (Mehmood *et al.* 2012), for use to identify features for consideration as biomarkers.
+- (second row, left) **model-overview plot** for the two projections; grey bars are the correlation coefficient for the fitted data; black bars indicate performance in cross-validation tests (Th]]>&#233;<![CDATA[venot, 2017)
+- (first row, right) OPLS-DA **scores-plot** for the two projections (Th]]>&#233;<![CDATA[venot *et al.*, 2015)
+- (second row, right) **correlation-versus-covariance plot** of OPLS-DA results **orthogonal to the predictor** (see section "S-Plot of Orthogonal Component" in Wiklund, *op. cit.*, pp. 120-121; this characterizes features with the greatest variation independent of the predictor).
+- (third row, left, when "**predictor C-plot**" is chosen under "Extra plots to include") plot of the covariance or correlation vs. the VIP for the projection *parallel to the predictor*, for use to identify features for consideration as biomarkers.
+- (third row, right, when "**orthogonal C-plot**" is chosen under "Extra plots to include") plotof the covariance or correlation vs. the VIP for the projection *orthogonal to the predictor*, for use to identify features varying considerably without regard to the predictor.
 
 [OUT] Contrast Correlation-Covarinace data TABULAR
   | A tab-separated values file of metadata for each feature for each contrast in which it was included.
@@ -475,7 +558,7 @@
 - **level1Level2Sig** - (Only present when a test other than "none" is chosen) '1' when feature varies significantly across all classes (i.e., not pair-wise); '0' otherwise
 
 [OUT] Feature "Salience" data TABULAR
-  | Metrics for the "salient level" for each feature, i.e., the level at which the feature is more prominent than any other level.  This is *not* at all related to the SIMCA OPLS-DA S-PLOT; rather, it is intended as a potential (and unproven) way to identify features that may suggest potential biomarkers without dimensional reduction of data.  This is a tab-separated values file having the following columns:
+  | Metrics for the "salient level" for each feature, i.e., the level at which the feature is more prominent than any other level.  This is *not* at all related to the SIMCA OPLS-DA S-PLOT; rather, it is intended as a potential way to discover features for consideration as potential biomarkers without dimensionally reducting the data.  This is a tab-separated values file having the following columns:
 
 - **featureID** - feature identifier
 - **salientLevel** - salient level, i.e., for the feature, the class-level having the greatest median intensity
@@ -651,6 +734,15 @@
 Release notes
 -------------
 
+0.98.10
+
+- new feature: C-plots of VIP versus correlation or relative covariance.
+- bug fix: Handle issue 2 - features now are only pareto-scaled per Wikland *op cit.*.
+
+0.98.9
+
+- bug fix: Handle issue 1 - handle features removed by ropls because variance is less than 2.2e-16.
+
 0.98.8
 
 - new feature: Replace loadings plot with correlation-versus-covariance plot for orthogonal features, i.e., the consistency of features influencing within-treatment variation (which is linearly related to the loading of the orthogonal projection) versus consistency.  This eliminates the need for the parameter to suppress labels for features with extreme orthogonal loadings