view qualitymetrics_config.xml @ 0:b4f5b5bc01dd draft

planemo upload for repository https://github.com/workflow4metabolomics/qualitymetrics.git commit 73366dd3473c509341ab9ba1df8ba748d08a50a1
author ethevenot
date Sat, 06 Aug 2016 12:01:17 -0400
parents
children 6d3b7b6573d8
line wrap: on
line source

<tool id="quality_metrics" name="Quality Metrics" version="2.2.4">
  <description>Metrics and graphics to check the quality of the data</description>

  <requirements>
    <requirement type="package" version="3.2.2">R</requirement>
    <requirement type="package">r-batch</requirement>
    <requirement type="package" version="1.4.2">bioconductor-ropls</requirement>
  </requirements>
  
  <stdio>
    <exit_code range="1:" level="fatal" />
  </stdio>
  
  <command><![CDATA[
  Rscript $__tool_directory__/qualitymetrics_wrapper.R
  dataMatrix_in "$dataMatrix_in"
  sampleMetadata_in "$sampleMetadata_in"
  variableMetadata_in "$variableMetadata_in"
  
  CV "${CV_condition.CV}"
  #if str($CV_condition.CV ) == 'TRUE':
  Compa "${CV_condition.Compa}"
  seuil  "${CV_condition.seuil}"
  #else:
  Compa "TRUE"
  seuil "1"
  #end if
  
  #if $advPar.optC == "full"
  poolAsPool1L "$advPar.poolAsPool1L"
  #else:
  poolAsPool1L "TRUE"
  #end if
  
  sampleMetadata_out "$sampleMetadata_out"      
  variableMetadata_out "$variableMetadata_out"
  figure "$figure"
  information "$information"
  ]]></command>
  
  <inputs>
    <param name="dataMatrix_in" type="data" label="Data matrix file" help="" format="tabular" />
    <param name="sampleMetadata_in" type="data" label="Sample metadata file" help="" format="tabular" />
    <param name="variableMetadata_in" type="data" label="Variable metadata file" help="" format="tabular" />
    
    <conditional name="CV_condition">
      <param name="CV" type="select" label="Coefficient of Variation" help="">
        <option value="FALSE">no</option>
        <option value="TRUE">yes</option>
      </param>
      <when value="TRUE">
        <param name="Compa" label="Which type of CV calculation should be done" type="select" display="radio" help="">
          <option value="TRUE">ratio between pool and sample CVs</option>
          <option value="FALSE">only pool CV</option>
        </param>
        <param name="seuil" type="float" label="Threshold" value="1.25" min="0.0000000000000001" help="if comparing pool and sample CVs, corresponds to the max ratio tolerated (basically between 1.0 and 1.25) ; else corresponds to the max pool CV tolerated (basically 0.3)"/>
      </when>
      <when value="FALSE">
	<param name="Compa" type="hidden" value="TRUE"/>
	<param name="seuil" type="hidden" value="1"/>
      </when>	
    </conditional>
    
    <conditional name="advPar">
      <param name="optC" type="select" label="Advanced parameters" >
	<option value="default" selected="true">Use default</option>
	<option value="full">Full parameter list</option>
      </param>     
      <when value="full">
	<param name="poolAsPool1L" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE" label="Use 'pool' samples as 'pool1' when computing the correlation with dilution?"/>
      </when>
      <when value="default">
      	<param name="poolAsPool1L" type="hidden" value="TRUE"/>
      </when>
    </conditional>
    
  </inputs>
  
  <outputs>
    <data name="sampleMetadata_out" label="${tool.name}_${sampleMetadata_in.name}" format="tabular" ></data>
    <data name="variableMetadata_out" label="${tool.name}_${variableMetadata_in.name}" format="tabular" ></data>
    <data name="figure" label="${tool.name}_figure.pdf" format="pdf"/>
    <data name="information" label="${tool.name}_information.txt" format="txt"/>
  </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="CV" value="FALSE"/>
      <param name="optC" value="default"/>
      <output name="sampleMetadata_out" file="output-sampleMetadata.tsv"/>
      <output name="variableMetadata_out" file="output-variableMetadata.tsv"/>
    </test>
  </tests>
  
  <help>
    
.. class:: infomark

**Authors** Marion Landi, Melanie Petera and Etienne Thevenot (W4M Core Development Team)

---------------------------------------------------

.. class:: infomark

**Tool updates**

See the **NEWS** section at the bottom of this page
  
---------------------------------------------------

.. class:: infomark

**References**

