changeset 5:1dd90aa7815d draft

planemo upload commit f9da57d32476742b887a77435eb77c70494ccf96
author lecorguille
date Fri, 07 Apr 2017 03:31:35 -0400
parents a1b528cba999
children 9876c52c51c6
files ProbMetab.xml macros.xml probmetab.r
diffstat 3 files changed, 120 insertions(+), 92 deletions(-) [+]
line wrap: on
line diff
--- a/ProbMetab.xml	Thu Apr 06 05:26:35 2017 -0400
+++ b/ProbMetab.xml	Fri Apr 07 03:31:35 2017 -0400
@@ -41,18 +41,25 @@
 
         #end if
 
-        #if $option_toexclude.option == "show":
-            toexclude $option_toexclude.toexclude
+        ## Extraction of CAMERA annotation [get.annot]
+        allowMiss $getannot.allowMiss
+        #if $getannot.option_toexclude.option == "show":
+            toexclude $getannot.option_toexclude.toexclude
         #end if
-        allowMiss $allowMiss
-        html $html
-        kegg_db $kegg_db
-        ppm_tol $ppm_tol
-        opt $opt
-        corths $corths
-        corprob $corprob
-        pcorprob $pcorprob
-        prob $prob
+
+        ## Database matching [create.reactionM]
+        kegg_db $db.kegg_db
+        ppm_tol $db.ppm_tol
+
+        ## Probability calculations matrix export [export.class.table]
+        prob $export.prob
+        html $export.html
+
+        ## Calculate the correlations and partial correlations and cross reference then with reactions [reac2cor]
+        opt $reac2cor.opt
+        corprob $reac2cor.corprob
+        pcorprob $reac2cor.pcorprob
+        corths $reac2cor.corths
 
         @COMMAND_LOG_EXIT@
 
@@ -80,6 +87,7 @@
                     </when>
                 </conditional>
                 -->
+                <expand macro="input_file_load"/>
             </when>
             <!-- Two acquisition modes-->
             <when value="two">
@@ -111,77 +119,88 @@
                         -->
                     </when>
                 </conditional>
+                <expand macro="input_file_load" polarity="Positive"/>
+                <expand macro="input_file_load" polarity="Negative"/>
             </when>
         </conditional>
 
-        <param name="allowMiss" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE" label="Retrieves peaks with no eviendence of adduct or isotope" help=" [allowMiss] (ionAnnot function) Logical, annotate also the peaks as single charged molecules [M+/-H]." />
-        <conditional name="option_toexclude">
-            <param name="option" type="select" label="Exclude samples" >
-                <option value="show">show</option>
-                <option value="hide" selected="true">hide</option>
+        <section name="getannot" title="Extraction of CAMERA annotation [get.annot]">
+            <param name="allowMiss" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE" label="Retrieves peaks with no eviendence of adduct or isotope" help=" [allowMiss] (ionAnnot function) Logical, annotate also the peaks as single charged molecules [M+/-H]." />
+            <conditional name="option_toexclude">
+                <param name="option" type="select" label="Exclude samples" >
+                    <option value="show">show</option>
+                    <option value="hide" selected="true">hide</option>
+                </param>
+                <when value="show">
+                    <param name="toexclude" type="text" value="blank,medium,QC" label="Samples to be excluded of peak counting to non-annotated peak selection." help="[toexclude]" />
+                </when>
+                <when value="hide" />
+            </conditional>
+        </section>
+
+        <section name="db" title="Database matching [create.reactionM]">
+            <param name="kegg_db" type="text" size="40" label="Search on KEGG database or multiple organisms "  help="Search on all KEGG organisms or multiple organisms (id1,id2,id3,...).By default,the value is KEGG which means searching on all KEGG organism. The list of KEGG IDs are available at http://rest.kegg.jp/list/organism" value="KEGG" >
+                <validator type="empty_field"/>
             </param>
-            <when value="show">
-                <param name="toexclude" type="text" value="blank,medium,QC" label="samples to be excluded of peak counting to non-annotated peak selection." help="" />
-            </when>
-            <when value="hide" />
-        </conditional>
-        <!--
-        <conditional name="useIso_options">
-            <param name="option" type="select" label="Calculates the relative isotopic abundance ratio (Carbon 13)" >
-                <option value="show">Yes</option>
-                <option value="hide" selected="true">No</option>
-            </param>
-            <when value="show">
-                <param name="var" type="select" label="var (incorporate.isotopes)" help="1 to use standard mean/sd estimators to carbon number prediction, 2 for median/mad estimators." >
-                    <option value="1">1</option>
-                    <option value="2" selected="true">2</option>
+            <param name="ppm_tol" type="integer" value="8" label="Parts per million mass tolerance allowed in the mass search" help="[ppm.tol]" />
+            <!--
+            <conditional name="useIso_options">
+                <param name="option" type="select" label="Calculates the relative isotopic abundance ratio (Carbon 13)" >
+                    <option value="show">Yes</option>
+                    <option value="hide" selected="true">No</option>
                 </param>
