Repository 'w4mcorcov'
hg clone https://toolshed.g2.bx.psu.edu/repos/eschen42/w4mcorcov

Changeset 8:342570ad880c (2018-08-04)
Previous changeset 7:066b1f409e9f (2018-07-26) Next changeset 9:06c51af11531 (2018-08-10)
Commit message:
planemo upload for repository https://github.com/HegemanLab/w4mcorcov_galaxy_wrapper/tree/master commit 0c81f4f1416129dd7061042b12cd28c0b8927aab
modified:
w4mcorcov.xml
w4mcorcov_wrapper.R
b
diff -r 066b1f409e9f -r 342570ad880c w4mcorcov.xml
--- a/w4mcorcov.xml Thu Jul 26 10:23:34 2018 -0400
+++ b/w4mcorcov.xml Sat Aug 04 17:43:16 2018 -0400
[
b'@@ -1,160 +1,145 @@\n-\xef\xbb\xbf<tool id="w4mcorcov" name="OPLS-DA_Contrasts" version="0.98.11">\n-\n-  <description>OPLS-DA Contrasts of Univariate Results</description>\n-\n-  <macros>\n-    <xml name="paramPairSigFeatOnly">\n-\t\t\t<param\n-\t\t\t\tname="pairSigFeatOnly"\n-\t\t\t\ttype="boolean"\n-\t\t\t\tchecked="true"\n-\t\t\t\ttruevalue="TRUE"\n-\t\t\t\tfalsevalue="FALSE"\n-\t\t\t\tlabel="Retain only pairwise-significant features"\n-\t\t\t\thelp="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." />\n-    </xml>\n-    <xml name="cplots">\n-\t\t\t<param name="cplot_y" label="C-plot Y-axis" type="select" help="Choose the Y-axis for C-plots.">\n-\t\t\t\t<option value="correlation">Plot VIP versus correlation</option>\n-\t\t\t\t<option value="covariance">Plot VIP versus covariance</option>\n-\t\t\t</param>\n-\t\t\t<param\n-\t\t\t\tname="cplot_p"\n-\t\t\t\ttype="boolean"\n-\t\t\t\tchecked="TRUE"\n-\t\t\t\ttruevalue="TRUE"\n-\t\t\t\tfalsevalue="FALSE"\n-\t\t\t\tlabel="Produce predictor C-plot"\n-\t\t\t\thelp="When this option is set to \'Yes\', correlation will be plotted against vip4 for predictor loadings." />\n-\t\t\t<param\n-\t\t\t\tname="cplot_o"\n-\t\t\t\ttype="boolean"\n-\t\t\t\tchecked="TRUE"\n-\t\t\t\ttruevalue="TRUE"\n-\t\t\t\tfalsevalue="FALSE"\n-\t\t\t\tlabel="Produce orthogonal C-plot"\n-\t\t\t\thelp="When this option is set to \'Yes\', correlation will be plotted against vip4 for orthogonal loadings." />\n-    </xml>\n-\t</macros>\n-\n-  <requirements>\n-    <requirement type="package">r-batch</requirement>\n-    <requirement type="package">bioconductor-ropls</requirement>\n-  </requirements>\n-\n-  <stdio>\n-    <exit_code range="1:" level="fatal" />\n-  </stdio>\n-\n-  <command><![CDATA[\n-    cd $__tool_directory__; Rscript w4mcorcov_wrapper.R\n-    dataMatrix_in "$dataMatrix_in"\n-    sampleMetadata_in "$sampleMetadata_in"\n-    variableMetadata_in "$variableMetadata_in"\n-    facC "$facC"\n-    #if str( $signif_test.tesC ) == "none":\n-      tesC "none"\n-      pairSigFeatOnly "FALSE"\n-    #else:\n-      tesC "$signif_test.tesC"\n-      pairSigFeatOnly "$signif_test.pairSigFeatOnly"\n-    #end if\n-    levCSV \'$levCSV\'\n-    matchingC \'$matchingC\'\n-    labelFeatures \'$labelFeatures\'\n-    #if str( $xplots.expPlot ) == "none":\n-      cplot_p "FALSE"\n-      cplot_o "FALSE"\n-      cplot_y "correlation"\n-    #else if str( $xplots.expPlot ) == "cplot":\n-      cplot_p "$xplots.cplot_p"\n-      cplot_o "$xplots.cplot_o"\n-      cplot_y "$xplots.cplot_y"\n-    #end if\n-    contrast_detail \'$contrast_detail\'\n-    contrast_corcov \'$contrast_corcov\'\n-    contrast_salience \'$contrast_salience\'\n+\xef\xbb\xbf<tool id="w4mcorcov" name="OPLS-DA_Contrasts" version="0.98.12">\n+    <description>OPLS-DA Contrasts of Univariate Results</description>\n+    <macros>\n+        <xml name="paramPairSigFeatOnly">\n+            <param name="pairSigFeatOnly" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE"\n+                label="Retain only pairwise-significant features"\n+                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." />\n+        </xml>\n+        <xml name="cplots">\n+            <param name="cplot_y" label="C-plot Y-axis" type="select" help="Choose the Y-axis for C-plots.">\n+                <option value="correlation">Plot VIP versus correlation</option>\n+                <option value="covariance">Plot VIP versus covariance</option>\n+            </param>\n+            <param name="cplot_p" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE"\n+                label="Produce predictor C-plot"\n+'..b'       <option value="none">Do not include additonal extra plots.</option>\n+                <option value="cplot">Include C-plots (predictor-loading vs. \'vip4p\' and orthogonal-loading versus \'vip4o\')</option>\n+            </param>\n+            <when value="none" />\n+            <when value="cplot">\n+                <expand macro="cplots" />\n+            </when>\n+        </conditional>\n+    </inputs>\n+    <outputs>\n     <!--\n       pdf1: summaries of each contrasts, clearly labelled by level=pair name\n         * first PCA score-plot\n         * then PLS score-plot\n         * then PLS S-PLOT; color in red features with VIP > 1; color in grey any non-pairwise-significant features, if these are included\n     -->\n-    <data name="contrast_detail" label="${tool.name}_${variableMetadata_in.name}_detail" format="pdf" />\n+    <data name="contrast_detail" format="pdf" label="${tool.name}_${variableMetadata_in.name}_detail" />\n     <!--\n       tsv1: cor and cov table with columns:\n         * feature-ID\n@@ -166,7 +151,7 @@\n         * Galindo_Prieto_2014 VIP for orthogonal components, VIP[4,o]\n         * (When filtering on significance of univariate tests) Significance of test of null hypothesis that there is no difference between the two classes, i.e, the pair-wise test.\n     -->\n-    <data name="contrast_corcov" label="${tool.name}_${variableMetadata_in.name}_corcov" format="tabular" />\n+    <data name="contrast_corcov" format="tabular" label="${tool.name}_${variableMetadata_in.name}_corcov" />\n     <!--\n       tsv2: salience table with columns (experimental feature):\n         * feature-ID\n@@ -174,9 +159,8 @@\n         * Salient robust coefficient of variation, i.e., for the feature, the mean absolute deviation of the intensity for the salient level divided by the median intensity for the salient level\n         * Salience, i.e., for the feature, the median of the class-level having the greatest intensity divided by the mean of the medians for all class-levels.\n     -->\n-    <data name="contrast_salience" label="${tool.name}_${variableMetadata_in.name}_salience" format="tabular" />\n+    <data name="contrast_salience" format="tabular" label="${tool.name}_${variableMetadata_in.name}_salience" />\n   </outputs>\n-\n   <tests>\n     <!-- test #1 -->\n     <test>\n@@ -725,51 +709,6 @@\n OPLS-DA, SIMCA, and S-PLOT are registered trademarks of the Umetrics company.  http://umetrics.com/about-us/trademarks\n \n \n-Release notes\n--------------\n-\n-0.98.11\n-\n-- bug fix: Readdress issue 2 - features now are pareto-scaled *and centered* per Wikland *op cit.*.\n-\n-0.98.10\n-\n-- new feature: C-plots of VIP versus correlation or relative covariance.\n-- bug fix: Handle issue 2 - features now are only pareto-scaled per Wikland *op cit.*.\n-\n-0.98.9\n-\n-- bug fix: Handle issue 1 - handle features removed by ropls because variance is less than 2.2e-16.\n-\n-0.98.8\n-\n-- 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\n-\n-0.98.7\n-\n-- bug fix: Handle case of a treatment level with only one sample.\n-\n-0.98.6\n-\n-- bug fix: Set \'crossvalI\' param (of R function \'ropls::opls\') to the number of samples when the there are fewer than seven samples.\n-\n-0.98.5\n-\n-- bug fix: Fit feature-labels within clipping region of cor-vs.cov plot\n-- new feature: optionally (and by default) suppress labels for features with extreme orthogonal loadings\n-\n-0.98.3\n-\n-- Add support for two-level factors\n-- Add adjusted mz and rt to output tables\n-- Allow explicitly setting the number of features with extreme loadings to be labelled on the correlation vs. covariance plot\n-- Add loadings to corcov table\n-\n-0.98.2\n-\n-- first release\n-\n-\n   ]]></help>\n   <citations>\n     <!-- this tool -->\n'
b
diff -r 066b1f409e9f -r 342570ad880c w4mcorcov_wrapper.R
--- a/w4mcorcov_wrapper.R Thu Jul 26 10:23:34 2018 -0400
+++ b/w4mcorcov_wrapper.R Sat Aug 04 17:43:16 2018 -0400
[
@@ -22,12 +22,45 @@
 ## subroutines
 ##----------
 
-source("w4mcorcov_lib.R")
-source("w4mcorcov_util.R")
-source("w4mcorcov_input.R")
-source("w4mcorcov_salience.R")
-source("w4mcorcov_calc.R")
-source("w4mcorcov_output.R")
+# from: https://github.com/molgenis/molgenis-pipelines/wiki/How-to-source-another_file.R-from-within-your-R-script
+LocationOfThisScript = function() # Function LocationOfThisScript returns the location of this .R script (may be needed to source other files in same dir)
+{
+    this.file = NULL
+    # This file may be 'sourced'
+    for (i in -(1:sys.nframe())) {
+        if (identical(sys.function(i), base::source)) this.file = (normalizePath(sys.frame(i)$ofile))
+    }
+
+    if (!is.null(this.file)) return(dirname(this.file))
+
+    # But it may also be called from the command line
+    cmd.args = commandArgs(trailingOnly = FALSE)
+    cmd.args.trailing = commandArgs(trailingOnly = TRUE)
+    cmd.args = cmd.args[seq.int(from=1, length.out=length(cmd.args) - length(cmd.args.trailing))]
+    res = gsub("^(?:--file=(.*)|.*)$", "\\1", cmd.args)
+
+    # If multiple --file arguments are given, R uses the last one
+    res = tail(res[res != ""], 1)
+    if (0 < length(res)) return(dirname(res))
+
+    # Both are not the case. Maybe we are in an R GUI?
+    return(NULL)
+}
+
+script.dir <-  LocationOfThisScript()
+
+source(paste(script.dir, "w4mcorcov_lib.R", sep="/")) 
+source(paste(script.dir, "w4mcorcov_util.R", sep="/")) 
+source(paste(script.dir, "w4mcorcov_input.R", sep="/")) 
+source(paste(script.dir, "w4mcorcov_salience.R", sep="/")) 
+source(paste(script.dir, "w4mcorcov_calc.R", sep="/")) 
+source(paste(script.dir, "w4mcorcov_output.R", sep="/")) 
+#source("w4mcorcov_lib.R")
+#source("w4mcorcov_util.R")
+#source("w4mcorcov_input.R")
+#source("w4mcorcov_salience.R")
+#source("w4mcorcov_calc.R")
+#source("w4mcorcov_output.R")
 
 ## log file
 ##---------