| Thevenot EA., 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 (http://dx.doi.org/10.1021/acs.jproteome.5b00354)
| Mason R., Tracy N. and Young J. (1997). A practical approach for interpreting multivariate T2 control chart signals. *Journal of Quality Technology*, **29**:396-406.
| Alonso A., Julia A., Beltran A., Vinaixa M., Diaz M., Ibanez L., Correig X. and Marsal S. (2011). AStream: an R package for annotating LC/MS metabolomic data. *Bioinformatics*, **27**:1339-1340. (http://dx.doi.org/10.1093/bioinformatics/btr138)

---------------------------------------------------

========================
Quality Metrics
========================

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

 | The **Quality Metrics** tool provides quality metrics of the samples and variables, and visualization of the data matrix
 | The optional *Coefficient of Variation* arguments allows to flag the variables with a pool CV (or a pool CV over sample CV ratio) above a specific threshold
  | The advanced *PoolAsPool1* argument is used when correlations with pool dilutions are computed: When set to TRUE [default], samples indicated as "pool" will be considered as "pool1" for the correlation together with the other pool dilutions (e.g. "pool2", "pool4", etc.); otherwise, "pool" samples will not be considered to compute the correlation (this enables the experimenter to have distinct "pool" samples for the computation of CV and "pool1" samples for the computation of dilution)
 | The **sampleMetadata** is returned as output with 3 additional columns containing the p-values for the Hotellings'T2 and Z-scores of intensity deciles and proportion of missing values
 | The **variableMetadata** is returned as output; in case a **sampleType** column is included in the input sampleMetadata file, additional columns will be added to indicate the variable quality metrics (eg mean, sd, CV on 'pool', 'sample' or 'blank', or correlation with pool dilutions, depending on the known type present in the 'sampleType' column)
 | A **figure** is generated (pdf file) which illustrates the main computed sample and variable metric values

 
 
-----------------
Workflow position
-----------------

.. image:: QualityControl.png
        :width: 800



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

+----------------------------+---------+
| Parameter : num + label    |  Format |
+============================+=========+
| 1 : Data matrix file       | tabular |
+----------------------------+---------+
| 2 : Sample metadata file   | tabular |
+----------------------------+---------+
| 3 : Variable metadata file | tabular |
+----------------------------+---------+

----------
Parameters
----------

Data matrix
	| contains the intensity values of the variables.
	|

Sample metadata file
	| contains the metadata of the samples; in particular
	| when the 'sampleType' column is available, with known types such as 'blank', 'sample', 'pool', 'poolN' (where N is a dilution factor of the pool), metrics will be computed (eg mean, sd, CV, correlation with the dilution factor, etc) for each variable (see the 'PoolAsPool1' argument below)
	| 'pool' (and 'sample') should be present in the 'sampleType' column when setting the 'coefficient of variation' to TRUE
	| 
	
Variable metadata file
	| contains variable information.
	|

Note:
	| Required formats for the dataMatrix, sampleMetadata, and variableMetadata files are described in the **HowTo** entitled 'Format Data For Postprocessing' available on the main page of Workflow4Metabolomics.org; the formats of the 3 tables can be further checked with the **Check Format** module
	|

Coefficient of Variation
	| If 'yes' (not default): variables are classed according to the Coefficient of Variation (CV)
	| i.e.: CV of pools (and CV of samples if needed) are calculated and compared to a defined threshold;
	| then variables are classed with a 0/1 coding. 
	| 

Which type of CV calculation should be done (only if CV=yes)
	| Type of CV comparison that will be used.
	| 'ratio between pool and sample CVs' **OR** 'only pool CV'
	|

Threshold (only if CV=yes)
	| If comparing pool and sample CVs, corresponds to the max ratio tolerated (basically between 1.0 and 1.25).
	| Else corresponds to the max pool CV tolerated (basically 0.3).
	|

PoolAsPool1 (Advanced parameter)
	| If 'poolN' (where N is a dilution factor) sample types are present in the 'sampleType' column of the sample metadata file, the Pearson correlation of the intensity with the dilution factor is computed for each variable; the 'PoolAsPool1' parameter indicates whether samples of 'pool' types should be considered as 'pool1' (and hence included in the computation of dilution correlations); default is TRUE
	

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


sampleMetadata.tabular
	| tsv output
	| 3 additional columns have been added to the input sampleMetadata file and contain the **p-values** of
	|  1) the **Hotelling's T2** test in the first plane of PC components (Mason et al, 1997)
	|  2) the **Z-score** of **intensity deciles** (Alonso et al, 2011)
	|  3) the **Z-score** of the proportion of **missing values** (Alonso et al, 2011)
	| for each test, low p-values indicate samples with extreme behaviour
	|

