diff macros.xml @ 2:2de209fb390b draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/DIMet commit 30fe10acdf65c6917856a0eae21dc91abd2f609f
author iuc
date Thu, 15 Feb 2024 12:52:26 +0000
parents 79720105f8c0
children c6879530205c
line wrap: on
line diff
--- a/macros.xml	Tue Jan 23 14:55:42 2024 +0000
+++ b/macros.xml	Thu Feb 15 12:52:26 2024 +0000
@@ -1,42 +1,46 @@
 <macros>
-    <token name="@TOOL_VERSION@">0.1.4</token>
+    <token name="@TOOL_VERSION@">0.2.1</token>
     <token name="@VERSION_SUFFIX@">1</token>
     <token name="@EXECUTABLE@">pca</token>
-    <xml name="factor_repeat">
-        <repeat name="rep_factorName" title="Factor" min="1">
-            <param name="factorName" type="text" value="FactorName" label="Specify a factor name, e.g. effects_drug_x or cancer_markers"
-                help="Only letters, numbers and underscores will be retained in this field">
-                <sanitizer>
-                    <valid initial="string.letters,string.digits"><add value="_" /></valid>
-                </sanitizer>
-            </param>
-            <repeat name="rep_factorLevel" title="Factor level" min="2" default="2">
-                <param name="factorLevel" type="text" value="FactorLevel" label="Specify a factor level, typical values could be 'tumor', 'normal', 'treated' or 'control'"
-                    help="Only letters, numbers and underscores will be retained in this field">
-                    <sanitizer>
-                        <valid initial="string.letters,string.digits"><add value="_" /></valid>
-                    </sanitizer>
-                </param>
-                <yield/>
-            </repeat>
-        </repeat>
-    </xml>
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="@TOOL_VERSION@">dimet</requirement>
         </requirements>
     </xml>
+    <xml name="statistical_test_for_multigroup">
+        <param name="stat_test" type="select" value="KW"  display="radio" label="Select statistical to apply" help="Please enter at max 1 statistical test by file">
+            <option value="KW">Kruskal-Wallis</option>
+        </param>
+    </xml>
     <xml name="statistical_test">
-        <param name="stat_test" type="select" value="Tt"  display="radio" label="Select statistical to apply" help="Please enter at max 1 statistical test by file">
-            <option value="Tt">t-test</option>
-            <option value="MW">Mann Whitney</option>
-            <option value="KW">Kruskall Wallis</option>
-            <option value="ranksum">Wilcoxon's rank sum test</option>
-            <option value="Wcox">Wilcoxon signed-rank test</option>
-            <option value="BrMu">Brunner-Munzel test</option>
-            <option value="prm-scipy">permutations test</option>
-            <option value="disfit">distribution fitting (of the z-score of the ratios), disfit needs several hundreds of metabolites to be trustful.</option>
-        </param>
+        <conditional name="statistics">
+            <param name="statistical_test_type" type="select" label="Choose which type of statistical test to perform" help="Choose which type of statistical test to perform">
+                <option value="parametric">parametric</option>
+                <option value="non-parametric-rank" selected="true">non-parametric (rank based)</option>
+                <option value="non-parametric-distribution">non-parametric (distribution based)</option>
+            </param>
+            <when value="parametric">
+                <param name="stat_test" type="select" display="radio" label="Select statistical to apply" help="Please enter at max 1 statistical test by file">
+                    <option value="Tt" selected="true">t-test</option>
+                </param>
+            </when>
+            <when value="non-parametric-rank">
+                <param name="stat_test" type="select" display="radio" label="Select statistical to apply" help="Please enter at max 1 statistical test by file">
+                    <option value="MW">Mann Whitney</option>
+                    <option value="KW">Kruskal-Wallis</option>
+                    <option value="ranksum" selected="true">Wilcoxon's rank sum test</option>
+                    <option value="Wcox">Wilcoxon signed-rank test</option>
+                    <option value="BrMu">Brunner-Munzel test</option>
+                </param>
+            </when>
+            <when value="non-parametric-distribution">
+                <param name="stat_test" type="select" display="radio" label="Select statistical to apply" help="Please enter at max 1 statistical test by file">
+                    <option value="prm-scipy" selected="true">permutations test</option>
+                    <option value="disfit">distribution fitting (of the z-score of the ratios), disfit needs several hundreds of metabolites to be trustful.</option>
+                </param>
+            </when>
+        </conditional>
+
     </xml>
     <xml name="citations">
         <citations>
