view w4mcorcov.xml @ 3:5aaab36bc523 draft

planemo upload for repository https://github.com/HegemanLab/w4mcorcov_galaxy_wrapper/tree/master commit 88004a3cf8868d68da1ec5bd2c1be53746350367
author eschen42
date Mon, 15 Jan 2018 14:30:15 -0500
parents e03582f26617
children 8bba31f628da
line wrap: on
line source

<tool id="w4mcorcov" name="OPLS-DA_Contrasts" version="0.98.6">

  <description>OPLS-DA Contrasts of Univariate Results</description>
  
  <requirements>
    <requirement type="package">r-batch</requirement>
    <requirement type="package">bioconductor-ropls</requirement>
    <!-- <requirement type="package">r-foreach</requirement> -->
  </requirements>
  
  <stdio>
    <exit_code range="1:" level="fatal" />
  </stdio>

  <command><![CDATA[
    cd $__tool_directory__; Rscript w4mcorcov_wrapper.R
    dataMatrix_in "$dataMatrix_in"
    sampleMetadata_in "$sampleMetadata_in"
    variableMetadata_in "$variableMetadata_in"
    tesC "$tesC"
    facC "$facC"
    pairSigFeatOnly "$pairSigFeatOnly"
    levCSV '$levCSV'
    matchingC '$matchingC'
    labelFeatures '$labelFeatures'
    labelOrthoFeatures '$labelOrthoFeatures'
    contrast_detail '$contrast_detail'
    contrast_corcov '$contrast_corcov'
    contrast_salience '$contrast_salience'
  ]]></command>

  <inputs>
    <param name="dataMatrix_in" label="Data matrix file" type="data" format="tabular" help="Features x samples (tabular data - decimal: '.'; missing: NA; mode: numerical; separator: tab character)" />
    <param name="sampleMetadata_in" label="Sample metadata file" type="data" format="tabular" help="Samples x metadata (tabular data - decimal: '.'; missing: NA; mode: character or numerical; separator: tab character)" />
    <param name="variableMetadata_in" label="Variable metadata file (ideally from Univariate)" type="data" format="tabular" help="Features x metadata (tabular data - decimal: '.'; missing: NA; mode: character or numerical; separator: tab character)" />
    <param name="facC" label="Factor of interest" type="text" 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."/>
    <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>
      <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="kruskal">kruskal - Kruskal-Wallis rank test (nonparametric test, qualitative factor with more than 2 levels)</option>
    </param>
    <param
      name="pairSigFeatOnly"
      type="boolean"
      checked="true"
      truevalue="TRUE"
      falsevalue="FALSE"
      label="Retain only pairwise-significant features"
      help="When 'none' is chosen as the test, all features are included in the analysis (i. e., this parameter is ignored).  Otherwise, 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."/>
    <param name="levCSV" label="Levels of interest" type="text" value = "*" help="Comma-separated level-names (or comma-less regular expressions to match level-names) to consider in analysis; must match at least two levels; levels must be non-numeric; may include wild cards or regular expressions.  Note that extra space characters will affect results - 'a,b' is correct, but 'a , b' is not and may fail or give different results.">
      <sanitizer>
        <valid initial="string.letters">
          <add preset="string.digits"/>
          <add value="&#36;"  /> <!-- $ dollar, dollar-sign -->
          <add value="&#40;"  /> <!-- ( left-paren -->
          <add value="&#41;"  /> <!-- ) right-paren -->
          <add value="&#42;"  /> <!-- * splat, asterisk -->
          <add value="&#43;"  /> <!-- + plus -->
          <add value="&#44;"  /> <!-- , comma -->
          <add value="&#45;"  /> <!-- - dash, minus-sign -->
          <add value="&#46;"  /> <!-- . dot, period -->
          <add value="&#58;"  /> <!-- : colon -->
          <add value="&#59;"  /> <!-- ; semi, semicolon -->
          <add value="&#63;"  /> <!-- ? what, question mark -->
          <add value="&#91;"  /> <!-- [ l-squib, left-squre-bracket -->
          <add value="&#92;"  /> <!-- \ whack, backslash -->
          <add value="&#93;"  /> <!-- ] r-squib, right-squre-bracket -->
          <add value="&#94;"  /> <!-- ^ hat, caret -->
          <add value="&#123;" /> <!-- { l-cube, left-curly-bracket -->
          <add value="&#124;" /> <!-- | pipe -->
          <add value="&#125;" /> <!-- } r-cube, right-curly-bracket -->
          <!-- IMPORTANT - Note that single and double quotes are not part of this list; they have the potential to make the 'command' section insecure or broken. -->
        </valid>
      </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="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."/>
    <param
      name="labelOrthoFeatures"
      type="boolean"
      checked="false"
      truevalue="TRUE"
      falsevalue="FALSE"
      label="Label features having extreme orthogonal loadings"
      help="When using the preceding parameter to label only features at the loading-extremess in the cor-vs.-cov plot, use 'no' here to label only features having extreme parallel loadings (loadp); this is the default.  Choose 'yes' to add labels also to features having extreme orthogonal loadings (both loado and loadp); this may clutter the plot."/>
  </inputs>

  <outputs>
    <!--
      pdf1: summaries of each contrasts, clearly labelled by level=pair name
        * first PCA score-plot
        * then PLS score-plot
        * then PLS S-PLOT; color in red features with VIP > 1; color in grey any non-pairwise-significant features, if these are included
    -->
    <data name="contrast_detail" label="${tool.name}_${variableMetadata_in.name}_detail" format="pdf" />
    <!--
      tsv1: cor and cov table with columns:
        * feature-ID
        * factor-level 1
        * factor-level 2, lexically greater than level 1
        * Wiklund_2008 correlation
        * Wiklund_2008 covariance
        * Galindo_Prieto_2014 VIP for predictive components, VIP[4,p]
        * Galindo_Prieto_2014 VIP for orthogonal components, VIP[4,o]
        * (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.
    -->
    <data name="contrast_corcov" label="${tool.name}_${variableMetadata_in.name}_corcov" format="tabular" />
    <!--
      tsv2: salience table with columns (experimental feature):
        * feature-ID
        * Salient level, i.e., for the feature, the class-level having the greatest median intensity
        * 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
        * 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.
    -->
    <data name="contrast_salience" label="${tool.name}_${variableMetadata_in.name}_salience" format="tabular" />
  </outputs>

  <tests>
    <test>
      <param name="dataMatrix_in" value="input_dataMatrix.tsv"/>
      <param name="sampleMetadata_in" value="input_sampleMetadata.tsv"/>
      <param name="variableMetadata_in" value="input_variableMetadata.tsv"/>
      <param name="tesC" value="kruskal"/>
      <param name="facC" value="k10"/>
      <param name="pairSigFeatOnly" value="FALSE"/>
      <param name="labelFeatures" value="3"/>
      <param name="labelOrthogonalFeatures" value="FALSE"/>
      <param name="levCSV" value="k[12],k[3-4]"/>
      <param name="matchingC" value="regex"/>
      <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" />
          <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" />
          <!-- 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" />
          <!-- 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" />
        </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" />
          <!-- first matched line -->
          <has_text text="M349.2383T700" />
          <has_text text="0.659554" />
          <has_text text="8.81866595" />
          <!-- second matched line -->
          <has_text text="M207.9308T206" />
          <has_text text="0.0578578" />
          <has_text text="2.27527985" />
          <!-- third matched line -->
          <has_text text="M211.0607T263" />
          <has_text text="9999" />
          <has_text text="12.87766096" />
        </assert_contents>
      </output>
    </test>
    <test>
      <param name="dataMatrix_in" value="input_dataMatrix.tsv"/>
      <param name="sampleMetadata_in" value="input_sampleMetadata.tsv"/>
      <param name="variableMetadata_in" value="input_variableMetadata.tsv"/>
      <param name="tesC" value="kruskal"/>
      <param name="facC" value="k10"/>
      <param name="pairSigFeatOnly" value="TRUE"/>
      <param name="labelFeatures" value="3"/>
      <param name="labelOrthogonalFeatures" value="TRUE"/>
      <param name="levCSV" value="k[12],k[3-4]"/>
      <param name="matchingC" value="regex"/>
      <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" />
          <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" />
        </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" />
          <!-- first matched line -->
          <has_text text="M349.2383T700" />
          <has_text text="0.659554" />
          <has_text text="8.81866595" />
          <!-- second matched line -->
          <has_text text="M207.9308T206" />
          <has_text text="0.0578578" />
          <has_text text="2.27527985" />
          <!-- third matched line -->
          <has_text text="M211.0607T263" />
          <has_text text="9999" />
          <has_text text="12.87766096" />
        </assert_contents>
      </output>
    </test>
    <test>
      <param name="dataMatrix_in" value="input_dataMatrix.tsv"/>
      <param name="sampleMetadata_in" value="input_sampleMetadata.tsv"/>
      <param name="variableMetadata_in" value="input_variableMetadata.tsv"/>
      <param name="tesC" value="none"/>
      <param name="facC" value="k10"/>
      <param name="pairSigFeatOnly" value="TRUE"/>
      <param name="labelFeatures" value="3"/>
      <param name="labelOrthogonalFeatures" value="FALSE"/>
      <param name="levCSV" value="k[12],k[3-4]"/>
      <param name="matchingC" value="regex"/>
      <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.64331257" />
          <has_text text="-161.82220" />
          <has_text text="1.862455" />
          <has_text text="0.2105143" />
          <!-- 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" />
        </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" />
          <!-- first matched line -->
          <has_text text="M349.2383T700" />
          <has_text text="0.659554" />
          <has_text text="8.81866595" />
          <!-- second matched line -->
          <has_text text="M207.9308T206" />
          <has_text text="0.0578578" />
          <has_text text="2.27527985" />
          <!-- third matched line -->
          <has_text text="M211.0607T263" />
          <has_text text="9999" />
          <has_text text="12.87766096" />
        </assert_contents>
      </output>
    </test>
  </tests>
  <!-- 
  .. |reg|    unicode:: U+000AE .. REGISTERED SIGN - see http://docutils.sourceforge.net/docutils/parsers/rst/include/isonum.txt or /usr/share/docutils/parsers/rst/include/isonum.txt
  -->
  <help><![CDATA[

**Run PLS-DA Contrasts of Univariate Results**
----------------------------------------------

**Author** - Arthur Eschenlauer (University of Minnesota, esch0041@umn.edu)


Motivation
----------

OPLS-DA\ :superscript:`®` and the SIMCA\ :superscript:`®` S-PLOT\ :superscript:`®` (Wiklund *et al.*, 2008) may be employed to draw attention to metabolomic features that are potential biomarkers, i.e. features that are potentially useful to discriminate to which class a sample should be assigned (e.g. Sun *et al.*, 2016).  Workflow4Metabolomics (W4M, Giacomoni *et al.*, 2014, Guitton *et al.*, 2017) provides a suite of tools for preprocessing and statistical analysis of LC-MS, GC-MS, and NMR metabolomics data; however, it does not (as of release 3.0) include a tool for making the equivalent of an S-PLOT.

The S-PLOT is computed from mean-centered, pareto-scaled data.  This plot presents the correlation of the first score vector from an OPLS-DA model with the sample-variables used to produce that model versus the covariance of the scores with the sample-variables.  For OPLS-DA, the first score vector represents the variation among the sample-variables that is related to the predictor (i.e., the contrasting factor).

The primary aims of this tool are:

- To compute and visualize multiple contrasts with OPLS-DA and the covariance vs. correlation plot.
- To write the results to data files for use in further multivariate analysis or visualization.

Note: This tool only supports categorical factors with non-numeric level-names.

Description
-----------

The purpose of the 'PLS-DA Contrasts' tool is to visualize GC-MS or LC-MS features that are possible biomarkers.

The W4M 'Univariate' tool (Thévenot *et al.*, 2015) adds the results of family-wise corrected pairwise significance-tests as columns of the **variableMetadata** dataset.
For instance, suppose that you ran Kruskal-Wallis testing for a column named 'cluster' in sampleMetadata that has values 'k1' and 'k2' and at least one other value.

- 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.  

**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é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:

- picking features with maximum loadings along the projection parallel to the predictor (loadp),
- examining extreme values on S-PLOTs (for which covariance is linearly related to loadp),
- 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.  

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.

Regardless of how any potential biomarker is identified, further validation analysis (e.g., independent confirmatory experiments) is needed before it is recommended for general application.


W4M Workflow Position
---------------------

- Upstream tool: **Univariate** (category: Statistical Analysis) or (not generally recommended) any **Preprocessing** tool that produces or updates a 'variableMetadata' file.
- Downstream tool categories: **Statistical Analysis**

Input files
-----------

  +----------------------+-----------+
  | File                 |  Format   |
  +======================+===========+
  | Data matrix          |  tabular  |
  +----------------------+-----------+
  | Sample metadata      |  tabular  |
  +----------------------+-----------+
  | Variable metadata    |  tabular  |
  +----------------------+-----------+

Output files
------------

  +-------------------------------------------+-----------+
  | File                                      |  Format   |
  +===========================================+===========+
  | Contrast detail                           |    pdf    |
  +-------------------------------------------+-----------+
  | Contrast "corrlation and covariance" data |  tabular  |
  +-------------------------------------------+-----------+
  | Feature "salience" data                   |  tabular  |
  +-------------------------------------------+-----------+

Parameters
----------

[IN] Data matrix file
  | variable x sample **dataMatrix** (tabular separated values) file of the numeric data matrix, with '.' as decimal, and 'NA' for missing values; the table must not contain metadata apart from row and column names; the row and column names must be identical to the rownames of the sample and variable metadata, respectively (see below)
  |

[IN] Sample metadata file
  | sample x metadata **sampleMetadata** (tabular separated values) file of the numeric and/or character sample metadata, with '.' as decimal and 'NA' for missing values
  |

[IN] Variable metadata file
  | variable x metadata **variableMetadata** (tabular separated values) file of the numeric and/or character variable metadata, with '.' as decimal and 'NA' for missing values
  |

[IN] Test
  | Name of the **statistical test** - a component of column names in variable metadata table
  | May be one of 'none', 'ttest', 'gwilcoxon', 'anova', 'kruskal', 'pearson', 'spearman'
  |

[IN] Factor of interest
  | Name of the **column of sampleMetadata** corresponding to the qualitative or quantitative variable
  |

[IN] Retain only pairwise-significant features
  | When **true**, for each contrast of two levels, include only those features which pass the significance threshold for that contrast.  Choosing true results in an OPLS-DA model that better reflects and visualizes the difference detected by univariate analysis, with somewhat increased reliability of prediction (as assessed by cross-validation).
  | When **false**, include all features that pass the significance threshold when testing for difference across all factor-levels.  This choice produces a plot that displays more features but is not necessarily more informative.
  | *Note that when 'Test' is 'none', all features are included in the analysis and this parameter has no effect.*
  |

[IN] Levels of interest
  | Comma-separated **level-names** (or comma-less regular expressions to match level-names) to consider in analysis; must match at least two levels; may include wild cards or regular expressions.
  |

[IN] Level-name matching
  | Indicator of **how levels are to be specified generically** (if at all) - wild cards, regular expressions, or none (no generic matching).
  |

[IN] Label how many extreme features
  | 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; this choice has no effect on the OPLS-DA loadings plot.
  |

[IN] Label features with extreme loado
  | If the previous parameter has limited the the number of features to be labelled at each of the loading-extremes, then the extreme values for both loado and loadp will be labelled when this parameter is set to 'yes'; otherwise (in the default case) only extreme values for loadp will be lableld.  The default was chosen to make the plot less cluttered.
  |

[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évenot, 2017)
- (top-right) OPLS-DA **scores-plot** for the two projections (Thévenot *et al.*, 2015)
- (bottom-right) OPLS-DA **loadings-plot** for the two projections (*ibid.*)

[OUT] Contrast Correlation-Covarinace data TABULAR
  | A tab-separated values file of metadata for each feature for each contrast in which it was included.
  | Thus, a given feature may appear many times, but *the combination of featureID, factorLevel1, and factorLevel2 will be unique.*
  | This file has the following columns:

- **featureID** - feature-identifier
- **factorLevel1** - factor-level 1
- **factorLevel2** - factor-level 2 (or "other" when contrasting factor-level 1 with all other levels)
- **correlation** - correlation of the features projection explaining the difference between the features, < 0 when intensity for level 1 is greater (from formula in Supplement to Wiklund, *op. cit.*).  Note that, for a given contrast, there is a linear relationship between 'loadp' and 'correlation'.
- **covariance** - covariance of the features projection explaining the difference between the features, < 0 when intensity for level 1 is greater (from formula in *ibid.*)
- **vip4p** - "variable importance in projection" to the predictive projection, VIP\ :subscript:`4,p` (Galindo-Prieto *op. cit.*)
- **vip4o** - "variable importance in projection" to the orthogonal projection, VIP\ :subscript:`4,o` (*ibid.*)
- **loadp** - variable loading for the predictive projection (Wiklund *op. cit.*)
- **loado** - variable loading for the orthogonal projection (*ibid.*)
- **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:

- **featureID** - feature identifier
- **salientLevel** - salient level, i.e., for the feature, the class-level having the greatest median intensity
- **salientRCV** - 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
- **salience** - 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

Wild card patterns to match level-names
---------------------------------------

"wild card" patterns may be used to select level-names.

- use '``?``' to match a single character
- use '``*``' to match zero or more characters
- the entire pattern must match the level name

For example

- '``??.le*``' matches '``my.level``' but not '``my.own.level``'
- '``*.level``' matches '``my.level``' and '``my.own.level``'
- '``*.level``' matches neither '``my.level``' nor '``my.own.level``'

Regular expression patterns to match level-names
------------------------------------------------

"regular expression" patterns may be used to select level-names.

POSIX 1003.2 standard regular expressions allow precise pattern-matching and are exhaustively defined at:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html

However, only a few basic building blocks of regular expressions need to be mastered for most cases:

- '``^``' matches the beginning of a level-name
- '``$``' matches the end of a level-name
- '``.``' outside of square brackets matches a single character
- '``*``' matches character specified immediately before zero or more times
- Square brackets specify a set of characters to be matched.  Within square brackets:

  - '``^``' as the first character specifies that the list of characters are those that should **not** be matched.
  - '``-``' is used to specify ranges of characters

Caveat: The tool wrapper uses the comma ('``,``') to split a list of sample-level names, so **commas may not be used within regular expressions for this tool.**

First Example: Consider a field of level-names consisting of '``marq3,marq6,marq9,marq12,front3,front6,front9,front12``'

- The regular expression '``^front[0-9][0-9]*$``' will match the same sample-levels as '``front3,front6,front9,front12``'
- The regular expression '``^[a-z][a-z]3$``' will match the same sample-levels as '``front3,marq3``'
- The regular expression '``^[a-z][a-z]12$``' will match the same sample-levels as '``front12,marq12``'
- The regular expression '``^[a-z][a-z][0-9]$``' will match the same sample-levels as '``front3,front6,front9,marq3,marq6,marq9``'

Second Example: Consider these regular expression patterns as possible matches to a sample-level name '``AB0123``':

- '``^[A-Z][A-Z][0-9][0-9]*$``' - MATCHES '``**^AB0123$**``'
- '``^[A-Z][A-Z]*[0-9][0-9]*$``' - MATCHES '``**^AB0123$**``'
- '``^[A-Z][0-9]*``' - MATCHES  '``**^A** B0123$``' - first character is a letter, '``*``' can specify zero characters, and end of line did not need to be matched.
- '``^[A-Z][A-Z][0-9]``' - MATCHES  '``**^AB0** 123$``' - first two characters are letters aind the third is a digit.
- '``^[A-Z][A-Z]*[0-9][0-9]$``' - NO MATCH - the name does not end with the pattern '``[A-Z][0-9][0-9]$``', i.e., it ends with four digits, not two.
- '``^[A-Z][0-9]*$``' - NO MATCH - the pattern specifies that second character and all those that follow, if present, must be digits.

Working examples
----------------

**Input files**

  +-------------------+-------------------------------------------------------------------------------------------------------------------+
  | Input File        | Download from URL                                                                                                 |
  +===================+===================================================================================================================+
  | Data matrix       | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/input_dataMatrix.tsv       |
  +-------------------+-------------------------------------------------------------------------------------------------------------------+
  | Sample metadata   | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/input_sampleMetadata.tsv   |
  +-------------------+-------------------------------------------------------------------------------------------------------------------+
  | Variable metadata | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/input_variableMetadata.tsv |
  +-------------------+-------------------------------------------------------------------------------------------------------------------+

**Example 1:** Include in the analysis only features identified as pair-wise significant in the Univariate test.

  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Input Parameter or Result                  | Value                                                                                                                                  |
  +============================================+========================================================================================================================================+
  | Factor of interest                         | k10                                                                                                                                    |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Univariate Significance-Test               | kruskal                                                                                                                                |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Retain only pairwise-significant features  | Yes                                                                                                                                    |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Levels of interest                         | k[12],k[3-4]                                                                                                                           |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Level-name matching                        | use regular expressions for matching level-names                                                                                       |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Number of features having extreme loadings | ALL                                                                                                                                    |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output primary table                       | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_corcov.tsv                    |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output salience table                      | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_salience.tsv                  |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output figures PDF                         | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_detail.pdf                    |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+

**Example 2:** Include in the analysis only features identified as overall-significant in the Univariate test.  Note that this even includes these features in contrasts where they were not determined to be pair-wise significant in the Univariate test.  Thus, more features are included than in Example 1.

  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Input Parameter or Result                  | Value                                                                                                                                  |
  +============================================+========================================================================================================================================+
  | Factor of interest                         | k10                                                                                                                                    |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Univariate Significance-Test               | kruskal                                                                                                                                |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Retain only pairwise-significant features  | No                                                                                                                                     |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Levels of interest                         | ``*``                                                                                                                                  |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Level-name matching                        | use wild cards for matching level-names                                                                                                |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Number of features having extreme loadings | 5                                                                                                                                      |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output primary table                       | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_corcov_all.tsv                |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output salience table                      | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_salience_all.tsv              |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output figures PDF                         | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_detail_all.pdf                |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+

**Example 3:** Include all features in the analysis without regard to Univariate testing.  Univariate testing is not even a pre-requisite to using the tool when 'none' is selected for the test.  Thus, more features are included than in Example 2.

  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Input Parameter or Result                  | Value                                                                                                                                  |
  +============================================+========================================================================================================================================+
  | Factor of interest                         | k10                                                                                                                                    |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Univariate Significance-Test               | none                                                                                                                                   |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Retain only pairwise-significant features  | No                                                                                                                                     |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Levels of interest                         | k[12],k[3-4]                                                                                                                           |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Level-name matching                        | use regular expressions for matching level-names                                                                                       |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Number of features having extreme loadings | 0                                                                                                                                      |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output primary table                       | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_corcov_global.tsv             |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output salience table                      | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_salience_global.tsv           |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output figures PDF                         | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_detail_global.pdf             |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+

**Example 4:** Analysis of a two-level factor (including all features).  This suppresses the contrasts of "each factor vs. the aggregate of all the others".

  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Input Parameter or Result                  | Value                                                                                                                                  |
  +============================================+========================================================================================================================================+
  | Factor of interest                         | lohi                                                                                                                                   |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Univariate Significance-Test               | none                                                                                                                                   |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Retain only pairwise-significant features  | No                                                                                                                                     |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Levels of interest                         | low,high                                                                                                                               |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Level-name matching                        | use regular expressions for matching level-names                                                                                       |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Number of features having extreme loadings | 3                                                                                                                                      |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output primary table                       | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_corcov_lohi.tsv               |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output salience table                      | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_salience_lohi.tsv             |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
  | Output figures PDF                         | https://raw.githubusercontent.com/HegemanLab/w4mcorcov_galaxy_wrapper/master/test-data/expected_contrast_detail_lohi.pdf               |
  +--------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+


Trademarks
----------

OPLS-DA\ :superscript:`®`, SIMCA\ :superscript:`®`, and S-PLOT\ :superscript:`®` are registered trademarks of the Umetrics company.  http://umetrics.com/about-us/trademarks


Release notes
-------------

0.98.6

- bug fix: set 'crossvalI' param (of R function 'ropls::opls') to the number of samples when the there are fewer than seven samples.

0.98.5

- bug fix: fit feature-labels within clipping region of cor-vs.cov plot
- new feature: optionally (and by default) suppress labels for features with extreme orthogonal loadings

0.98.3

- add support for two-level factors
- add adjusted mz and rt to output tables
- allow explicitly setting the number of features with extreme loadings to be labelled on the correlation vs. covariance plot
- add loadings to corcov table

0.98.2

- first release


  ]]></help>
  <citations>
    <citation type="doi">10.5281/zenodo.1034784</citation>
    <!-- Galindo_Prieto_2014 Variable influence on projection (VIP) for OPLS -->
    <citation type="doi">10.1002/cem.2627</citation>
    <!-- Giacomoni_2014 W4M 2.5 -->
    <citation type="doi">10.1093/bioinformatics/btu813</citation>
    <!-- Guitton_2017 W4M 3.0 -->
    <citation type="doi">10.1016/j.biocel.2017.07.002</citation>
    <!-- Mehmood_2012 PLS-based variable-selection -->
    <citation type="doi">10.1186/1748-7188-6-27</citation>
    <!-- Rajalahti_2009 Biomarker discovery using selectivity ratio -->
    <citation type="doi">10.1016/j.chemolab.2008.08.004</citation>
    <!-- Rinuardo 2016 -->
    <citation type="doi">10.3389/fmolb.2016.00026</citation>
    <!-- Sun_2016 Urinary Biomarkers for adolescent idiopathic scoliosis -->
    <citation type="doi">10.1038/srep22274</citation>
    <!-- Th_venot_2015 Urinary metabolome statistics -->
    <citation type="doi">10.1021/acs.jproteome.5b00354</citation>
    <!-- ropls package -->
    <citation type="bibtex"><![CDATA[
    @incollection{Thevenot_ropls_2017,
      author = {Th{\'{e}}venot, Etienne A.},
      title = {ropls: PCA, PLS(-DA) and OPLS(-DA) for multivariate analysis and feature selection of omics data},
      publisher = {bioconductor.org},
      year = {2017},
      doi = {10.18129/B9.bioc.ropls},
      booktitle = {Bioconductor: Open source software for bioinformatics},
      address = {Roswell Park Cancer Institute},
    }
    ]]></citation>
    <!-- Wiklund_2008 OPLS PLS-DA and S-PLOT -->
    <citation type="doi">10.1021/ac0713510</citation>
  </citations>
  <!--
     vim:noet:sw=4:ts=4
-->
</tool>