-            </when>
-        </conditional>
-        -->
-        <param name="html" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE" label="Logical, check if you want to generate a HTML ProbMetab report" help=" [html] (export.class.table function).This parameter uses the raw data to plot EICs and may be time consuming." />
+                <when value="show">
+                    <param name="var" type="select" label="var (incorporate.isotopes)" help="1 to use standard mean/sd estimators to carbon number prediction, 2 for median/mad estimators." >
+                        <option value="1">1</option>
+                        <option value="2" selected="true">2</option>
+                    </param>
+                </when>
+            </conditional>
+            -->
+        </section>
 
-        <param name="kegg_db" type="text" size="40" label="Search on KEGG database or multiple organisms "  help="Search on all KEGG organisms or multiple organisms (id1,id2,id3,...).By default,the value is KEGG which means searching on all KEGG organism. The list of KEGG IDs are available at http://rest.kegg.jp/list/organism" value="KEGG" >
-            <validator type="empty_field"/>
-        </param>
-        <param name="ppm_tol" type="integer" value="8" label="Parts per million mass tolerance allowed in the mass search" help="[ppm.tol] (create.reactionMfunction) " />
+        <section name="export" title="Probability calculations matrix export [export.class.table]">
+            <param name="prob" type="select" label=" Calculation of the probability to attribute a mass to a compound" help="[prob] Default is 'count'. See the tool help for more details." >
+                <option value="count" selected="true">Count</option>
+                <option value="mean">Mean</option>
+            </param>
 
-        <param name="opt" type="select" label="Correlation option" help="[opt] (reac2cor function) cor for correlation, and pcor for partial correlation." >
-            <option value="cor" selected="true">cor</option>
-            <option value="pcor">pcor</option>
-        </param>
+            <param name="html" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE" label="Logical, check if you want to generate a HTML ProbMetab report" help="[html] This parameter uses the raw data to plot EICs and may be time consuming." />
+        </section>
 
-        <param name="corprob" type="float" value="0.8" label="Probability that the correlation is considered significant" help="[corprob] (reac2cor function) " />
+        <section name="reac2cor" title="Calculate the correlations and partial correlations and cross reference then with reactions [reac2cor]">
+            <param name="opt" type="select" label="Correlation option" help="[opt] cor for correlation, and pcor for partial correlation." >
+                <option value="cor" selected="true">cor</option>
+                <option value="pcor">pcor</option>
+            </param>
 
-        <param name="pcorprob" type="float" value="0.8" label="Probability that the partial correlation is considered significant." help="[pcorprob](reac2cor function)" />
-        <param name="corths" type="float" value="0.75" label="Correlation intensity threshold" help="[corths] (reac2cor function)" />
+            <param name="corprob" type="float" value="0.8" label="Probability that the correlation is considered significant" help="[corprob]" />
+
+            <param name="pcorprob" type="float" value="0.8" label="Probability that the partial correlation is considered significant." help="[pcorprob]" />
+            <param name="corths" type="float" value="0.75" label="Correlation intensity threshold" help="[corths]" />
+        </section>
 
-        <param name="prob" type="select" label=" Calculation of the probability to attribute a mass to a compound" help="[prob] (export.class.table function). Default is 'count'. See the tool help for more details." >
-            <option value="count" selected="true">Count</option>
-            <option value="mean">Mean</option>
-        </param>
         <!--
-        <param name="organismId" type="text" size="40" value="NULL" label="organismIdorganismId" help="(create.pathway.node.attributes function) KEGG organism id (http://www.kegg.jp/kegg/catalog/org_list.html) to filter possible pathways for known pathways for that organism. Only works for KEGG database for now. Default is NULL (all KEGG organisms).
-" />
+        <section name="cytoscape" title="CytoScape options">
+            <param name="organismId" type="text" size="40" value="NULL" label="organismIdorganismId" help="(create.pathway.node.attributes function) KEGG organism id (http://www.kegg.jp/kegg/catalog/org_list.html) to filter possible pathways for known pathways for that organism. Only works for KEGG database for now. Default is NULL (all KEGG organisms).
+            " />
+        </section>
         -->
 