@@ -86,14 +90,14 @@
     </xml>
     <xml name="input_parameters_metabologram">
         <conditional name="data_input">
-            <param name="data_input_selector" type="select" label="Abundance, Enrichment or Isotopologues count files" help="Select between raw abundance, mean enrichment or isotopologue files">
+            <param name="data_input_selector" type="select" label="Abundance, Enrichment or Isotopologues quantification files" help="Select between raw abundance and mean enrichment files">
                 <option value="abundance" selected="True">abundance</option>
                 <option value="mean_enrichment">mean_enrichment</option>
             </param>
             <when value="abundance">
                 <expand macro="abundance_file_macros"/>
                 <param name="metabolites_list" type="select" optional="false" multiple="true"
-                       label="Select Metabolite(s) for factor 1 to plot (1 Min.). You have to load a abundance file prior to have access to metabolite list">
+                       label="Select Metabolite(s) for condition 1 to plot (1 Min.). You have to load a abundance file prior to have access to metabolite list">
                     <validator type="length" min="1" message="Please enter at max 2 compartments"/>
                     <options from_dataset="abundance_file">
                         <column name="metabolite_or_isotopologue" index="0"/>
@@ -115,7 +119,7 @@
             <when value="mean_enrichment">
                 <expand macro="enrichment_file_macros"/>
                 <param name="metabolites_list" type="select" optional="false" multiple="true"
-                       label="Select Metabolite(s) for factor 1 to plot (1 Min.). You have to load a abundance file prior to have access to metabolite list">
+                       label="Select Metabolite(s) for condition 1 to plot (1 Min.). You have to load a abundance file prior to have access to metabolite list">
                     <validator type="length" min="1" message="Please enter at max 2 compartments"/>
                     <options from_dataset="me_or_frac_contrib_file">
                         <column name="metabolite_or_isotopologue" index="0"/>
@@ -139,9 +143,33 @@
         <param name="path_kegg_transcripts" type="data" format="tabular" label="Pathways kegg transcripts file" help="A file with the pathways and respective gene symbols, which must match with those present in the transcriptomics data. The names of the columns must be the pathways' names, see the minimal data example downloaded from zenodo as explained above. (see help below for more details)"/>
         <expand macro="metadata_file_macros"/>
     </xml>
+    <xml name="input_parameters_bivar_analysis">
+        <conditional name="data_input">
+            <param name="data_input_selector" type="select" label="Abundance, Enrichment or Isotopologues quantification files" help="Select between raw abundance, mean enrichment or isotopologue files">
+                <option value="abundance" selected="True">abundance</option>
+                <option value="mean_enrichment">mean_enrichment</option>
+                <option value="isotop_prop">isotop_prop</option>
+                <option value="isotop_abs">isotop_abs</option>
+            </param>
+            <when value="abundance">
+                <expand macro="abundance_file_macros"/>
+
+            </when>
+            <when value="mean_enrichment">
+                <expand macro="enrichment_file_macros"/>
+            </when>
+            <when value="isotop_prop">
+                <expand macro="isotopologue_prop_file_macros"/>
+            </when>
+            <when value="isotop_abs">
+                <expand macro="isotopologue_abs_file_macros"/>
+            </when>
+        </conditional>
+        <expand macro="metadata_file_macros"/>
+    </xml>
     <xml name="input_parameters_diff_analysis">
         <conditional name="data_input">
-            <param name="data_input_selector" type="select" label="Abundance, Enrichment or Isotopologues count files" help="Select between raw abundance and mean enrichment files">
+            <param name="data_input_selector" type="select" label="Abundance, Enrichment or Isotopologues quantification files" help="Select between raw abundance, mean enrichment or isotopologue files">
                 <option value="abundance" selected="True">abundance</option>
                 <option value="mean_enrichment">mean_enrichment</option>
                 <option value="isotop_prop">isotop_prop</option>
@@ -167,6 +195,34 @@
         </conditional>
         <expand macro="metadata_file_macros"/>
     </xml>