variableMetadata.tabular
	| tsv output
	| When the type of samples is available (ie the **sampleType** column is included in the input sampleMetadata file), variable metrics are computed: **sample**, **pool**, and **blank** **mean**, **sd** and **CV** (if the corresponding types are present in the 'sampleType' column), as well as **'blank' mean / 'sample' mean**, and **'pool' CV / 'sample' CV ratio**
	| If pool dilutions have been used and are indicated in the 'sampleType' column as **poolN** where N is an integer indicating the dilution factor (eg **pool2** for a two-fold dilution of the pool; note that the non-diluted pool remains indicated as 'pool') the Pearson **correlation** (and corresponding p-value) between the intensity and the dilution factor is computed for each variable.
	| When the **Coefficient of variation** argument is set to 'TRUE', the variableMetadata begins with 2 (or 3) columns indicating the pool CV (and the sample CV) and if the pool CV (or the ratio between pool CV and sample CV) is above the selected threshold
	|
	
figure.pdf
	| Figure summarizing the various values of the computed metrics and tests; includes several visualizations of the samples (eg, PCA scores) and intensities (eg, image of the data matrix)
	|
	
information.txt
	| Text file with informations regarding the metrics computed, eg those depending on the availability of the 'sampleMetadata' column, and specific types such as 'sample', 'pool', pool dilutions ('poolN'), or 'blank'
	|
	

---------------------------------------------------

---------------
Working example
---------------

|

.. class:: infomark

See the **W4M00001b_sacurine-complete** shared history in the **Shared Data/Published Histories** menu (https://galaxy.workflow4metabolomics.org/history/list_published)

---------------------------------------------------

----
NEWS
----

CHANGES IN VERSION 2.2.4
========================

Additional running and installation tests added with planemo, conda, and travis

CHANGES IN VERSION 2.2.3
========================

INTERNAL MODIFICATIONS

Modifications of the **qualitymetrics_script.R** file to handle the recent **ropls** package versions (i.e. 1.3.15 and above) which use S4 classes

Creating tests for the R code

CHANGES IN VERSION 2.2.2
========================

Minor internal changes


</help>

<citations>
  <citation type="doi">10.1021/acs.jproteome.5b00354</citation>
  <citation type="doi">10.1093/bioinformatics/btr138</citation>
  <citation type="bibtex">@Article{Mason1997,
  Title                    = {A practical approach for interpreting multivariate T2 control chart signals},
  Author                   = {Mason, RL. and Tracy, ND. and Young, JC.},
  Journal                  = {Journal of Quality Technology},
  Year                     = {1997},
  Number                   = {4},
  Pages                    = {396-406},
  Volume                   = {29},
  }</citation>
  <citation type="doi">10.1093/bioinformatics/btu813</citation>
</citations>

<!--

Input files
===========

| **To generate the "dataMatrix", "sampleMetadata" and "variableMetadata" files:**
|   **1) copy/paste the values below in three distinct .txt files**
|   **2) use the "Get Data" / "Upload File" in the "Tools" (left) panel from the Galaxy page by choosing:**
|     **Convert spaces to tabs: 'Yes'**
| 

**dataMatrix file**::

	dataMatrix QC_4 sam_44 sam_18 sam_23 blk_3 sam_9 sam_22 QC_6 blk_4
	met_031 5601185.9 4446133.4 4144765.4 3085899.9 NA 6748534.9 5819543.8 3256720.3 NA
	met_032 4.07 4.08 4.11 4.1 NA 4.04 4.13 4.11 NA
	met_033 1448205184 1456986135 993364802.3 1162711600 5569143.2 1043559922 1465003454 1052094028 5247494.3
	met_034 4.11 4.21 4.18 4.1 4.09 4.1 4.14 4.11 4.08
	met_035 3777580.7 2296751 1890711.7 1767424.6 6567.5 1906253.5 3043253.9 2856958.5 7940.8
	met_036 4.12 4.21 4.26 4.1 4.11 4.22 4.27 4.12 4.2
	met_037 4982658.7 3751181.8 4219033.2 2425759.9 NA 11978184.4 4306459.5 3352187 NA
	met_038 4.45 4.38 4.4 4.4 NA 4.44 4.46 4.32 NA
	met_039 6658087.7 3231434.7 2932986.5 4098788.3 NA 3691132.6 6108614.4 4541941.9 NA
	met_040 4.49 4.56 4.48 4.5 NA 4.45 4.54 4.46 NA
	
**sampleMetadata file**::

	sampleMetadata injectionOrder batch sampleType
	QC_4 19 batch1 pool
	sam_44 20 batch1 sample
	sam_18 23 batch1 sample
	sam_23 27 batch1 sample
	blk_3 31 batch1 blank
	sam_9 34 batch1 sample
	sam_22 38 batch1 sample
	QC_6 42 batch1 pool
	blk_4 43 batch1 blank

**variableMetadata file**::

	variableMetadata number
	met_031 31
	met_032 32
	met_033 33
	met_034 34
	met_035 35
	met_036 36
	met_037 37
	met_038 38
	met_039 39
	met_040 40

Figure output
=============

| You should obtain with this very simplified dataset the following figure:
|

.. image:: qualitymetrics_workingExampleImage.png
        :width: 600

-->

</tool>