-        <expand macro="input_file_load"/>
-        <expand macro="input_file_load" polarity="Positive"/>
-        <expand macro="input_file_load" polarity="Negative"/>
     </inputs>
 
     <outputs>
         <!-- <data name="output_image" format="rdata" from_work_dir="probmetab.RData" label="Probmetab.RData" /> -->
         <data name="html_output" format="html" from_work_dir="AnalysisExample.html" label="Probmetab.Analysis_Report_html" >
-             <filter>(html)</filter>
+             <filter>(export['html'])</filter>
         </data>
         <data name="tsv_output" format="tabular" from_work_dir="Analysis_Report.tsv" label="Probmetab.CytoScape_output_Attribute_List.tsv" />
         <data name="eics" format="zip" from_work_dir="Analysis_Report.zip" label="Probmetab.Analysis_Report_EICs_plots.zip" >
-            <filter>(html)</filter>
+            <filter>(export['html'])</filter>
         </data>
         <data name="sif_output" format="tabular" from_work_dir="sif.tsv" label="Probmetab.CytoScape_output.sif" />
         <data name="variableMetadata" format="tabular" from_work_dir="variableMetadata.tsv" label="variableMetadata.tsv" >
-            <filter>(drop_new-file_path['mode'] == 'one')</filter>
+            <filter>(acquisition_options['mode'] == 'one')</filter>
         </data>
 
         <data name="CombineMolIon" format="tabular" from_work_dir="CombineMolIon.tsv" label="CombineMolIon.tsv" >
@@ -202,7 +221,7 @@
                 <param name="mode" value="one" />
                 <param name="image" value="faahOK.xset.group.retcor.group.fillPeaks.annotate.negative.Rdata" />
             </conditional>
-            <param name="html" value="FALSE" />
+            <expand macro="test_commun"/>
             <expand macro="test_file_load_zip"/>
             <assert_stdout>
                 <has_text text="Step 1... determine cutoff point" />
@@ -216,7 +235,7 @@
                 <param name="mode" value="one" />
                 <param name="image" value="faahOK-single.xset.merged.group.retcor.group.fillPeaks.annotate.negative.Rdata" />
             </conditional>
-            <param name="html" value="FALSE" />
+            <expand macro="test_commun"/>
             <expand macro="test_file_load_single"/>
             <assert_stdout>
                 <has_text text="Step 1... determine cutoff point" />
@@ -407,7 +426,9 @@
 Changelog/News
 --------------
 
-**Version 1.1.0 - 15/02/2017**
+**Version 1.1.0 - 06/04/2017**
+
+- IMPROVEMENT: add some sections within to separate the different parts of the process
 
 - IMPROVEMENT: Probmetab is now compatible with merged individual data from xcms.xcmsSet
 
--- a/macros.xml	Thu Apr 06 05:26:35 2017 -0400
+++ b/macros.xml	Fri Apr 07 03:31:35 2017 -0400
@@ -27,32 +27,30 @@
     <!-- raw file load for planemo test -->
     <token name="@COMMAND_FILE_LOAD_NEUTRAL@">
         #if $file_load_section_selected.file_load_conditional.file_load_select == "yes":
-            #if $file_load_section_selected.file_load_conditional.inputs.input == "zip_file":
-                zipfile$polarity '$file_load_section_selected.file_load_conditional.inputs.zip_file'
+            #if $file_load_section_selected.file_load_conditional.input[0].is_of_type("mzxml") or $file_load_section_selected.file_load_conditional.input[0].is_of_type("mzml") or $file_load_section_selected.file_load_conditional.input[0].is_of_type("mzdata") or $file_load_section_selected.file_load_conditional.input[0].is_of_type("netcdf"):
+                #set singlefile_galaxyPath = ','.join( [ str( $single_file ) for $single_file in $file_load_section_selected.file_load_conditional.input ] )
+                #set singlefile_sampleName = ','.join( [ str( $single_file.name ) for $single_file in $file_load_section_selected.file_load_conditional.input ] )
+                singlefile_galaxyPath$polarity '$singlefile_galaxyPath' singlefile_sampleName$polarity '$singlefile_sampleName'
             #else
-                #set singlefile_galaxyPath = ','.join( [ str( $single_file ) for $single_file in $file_load_section_selected.file_load_conditional.inputs.single_file ] )
-                #set singlefile_sampleName = ','.join( [ str( $single_file.name ) for $single_file in $file_load_section_selected.file_load_conditional.inputs.single_file ] )
-
-                singlefile_galaxyPath$polarity '$singlefile_galaxyPath'
-                singlefile_sampleName$polarity '$singlefile_sampleName'
+                zipfile$polarity '$file_load_section_selected.file_load_conditional.input'
             #end if
         #end if
     </token>
 
     <token name="@COMMAND_FILE_LOAD_ONE@">