+    <xml name="input_parameters_multi_diff_analysis">
+        <conditional name="data_input">
+            <param name="data_input_selector" type="select" label="Abundance, Enrichment or Isotopologues quantification files" help="Select between raw abundance, mean enrichment or isotopologue files">
+                <option value="abundance" selected="True">abundance</option>
+                <option value="mean_enrichment">mean_enrichment</option>
+                <option value="isotop_prop">isotop_prop</option>
+                <option value="isotop_abs">isotop_abs</option>
+            </param>
+            <when value="abundance">
+                <expand macro="abundance_file_macros"/>
+                <expand macro="statistical_test_for_multigroup"/>
+
+            </when>
+            <when value="mean_enrichment">
+                <expand macro="enrichment_file_macros"/>
+                <expand macro="statistical_test_for_multigroup"/>
+            </when>
+            <when value="isotop_prop">
+                <expand macro="isotopologue_prop_file_macros"/>
+                <expand macro="statistical_test_for_multigroup"/>
+            </when>
+            <when value="isotop_abs">
+                <expand macro="isotopologue_abs_file_macros"/>
+                <expand macro="statistical_test_for_multigroup"/>
+            </when>
+        </conditional>
+        <expand macro="metadata_file_macros"/>
+    </xml>
     <xml name="suffix">
         <param name="suffix" type="text" optional="false" label="suffix to add to output files" >
             <sanitizer invalid_char="">
@@ -177,7 +233,7 @@
         </param>      
     </xml>
     <xml name="conditions">
-        <param name="conditions" type="select" optional="false" multiple="true" label="Browse conditions from metadata file (1 min. only if two timepoints are set. 2 max.). You have to load a metadata file prior to have access to metabolite list">
+        <param name="conditions" type="select" optional="false" multiple="true" label="Browse conditions from metadata file (1 min. only if two timepoints are set. 2 max.). You have to load a metadata file prior to have access to condition list">
             <options from_dataset="metadata_path">
                 <column name="condition" index="1"/>
                 <column name="value" index="1"/>
@@ -232,7 +288,7 @@
         </param>
     </xml>
     <xml name="timepoint">
-        <param name="timepoint" type="select" optional="true" multiple="true" label="Browse timepoint from metadata file (1 min. only if two conditions are set.)">
+        <param name="timepoint" type="select" optional="false" multiple="true" label="Browse timepoint from metadata file (1 min.)">
             <options from_dataset="metadata_path">
                 <column name="timepoint" index="2"/>
                 <column name="value" index="2"/>
@@ -307,6 +363,25 @@
             </sanitizer>
         </param>
     </xml>
+    <xml name="compartments_metabologram">
+        <param name="compartments" type="select" optional="false" multiple="false"
+               label="Browse compartments from metadata file (1 max.). You have to load a metadata file prior to have access to compartments">
+            <options from_dataset="metadata_path">
+                <column name="compartment" index="4"/>
+                <column name="value" index="4"/>
+                <filter type="unique_value" name="compartment" column="4"/>
+                <filter type="remove_value" value="compartment"/>
+            </options>
+            <sanitizer>
+                <valid initial="default">
+                    <add preset="string.printable"/>
+                    <add value="\t"/>
+                    <remove value="&quot;"/>
+                    <remove value="&apos;"/>
+                </valid>
+            </sanitizer>
+        </param>
+    </xml>
     <xml name="compartments">
         <param name="compartments" type="select" optional="false" multiple="true"
                label="Browse compartments from metadata file (1 min.). You have to load a metadata file prior to have access to compartments">
@@ -328,7 +403,7 @@
     </xml>
     <xml name="abundance_metabolites_list">
         <param name="metabolites_list" type="select" optional="false" multiple="true"
-               label="Select Metabolite(s) for factor 1 to plot (1 min). You have to load a abundance file prior to have access to metabolite list">
+               label="Select Metabolite(s) for condition 1 to plot (1 min). You have to load a abundance file prior to have access to metabolite list">
             <validator type="length" min="1" message="Please enter at max 2 compartments"/>
             <options from_dataset="abundance_file">
                 <column name="metabolite_or_isotopologue" index="0"/>
@@ -348,8 +423,8 @@
     </xml>
     <xml name="enrichment_metabolites_list">
         <param name="metabolites_list" type="select" optional="false" multiple="true"
-               label="Select Metabolite(s) for factor 1 to plot (1 Min.). You have to load a abundance file prior to have access to metabolite list">
-            <validator type="length" min="1" message="Please enter at max 2 compartments"/>
+               label="Select Metabolite(s) for condition 1 to plot (1 Min.). You have to load a abundance file prior to have access to metabolite list">
+            <validator type="length" min="1" message="Please enter at min 1 metabolite"/>
             <options from_dataset="me_or_frac_contrib_file">
                 <column name="ID" index="0"/>
                 <column name="value" index="0"/>
@@ -369,7 +444,7 @@
     <xml name="isotopologue_metabolites_list">
         <param name="metabolites_list" type="select" optional="false" multiple="true"
                label="Select Metabolite(s) to plot (1 Min.). You have to load a abundance file prior to have access to metabolite list">
-            <validator type="length" min="1" message="Please enter at max 2 compartments"/>
+            <validator type="length" min="1" message="Please enter at min 1 metabolite"/>
             <options from_dataset="isotop_prop_file">
                 <column name="ID" index="0"/>
                 <column name="value" index="0"/>
@@ -387,27 +462,132 @@
         </param>
     </xml>
     <xml name="deg_list">
-        <repeat name="deg_list" title="Deregulated gene set">
+        <repeat name="deg_list" title="Deregulated gene set" default="1" min="1">
             <param name="input" type="data" format="tabular" label="Deregulated genes set"/>
             <param name="idcol" type="data_column" data_ref="input" label="Column for id" use_header_names="true"/>
             <param name="valuecol" type="data_column" data_ref="input" label="Column for values" use_header_names="true"/>
+            <param name="timepoint" type="select" optional="false" multiple="false" label="Browse timepoint from metadata file (1 min.)">
+                <options from_dataset="metadata_path">
+                    <column name="timepoint" index="2"/>
+                    <column name="value" index="2"/>
+                    <filter type="unique_value" name="timepoint" column="2"/>
+                    <filter type="remove_value" value="timepoint"/>
+                    <filter type="sort_by" name="timepoint" column="1"/>
+                </options>
+                <sanitizer>
+                    <valid initial="default">
+                        <add preset="string.printable"/>
+                        <add value="\t"/>
+                        <remove value="&quot;"/>
+                        <remove value="&apos;"/>
+                    </valid>
+                </sanitizer>
+            </param>
+            <repeat name="factor_list" title="Conditions" default="2" min="2" max="2" help="Specify conditions to compare from metadata file (for each comparison, the first specified condition is the reference). You have to load a metadata file prior to have access to condition list">
+                <param name="condition" label="Condition" type="select" optional="false" multiple="false">
+                    <options from_dataset="metadata_path">
+                        <column name="condition" index="1"/>
+                        <column name="value" index="1"/>
+                        <filter type="unique_value" name="condition" column="condition"/>
+                        <filter type="remove_value" value="condition"/>
+                    </options>
+                    <sanitizer>
+                        <valid initial="default">
+                            <add preset="string.printable"/>
+                            <add value="\t"/>
+                            <remove value="&quot;"/>
+                            <remove value="&apos;"/>
+                        </valid>
+                    </sanitizer>
+                </param>
+            </repeat>
+
         </repeat>
     </xml>