-        #set file_load_section_selected = $file_load_section
+        #set file_load_section_selected = $acquisition_options.file_load_section
         #set polarity=""
         @COMMAND_FILE_LOAD_NEUTRAL@
     </token>
 
     <token name="@COMMAND_FILE_LOAD_POSITIVE@">
-        #set file_load_section_selected = $file_load_sectionPositive
+        #set file_load_section_selected = $acquisition_options.file_load_sectionPositive
         #set polarity="Positive"
         @COMMAND_FILE_LOAD_NEUTRAL@
     </token>
 
     <token name="@COMMAND_FILE_LOAD_NEGATIVE@">
-        #set file_load_section_selected = $file_load_sectionNegative
+        #set file_load_section_selected = $acquisition_options.file_load_sectionNegative
         #set polarity="Negative"
         @COMMAND_FILE_LOAD_NEUTRAL@
     </token>
@@ -67,31 +65,40 @@
                 <when value="no">
                 </when>
                 <when value="yes">
-                    <conditional name="inputs">
-                        <param name="input" type="select" label="Choose your inputs method" >
-                            <option value="zip_file" selected="true">Zip file from your history containing your chromatograms</option>
-                            <option value="single_file">A mzXML or netCDF file from your history</option>
-                        </param>
-                        <when value="zip_file">
-                            <param name="zip_file" type="data" format="no_unzip.zip,zip" label="Zip file" />
-                        </when>
-                        <when value="single_file">
-                            <param name="single_file" type="data" format="mzxml,netcdf" label="Single file"  multiple="true"/>
-                        </when>
-                    </conditional>
+                    <param name="input" type="data" format="mzxml,mzml,mzdata,netcdf,no_unzip.zip,zip" multiple="true" label="File(s) from your history containing your chromatograms" help="Single file mode for the format: mzxml, mzml, mzdata and netcdf. Zip file mode for the format: no_unzip.zip, zip. See the help section below." />
                 </when>
             </conditional>
         </section>
     </xml>
 
+    <xml name="test_commun">
+        <section name="getannot">
+            <param name="allowMiss" value="TRUE" />
+            <conditional name="option_toexclude">
+                <param name="option" value="hide" />
+            </conditional>
+        </section>
+        <section name="db">
+            <param name="kegg_db" value="KEGG" />
+            <param name="ppm_tol" value="8" />
+        </section>
+        <section name="export">
+            <param name="prob" value="count" />
+            <param name="html" value="FALSE" />
+        </section>
+        <section name="reac2cor">
+            <param name="opt" value="cor" />
+            <param name="corprob" value="0.8" />
+            <param name="pcorprob" value="0.8" />
+            <param name="corths" value="0.75" />
+        </section>
+    </xml>
+
     <xml name="test_file_load_zip">
         <section name="file_load_section">
             <conditional name="file_load_conditional">
                 <param name="file_load_select" value="yes" />
-                <conditional name="inputs">
-                    <param name="input" value="zip_file" />
-                    <param name="zip_file" value="faahKO_reduce.zip"  ftype="zip" />
-                </conditional>
+                <param name="input" value="faahKO_reduce.zip" ftype="zip" />
             </conditional>
         </section>
     </xml>
@@ -100,10 +107,7 @@
         <section name="file_load_section@POLARITY@">
             <conditional name="file_load_conditional">
                 <param name="file_load_select" value="yes" />
-                <conditional name="inputs">
-                    <param name="input" value="single_file" />
-                    <param name="single_file" value="wt15.CDF,ko16.CDF,ko15.CDF,wt16.CDF"  ftype="netcdf" />
-                </conditional>
+                <param name="input" value="wt15.CDF,ko16.CDF,ko15.CDF,wt16.CDF" ftype="netcdf" />
             </conditional>
         </section>
     </xml>
@@ -118,7 +122,7 @@
 
 .. class:: infomark
 
-**Galaxy integration** Misharl Monsoor misharl.monsoor@sb-roscoff.fr ABIMS TEAM, Station biologique de Roscoff.
+**Galaxy integration** Misharl Monsoor misharl.monsoor@sb-roscoff.fr (and Gildas Le Corguillé) from ABIMS TEAM, Station biologique de Roscoff.
 
  | Contact support@workflow4metabolomics.org for any questions or concerns about the Galaxy implementation of this tool.
 
--- a/probmetab.r	Thu Apr 06 05:26:35 2017 -0400
+++ b/probmetab.r	Fri Apr 07 03:31:35 2017 -0400
@@ -21,6 +21,9 @@
     base_dir <- dirname(substring(argv[grep("--file=", argv)], 8))
     source(paste(base_dir, fname, sep="/"))
 }
+
+options(bitmapType='cairo')
+
 cat("\n\n")