+    <xml name="plot_abundance_factor_list">
+        <repeat name="plot_abundance_factor_list" title="Conditions" min="1" help="Specify conditions to compare from metadata file (1 min. only if two timepoints are set. 2 max.). You have to load a metadata file prior to have access to condition list">
+            <param name="condition" label="Condition" type="select" optional="false" multiple="false">
+                <options from_dataset="metadata_path">
+                    <column name="condition" index="1"/>
+                    <column name="value" index="1"/>
+                    <filter type="unique_value" name="condition" column="condition"/>
+                    <filter type="remove_value" value="condition"/>
+                </options>
+                <sanitizer>
+                    <valid initial="default">
+                        <add preset="string.printable"/>
+                        <add value="\t"/>
+                        <remove value="&quot;"/>
+                        <remove value="&apos;"/>
+                    </valid>
+                </sanitizer>
+            </param>
+        </repeat>
+    </xml>
+    <xml name="plot_factor_list">
+        <repeat name="plot_factor_list" title="Conditions" min="2" help="Specify conditions to compare from metadata file (1 min. only if two timepoints are set. 2 max.). You have to load a metadata file prior to have access to condition list">
+            <param name="condition" label="Condition" type="select" optional="false" multiple="false">
+                <options from_dataset="metadata_path">
+                    <column name="condition" index="1"/>
+                    <column name="value" index="1"/>
+                    <filter type="unique_value" name="condition" column="condition"/>
+                    <filter type="remove_value" value="condition"/>
+                </options>
+                <sanitizer>
+                    <valid initial="default">
+                        <add preset="string.printable"/>
+                        <add value="\t"/>
+                        <remove value="&quot;"/>
+                        <remove value="&apos;"/>
+                    </valid>
+                </sanitizer>
+            </param>
+        </repeat>
+    </xml>
+    <xml name="factor_list">
+        <repeat name="factor_list" title="Conditions" min="2" max="2" help="Specify conditions to compare from metadata file (for each comparison, the first specified condition is the reference). You have to load a metadata file prior to have access to condition list">
+            <param name="condition" label="Condition" type="select" optional="false" multiple="false">
+                <options from_dataset="metadata_path">
+                    <column name="condition" index="1"/>
+                    <column name="value" index="1"/>
+                    <filter type="unique_value" name="condition" column="condition"/>
+                    <filter type="remove_value" value="condition"/>
+                </options>
+                <sanitizer>
+                    <valid initial="default">
+                        <add preset="string.printable"/>
+                        <add value="\t"/>
+                        <remove value="&quot;"/>
+                        <remove value="&apos;"/>
+                    </valid>
+                </sanitizer>
+            </param>
+        </repeat>
+    </xml>
+    <xml name="palette">
+        <param name="palette" type="select" value="pastel" display="radio" label="Select palette colormap to apply to abundance plot." help="For more information see https://seaborn.pydata.org/tutorial/color_palettes.html">
+            <option value="pastel" selected="true">pastel</option>
+            <option value="deep">deep</option>
+            <option value="muted">muted</option>
+            <option value="bright">bright</option>
+            <option value="dark">dark</option>
+            <option value="colorblind">colorblind</option>
+        </param>
+    </xml>
     <token name="@INIT_PCA@"><![CDATA[
     #import json
     #import re
 
-    mkdir -p data/raw &&
-    mkdir -p data/processed &&
+    mkdir -p data &&
 
     #if $metadata_path:
-        ln -s '$metadata_path' data/raw/metadata.csv &&
+        ln -s '$metadata_path' data/metadata.csv &&
     #end if
     #if $abundance_file:
-        ln -s '$abundance_file' data/raw/abundance.csv &&
+        ln -s '$abundance_file' data/abundance.csv &&
     #end if
     #if $me_or_frac_contrib_file:
-        ln -s '$me_or_frac_contrib_file' data/raw/me_or_frac_contrib.csv &&
+        ln -s '$me_or_frac_contrib_file' data/me_or_frac_contrib.csv &&
     #end if
 
     ]]></token>
@@ -420,68 +600,102 @@
     ]]></token>
     <token name="@INIT_ABUNDANCE_PLOT@"><![CDATA[
 
-    mkdir -p data/raw &&
-    mkdir -p data/processed &&
+    mkdir -p data &&
 
     #if $metadata_path:
-        ln -s '$metadata_path' data/raw/metadata.csv &&
+        ln -s '$metadata_path' data/metadata.csv &&
     #end if
     #if $abundance_file:
-        ln -s '$abundance_file' data/raw/abundance.csv &&
+        ln -s '$abundance_file' data/abundance.csv &&
     #end if
     ]]></token>
     <token name="@INIT_ENRICHMENT_PLOT@"><![CDATA[
 
-    mkdir -p data/raw &&
-    mkdir -p data/processed &&
+    mkdir -p data &&
 
     #if $metadata_path:
-        ln -s '$metadata_path' data/raw/metadata.csv &&
+        ln -s '$metadata_path' data/metadata.csv &&
     #end if
     #if $me_or_frac_contrib_file:
-        ln -s '$me_or_frac_contrib_file' data/raw/me_or_frac_contrib.csv &&
+        ln -s '$me_or_frac_contrib_file' data/me_or_frac_contrib.csv &&
     #end if
     ]]></token>
     <token name="@INIT_ISOTOPOLOGUE_PLOT@"><![CDATA[
 
-    mkdir -p data/raw &&
-    mkdir -p data/processed &&
+    mkdir -p data &&
+
+    #if $metadata_path:
+        ln -s '$metadata_path' data/metadata.csv &&
+    #end if
+    #if $isotop_prop_file:
+        ln -s '$isotop_prop_file' data/isotop_prop.csv &&
+    #end if
+    ]]></token>
+    <token name="@INIT_BI_ANALYSIS@"><![CDATA[
+
+    mkdir -p data &&
 
     #if $metadata_path:
-        ln -s '$metadata_path' data/raw/metadata.csv &&
+        ln -s '$metadata_path' data/metadata.csv &&
     #end if
-    #if $isotop_prop_file:
-        ln -s '$isotop_prop_file' data/raw/isotop_prop.csv &&
+    #set conditions_MDV_comparison  = {}
+    #silent $conditions_MDV_comparison['isotopologue_proportions']='pearson'
+    #set timepoints_MDV_comparison  = {}
+    #silent $timepoints_MDV_comparison['isotopologue_proportions']='pearson'
+    #set conditions_metabolite_time_profiles  = {}
+    #silent $conditions_metabolite_time_profiles['abundances']='pearson'
+    #silent $conditions_metabolite_time_profiles['mean_enrichment']='pearson'
+
+    #set $impute_values  = {}
+    #if str( $data_input.data_input_selector ) == "abundance":
+        #if $data_input.abundance_file:
+            ln -s '$data_input.abundance_file' data/abundance.csv &&
+            #silent $impute_values['abundances']='min'
+        #end if
+    #elif str( $data_input.data_input_selector ) == "mean_enrichment":
+        #if $data_input.me_or_frac_contrib_file:
+            ln -s '$data_input.me_or_frac_contrib_file' data/me_or_frac_contrib.csv &&
+            #silent $impute_values['mean_enrichment']='min'
+        #end if
+    #elif str( $data_input.data_input_selector ) == "isotop_prop":
+        #if $data_input.isotop_prop_file:
+            ln -s '$data_input.isotop_prop_file' data/isotop_prop.csv &&
+            #silent $impute_values['isotopologue_proportions']='min'
+        #end if
+    #else
+        #if $data_input.isotop_abs_file:
+            ln -s '$data_input.isotop_abs_file' data/isotop_abs.csv &&
+            #silent $impute_values['isotopologues']='min'
+        #end if
     #end if
     ]]></token>
     <token name="@INIT_DIFF_ANALYSIS@"><![CDATA[
 
-    mkdir -p data/raw &&
-    mkdir -p data/processed &&
+    mkdir -p data &&
 
     #if $metadata_path:
-        ln -s '$metadata_path' data/raw/metadata.csv &&
+        ln -s '$metadata_path' data/metadata.csv &&
     #end if
 
     #set $impute_values  = {}
     #if str( $data_input.data_input_selector ) == "abundance":
         #if $data_input.abundance_file:
-            ln -s '$data_input.abundance_file' data/raw/abundance.csv &&
+            ln -s '$data_input.abundance_file' data/abundance.csv &&
             #silent $impute_values['abundances']='min'
         #end if
     #elif str( $data_input.data_input_selector ) == "mean_enrichment":
         #if $data_input.me_or_frac_contrib_file:
-            ln -s '$data_input.me_or_frac_contrib_file' data/raw/me_or_frac_contrib.csv &&
+            ln -s '$data_input.me_or_frac_contrib_file' data/me_or_frac_contrib.csv &&
             #silent $impute_values['mean_enrichment']='min'
         #end if
     #elif str( $data_input.data_input_selector ) == "isotop_prop":
         #if $data_input.isotop_prop_file:
-            ln -s '$data_input.isotop_prop_file' data/raw/isotop_prop.csv &&
+            ln -s '$data_input.isotop_prop_file' data/isotop_prop.csv &&
             #silent $impute_values['isotopologue_proportions']='min'
         #end if
     #else
         #if $data_input.isotop_abs_file:
-            ln -s '$data_input.isotop_abs_file' data/raw/isotop_abs.csv &&
+            ln -s '$data_input.isotop_abs_file' data/isotop_abs.csv &&
             #silent $impute_values['isotopologues']='min'
         #end if
     #end if
@@ -493,69 +707,66 @@
     #import csv
     #import subprocess
 
-    mkdir -p data/raw &&
-    mkdir -p data/processed &&
-    mkdir -p data/integration_files &&
+    mkdir -p data &&
 
     #if $path_kegg_metabolites:
-        ln -s '$path_kegg_metabolites' data/integration_files/pathways_kegg_metabolites.csv &&
+        ln -s '$path_kegg_metabolites' data/pathways_kegg_metabolites.csv &&
     #end if
     #if $path_kegg_transcripts:
-        ln -s '$path_kegg_transcripts' data/integration_files/pathways_kegg_transcripts.csv &&
+        ln -s '$path_kegg_transcripts' data/pathways_kegg_transcripts.csv &&
     #end if
 
     #if $metadata_path:
-        ln -s '$metadata_path' data/raw/metadata.csv &&
+        ln -s '$metadata_path' data/metadata.csv &&
     #end if
 
     #set $impute_values  = {}
     #if str( $data_input.data_input_selector ) == "abundance":
         #if $data_input.abundance_file:
-            ln -s '$data_input.abundance_file' data/raw/abundance.csv &&
+            ln -s '$data_input.abundance_file' data/abundance.csv &&
             #silent $impute_values['abundances']='min'
         #end if
     #else:
         #if $data_input.me_or_frac_contrib_file:
-            ln -s '$data_input.me_or_frac_contrib_file' data/raw/me_or_frac_contrib.csv &&
+            ln -s '$data_input.me_or_frac_contrib_file' data/me_or_frac_contrib.csv &&
             #silent $impute_values['mean_enrichment']='min'
         #end if
     #end if
 
     #for $i, $s in enumerate($deg_list)
         #set $cpt = str($i+1)
-        ln -s '${s.input}' data/integration_files/DEG_comparison'${cpt}'.csv &&
+        ln -s '${s.input}' data/DEG_comparison'${cpt}'.csv &&
     #end for
 
 
     ]]></token>
     <token name="@INIT_DIFF_MULTIGROUP_ANALYSIS@"><![CDATA[
 
-    mkdir -p data/raw &&
-    mkdir -p data/processed &&
+    mkdir -p data &&
 
     #if $metadata_path:
-        ln -s '$metadata_path' data/raw/metadata.csv &&
+        ln -s '$metadata_path' data/metadata.csv &&
     #end if
 
     #set $impute_values  = {}
     #if str( $data_input.data_input_selector ) == "abundance":
         #if $data_input.abundance_file:
-            ln -s '$data_input.abundance_file' data/raw/abundance.csv &&
+            ln -s '$data_input.abundance_file' data/abundance.csv &&
             #silent $impute_values['abundances']='min'
         #end if
     #elif str( $data_input.data_input_selector ) == "mean_enrichment":
         #if $data_input.me_or_frac_contrib_file:
-            ln -s '$data_input.me_or_frac_contrib_file' data/raw/me_or_frac_contrib.csv &&
+            ln -s '$data_input.me_or_frac_contrib_file' data/me_or_frac_contrib.csv &&
             #silent $impute_values['mean_enrichment']='min'
         #end if
     #elif str( $data_input.data_input_selector ) == "isotop_prop":
         #if $data_input.isotop_prop_file:
-            ln -s '$data_input.isotop_prop_file' data/raw/isotop_prop.csv &&
+            ln -s '$data_input.isotop_prop_file' data/isotop_prop.csv &&
             #silent $impute_values['isotopologue_proportions']='min'
         #end if
     #else
         #if $data_input.isotop_abs_file:
-            ln -s '$data_input.isotop_abs_file' data/raw/isotop_abs.csv &&
+            ln -s '$data_input.isotop_abs_file' data/isotop_abs.csv &&
             #silent $impute_values['isotopologues']='min'
         #end if
     #end if
@@ -619,6 +830,20 @@
         $conds.append(re.sub('"', '', str($co)))
     #end for
     ]]></token>
+    <token name="@INIT_PLOT_CONDITIONS@"><![CDATA[
+    #set $conditions = list()
+    #for $i, $s in enumerate($plot_factor_list)
+        #set $cpt = str($i+1)
+        $conditions.append(re.sub('"', '', str($s.condition)))
+    #end for
+    ]]></token>
+    <token name="@INIT_ABUNDANCE_PLOT_CONDITIONS@"><![CDATA[
+    #set $conditions = list()
+    #for $i, $s in enumerate($plot_abundance_factor_list)
+        #set $cpt = str($i+1)
+        $conditions.append(re.sub('"', '', str($s.condition)))
+    #end for
+    ]]></token>
     <token name="@INIT_TIMEPOINTS@"><![CDATA[
 
     #import re
@@ -641,7 +866,10 @@
     #for $cp in $compartments:
         #silent $metabolites[re.sub('"', '', str($cp))]=list()
         #for $met in $metabolites_list:
-            $metabolites[re.sub('"', '', str($cp))].append(re.sub('"', '\'', str($met)))
+            #set tmp_met=re.sub('\,', '%%',str($met))
+            #set tmp_met_bis=str(re.split('_m', str($tmp_met))[0])
+            #set tmp_met_ter=re.sub('%%', '\,',str($tmp_met_bis))
+            $metabolites[re.sub('"', '', str($cp))].append(re.sub('"', '\'', str(tmp_met_ter)))
         #end for
     #end for
     ]]></token>
@@ -681,10 +909,43 @@
     ]]></token>
     <token name="@INIT_CONDITIONS_TIMECOURSE@"><![CDATA[
     #import re
-    #set $conds = list()
-    #for $co in $conditions:
-        $conds.append(re.sub('"', '', str($co)))
+    #set $conditions = list()
+    #for $i, $s in enumerate($factor_list)
+        #set $cpt = str($i+1)
+        $conditions.append(re.sub('"', '', str($s.condition)))
+    #end for
+
+    ]]></token>
+    <token name="@INIT_BIVAR_COMPARISONS@"><![CDATA[
+    #import re
+    #set $conditions = list()
+    #for $i, $s in enumerate($plot_factor_list)
+        #set $cpt = str($i+1)
+        $conditions.append(re.sub('"', '', str($s.condition)))
     #end for
+    ]]></token>
+    <token name="@INIT_COMPARISONS_METABOLOGRAM@"><![CDATA[
+    #import re
+    #set $conditions = list()
+    #set $timepoints = list()
+    #set $comparisons = list()
+    #for $i, $s in enumerate($deg_list)
+        #set $cpt = str($i+1)
+        #set $comparisons_bis = list()
+        #for $j, $t in enumerate($s.factor_list)
+            #set $sub_comparisons = list()
+            #if str($t.condition) not in $conditions:
+                $conditions.append(re.sub('"', '', str($t.condition)))
+            #end if
+            $sub_comparisons.append(re.sub('"', '', str($t.condition)))
+            $sub_comparisons.append(re.sub('"', '', str($s.timepoint)))
+            $comparisons_bis.append($sub_comparisons)
+        #end for
+        $timepoints.append(re.sub('"', '', str($s.timepoint)))
+        $comparisons.append($comparisons_bis)
+    #end for
+
+
 
     ]]></token>
     <token name="@INIT_COMPARISONS@"><![CDATA[
@@ -753,6 +1014,75 @@
         #end if
     #end if
     ]]></token>
+    <token name="@INIT_DIFF_ANALYSIS_COMPARISONS@"><![CDATA[
+    #import re
+    #set $conditions = list()
+    #for $i, $s in enumerate($factor_list)
+        #set $cpt = str($i+1)
+        $conditions.append(re.sub('"', '', str($s.condition)))
+    #end for
+
+    #set $timepoints = list()
+    #for $tp in $timepoint:
+        $timepoints.append(re.sub('"', '', str($tp)))
+    #end for
+
+    #set $comparisons = list()
+    #if len($conditions) > 1:
+        #if len($timepoints) > 0:
+            #for $tp in $timepoint:
+                #set $ctrl_found=False
+                #set $ctrl=""
+                #set $comparisons_bis = list()
+
+                #for $co in $conditions:
+                    #set $sub_comparisons = list()
+                    #if str($co) in ["'Control'", "'control'", "'ctrl'"]:
+                        #set $ctrl_found=True
+                        #set $ctrl=str($co)
+                    #else:
+                        $sub_comparisons.append(re.sub('"', '', str($co)))
+                        $sub_comparisons.append(re.sub('"', '', str($tp)))
+
+                    #end if
+                    $comparisons_bis.append($sub_comparisons)
+                #end for
+
+                #if $ctrl_found:
+                    $sub_comparisons.append(str($ctrl))
+                    $sub_comparisons.append(str($tp))
+                    $comparisons_bis.append($sub_comparisons)
+                #end if
+
+                $comparisons.append($comparisons_bis)
+            #end for
+         #else
+            #for $co in $conditions:
+                $comparisons.append(re.sub('"', '', str($co)))
+            #end for
+        #end if
+
+    #else
+        #if len($conditions) > 0:
+            #if len($timepoints) > 1:
+                #for $co in $conditions:
+                    #set $comparisons_bis = list()
+                    #for $tp in $timepoint:
+                        #set $sub_comparisons = list()
+                        $sub_comparisons.append(re.sub('"', '', str($co)))
+                        $sub_comparisons.append(re.sub('"', '', str($tp)))
+                        $comparisons_bis.append($sub_comparisons)
+                    #end for
+                    $comparisons.append($comparisons_bis)
+                #end for
+            #end if
+        #else
+            #for $tp in $timepoint:
+                $comparisons.append(re.sub('"', '', str($tp)))
+            #end for
+        #end if
+    #end if
+    ]]></token>
     <token name="@INIT_TRANSCRIPTS@"><![CDATA[
     #import re
     #import os