diff maxquant.xml @ 4:dcd39bcc7481 draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/maxquant commit da342a782ccc391b87fb4fead956b7b3cbd21258"
author galaxyp
date Sat, 11 Apr 2020 11:49:19 -0400
parents 175e062b6a17
children 7f432d87c82c
line wrap: on
line diff
--- a/maxquant.xml	Thu Aug 15 08:09:00 2019 -0400
+++ b/maxquant.xml	Sat Apr 11 11:49:19 2020 -0400
@@ -1,114 +1,219 @@
-<tool id="maxquant" name="MaxQuant" version="@VERSION@+galaxy1">
+<tool id="maxquant" name="MaxQuant" version="@VERSION@">
     <macros>
+        <xml name="output" token_format="tabular" token_label="default description" token_name="default">
+            <data format="@FORMAT@" label="@LABEL@ for ${on_string}" name="@NAME@">
+                <filter>'@NAME@' in output_opts['output']</filter>
+            </data>
+        </xml>
+        <xml name="output_from_wdir" token_ext="txt" token_format="tabular" token_label="default description" token_name="default">
+            <data format="@FORMAT@" from_work_dir="combined/txt/@NAME@.@EXT@" label="@LABEL@ for ${on_string}" name="@NAME@">
+                <filter>'@NAME@' in output_opts['output']</filter>
+            </data>
+        </xml>
         <import>macros.xml</import>
     </macros>
-    <requirements>
-        <requirement type="package" version="@VERSION@">maxquant</requirement>
-        <requirement type="package" version="3.7">python</requirement>
-    </requirements>
+    <expand macro="requirements"/>
     <command detect_errors="exit_code"><![CDATA[
     #import re
-
-    python3 '$__tool_directory__/mqwrapper.py'
+    maxquant -c mqpar.xml 2>/dev/null  ## MQ writes success of creation to stderr
+    #if 'config' in $output_opts.output:
+      &&
+      cp '$mq_conf' '$config'
+    #end if
+    #set infiles = [$name for $pg in $paramGroups for $name in $pg.files]
+    #set names = [re.sub('@SUBSTITUTION_RX@', '_', str($n.element_identifier)) for $n in $infiles]
+    #set names_with_ext = [($name if ($name).lower().endswith(str($input_opts.ftype)) else $name + str($input_opts.ftype)) for $name in $names]
+    #for $target, $link in zip($infiles, $names_with_ext)
+        &&
+        ln -s '$target' '$link'
+    #end for
+    &&
+    python3 '$__tool_directory__/create_mqpar.py'
+    #if $search_opts.template
+        --exp_design='$search_opts.template'
+    #end if
+    --version=@VERSION@ 
     --num_threads=\${GALAXY_SLOTS:-1}
     --substitution_rx='@SUBSTITUTION_RX@'
-    #if $input_opts.infile.select == "mzxml_files"
-        --mzxml_files='$input_opts.infile.mzxml_files'
-        #set names = ','.join([re.sub('@SUBSTITUTION_RX@', '_', str($name.element_identifier)) for $name in $input_opts.infile.mzxml_files])
-    #else
-        --raw_files='$input_opts.infile.raw_files'
-        #set names = ','.join([re.sub('@SUBSTITUTION_RX@', '_', str($name.element_identifier)) for $name in $input_opts.infile.raw_files])
-    #end if
-    --infile_names='$names'
-    --version='@VERSION@'
-    --fasta_files='$input_opts.fasta_files'
-    --identifier_parse_rule='$input_opts.identifier_parse_rule'
-    --description_parse_rule='$input_opts.description_parse_rule'
+    --yaml='$mq_conf'
+    mqpar.xml
 
-    --exp_design='$search_opts.template'
-    --missed_cleavages=$search_opts.missed_cleavages
-    --min_peptide_len=$search_opts.min_peptide_len
-    --max_peptide_mass=$search_opts.max_peptide_mass
-    --min_unique_pep=$search_opts.min_unique_pep
-    $search_opts.calc_peak_properties
-    $search_opts.match_between_runs
-    #if $search_opts.fixed_mods
-        --fixed_mods='$search_opts.fixed_mods'
-    #end if
-    #if $search_opts.var_mods
-        --var_mods='$search_opts.var_mods'
-    #end if
-    #if $search_opts.proteases
-        --proteases='$search_opts.proteases'
-    #end if
-    #if $search_opts.silac.light_mods
-        --light_mods='$search_opts.silac.light_mods'
-    #end if
-    #if $search_opts.silac.medium_mods
-        --medium_mods='$search_opts.silac.medium_mods'
-    #end if
-    #if $search_opts.silac.heavy_mods
-       --heavy_mods='$search_opts.silac.heavy_mods'
-    #end if
-    #if $search_opts.lfq.do_lfq == "--lfq_mode=1"
-        $search_opts.lfq.do_lfq.lfq_mode
-        --lfq_min_ratio_count=$search_opts.lfq.do_lfq.lfq_min_ratio_count
-        --lfq_min_edges_per_node=$search_opts.lfq.do_lfq.lfq_min_edges_per_node
-        --lfq_avg_edges_per_node=$search_opts.lfq.do_lfq.lfq_avg_edges_per_node
-        $search_opts.lfq.do_lfq.lfq_skip_norm
-        $search_opts.lfq.do_lfq.separate_lfq
-        $search_opts.lfq.do_lfq.lfq_stabilize_large_ratios
-        $search_opts.lfq.do_lfq.lfq_require_msms
-        #if $search_opts.lfq.do_lfq.do_ibaq == "--ibaq"
-            $search_opts.lfq.do_lfq.do_ibaq.ibaq
-            $search_opts.lfq.do_lfq.do_ibaq.ibaq_log_fit
-        #end if
-        $search_opts.lfq.do_lfq.advanced_site_intensities
-    #end if
-
-    $output_opts.write_mztab
-    --evidence='$evidence'
-    --msms='$msms'
-    --parameters='$parameters'
-    --peptides='$peptides'
-    --proteinGroups='$proteinGroups'
-    --allPeptides='$allPeptides'
-    --libraryMatch='$libraryMatch'
-    --matchedFeatures='$matchedFeatures'
-    --modificationSpecificPeptides='$modificationSpecificPeptides'
-    --ms3Scans='$ms3Scans'
-    --msmsScans='$msmsScans'
-    --mzRange='$mzRange'
-    --peptideSection='$peptideSection'
-    --summary='$summary'
-    --mzTab='$mzTab'
-    --mqpar_out='$mqpar_out'
-
-    #if 'log' in $output_opts.output
-        > '$log'
-    #end if
-    #if 'output_all' in $output_opts.output
-        && tar -zcf '$output_all' ./combined/txt
+    #if $output_opts.dry_run:
+      &&
+      mkdir -p combined/txt
+      &&
+      mv mqpar.xml combined/txt/mqpar.xml
+    #else:
+      && 
+      maxquant mqpar.xml
+      #if 'log' in $output_opts.output:
+          > '$log'
+      #end if
+      &&
+      mv mqpar.xml combined/txt/mqpar.xml
+      #if 'output_all' in $output_opts.output:
+          &&
+          tar -zcf '$output_all' ./combined/txt
+      #end if
+      
+      #if $qc.do_it:
+        &&
+        Rscript '$qr' '$qr_yaml'
+          #if 'log' in $output_opts.output:
+              >> '$log' 2>&1
+          #end if
+        &&
+        cp ./combined/txt/report_v0.92.6_combined.pdf '$ptxqc_report'
+      #end if
     #end if
     ]]></command>
+
+    <configfiles>
+        <configfile name="mq_conf">
+            #import re
+            fastaFiles: [${input_opts.fasta_files}]
+            parseRules:
+              identifierParseRule: '${input_opts.identifier_parse_rule}'
+              descriptionParseRule: '${input_opts.description_parse_rule}'
+            minUniquePeptides: ${search_opts.min_unique_pep}
+            minPepLen: ${search_opts.min_peptide_len}
+            maxPeptideMass: ${search_opts.max_peptide_mass}
+            calcPeakProperties: ${search_opts.calc_peak_properties}
+            #set writeMzTab = "mzTab" in $output_opts.output
+            writeMzTab: $writeMzTab
+            #if $lfq_opts.do_ibaq.ibaq == 'True':
+            ibaq: ${lfq_opts.do_ibaq.ibaq}
+            ibaqLogFit: ${lfq_opts.do_ibaq.ibaqLogFit}
+            #end if
+            separateLfq: ${lfq_opts.separateLfq}
+            lfqStabilizeLargeRatios: ${lfq_opts.lfqStabilizeLargeRatios}
+            lfqRequireMsms: ${lfq_opts.lfqRequireMsms}
+            advancedSiteIntensities: ${lfq_opts.advancedSiteIntensities}
+            matchBetweenRuns: ${search_opts.match_between_runs}
+            paramGroups:
+            #for $pg in $paramGroups:
+              #set names = [re.sub('@SUBSTITUTION_RX@', '_', str($n.element_identifier)) for $n in $pg.files]
+              #set names_with_ext = [($name if ($name).lower().endswith(str($input_opts.ftype)) else $name + str($input_opts.ftype)) for $name in $names]
+              - files: $names_with_ext
+                maxMissedCleavages: ${pg.maxMissedCleavages}
+                #if $pg.fixedModifications:
+                fixedModifications: [${pg.fixedModifications}]
+                #else:
+                fixedModifications: []
+                #end if
+                #if $pg.variableModifications:
+                variableModifications: [${pg.variableModifications}]
+                #else:
+                variableModifications: []
+                #end if
+                #if $pg.enzymes:
+                enzymes: [${pg.enzymes}]
+                #else:
+                enzymes: []
+                #end if
+                #if $pg.quant_method.select_quant_method == 'silac':
+                labelMods:
+                  #if $pg.quant_method.light_labels:
+                  - [${pg.quant_method.light_labels}]
+                  #else:
+                  - []
+                  #end if
+                  #if $pg.quant_method.medium_labels:
+                  - [${pg.quant_method.medium_labels}]
+                  #else:
+                  - []
+                  #end if
+                  #if $pg.quant_method.heavy_labels:
+                  - [${pg.quant_method.heavy_labels}]
+                  #else:
+                  - []
+                  #end if
+                #end if
+                #if $pg.quant_method.select_quant_method == 'lfq':
+                lfqMode: 1
+                lfqSkipNorm: ${pg.quant_method.lfqSkipNorm}
+                lfqMinEdgesPerNode: ${pg.quant_method.lfqMinEdgesPerNode}
+                lfqAvEdgesPerNode: ${pg.quant_method.lfqAvEdgesPerNode}
+                lfqMinRatioCount: ${pg.quant_method.lfqMinRatioCount}
+                #end if
+                #if $pg.quant_method.select_quant_method == 'reporter_ion_ms2':
+                lcmsRunType: 'Reporter ion MS2'
+                reporterMassTolerance: 0.003
+                reporterPif: 0
+                reporterFraction: 0
+                reporterBasePeakRatio: 0
+                isobaricLabels:
+                  #if $pg.quant_method.iso_labels.labeling == 'custom':
+                    #for $l in $pg.quant_method.iso_labels.iso_label:
+                      - ['$l.internallabel','$l.terminallabel',$l.cm2,$l.cm1,$l.cp1,$l.cp2,$l.tmtlike]
+                    #end for
+                  #end if
+                  #if $pg.quant_method.iso_labels.labeling == 'tmt2plex':
+                    - [TMT2plex-Lys126,TMT2plex-Nter126,0,0,0,0,True]
+                    - [TMT2plex-Lys127,TMT2plex-Nter127,0,0,0,0,True]
+                  #end if
+                  #if $pg.quant_method.iso_labels.labeling == 'tmt6plex':
+                    - [TMT6plex-Lys126,TMT6plex-Nter126,0,0,0,0,True]
+                    - [TMT6plex-Lys127,TMT6plex-Nter127,0,0,0,0,True]
+                    - [TMT6plex-Lys128,TMT6plex-Nter128,0,0,0,0,True]
+                    - [TMT6plex-Lys129,TMT6plex-Nter129,0,0,0,0,True]
+                    - [TMT6plex-Lys130,TMT6plex-Nter130,0,0,0,0,True]
+                    - [TMT6plex-Lys131,TMT6plex-Nter131,0,0,0,0,True]
+                  #end if
+                  #if $pg.quant_method.iso_labels.labeling == 'tmt8plex':
+                    - [TMT8plex-Lys126C,TMT8plex-Nter126C,0,0,0,0,True]
+                    - [TMT8plex-Lys127N,TMT8plex-Nter127N,0,0,0,0,True]
+                    - [TMT8plex-Lys127C,TMT8plex-Nter127C,0,0,0,0,True]
+                    - [TMT8plex-Lys128C,TMT8plex-Nter128C,0,0,0,0,True]
+                    - [TMT8plex-Lys129N,TMT8plex-Nter129N,0,0,0,0,True]
+                    - [TMT8plex-Lys129C,TMT8plex-Nter129C,0,0,0,0,True]
+                    - [TMT8plex-Lys130C,TMT8plex-Nter130C,0,0,0,0,True]
+                    - [TMT8plex-Lys131N,TMT8plex-Nter131N,0,0,0,0,True]
+                  #end if
+                  #if $pg.quant_method.iso_labels.labeling == 'tmt10plex':
+                    @TMT10PLEX@
+                  #end if
+                  #if $pg.quant_method.iso_labels.labeling == 'tmt11plex':
+                    @TMT10PLEX@
+                    - [TMT11plex-Lys131C,TMT11plex-Nter131C,0,0,0,0,True]
+                  #end if
+                  #if $pg.quant_method.iso_labels.labeling == 'itraq4plex':
+                    - [iTRAQ4plex-Lys114,iTRAQ4plex-Nter114,0,0,0,0,False]
+                    - [iTRAQ4plex-Lys115,iTRAQ4plex-Nter115,0,0,0,0,False]
+                    - [iTRAQ4plex-Lys116,iTRAQ4plex-Nter116,0,0,0,0,False]
+                    - [iTRAQ4plex-Lys117,iTRAQ4plex-Nter117,0,0,0,0,False]
+                  #end if
+                  #if $pg.quant_method.iso_labels.labeling == 'itraq8plex':
+                    - [iTRAQ4plex-Lys113,iTRAQ8plex-Nter113,0,0,0,0,False]
+                    - [iTRAQ4plex-Lys114,iTRAQ8plex-Nter114,0,0,0,0,False]
+                    - [iTRAQ4plex-Lys115,iTRAQ8plex-Nter115,0,0,0,0,False]
+                    - [iTRAQ4plex-Lys116,iTRAQ8plex-Nter116,0,0,0,0,False]
+                    - [iTRAQ4plex-Lys117,iTRAQ8plex-Nter117,0,0,0,0,False]
+                    - [iTRAQ4plex-Lys118,iTRAQ8plex-Nter118,0,0,0,0,False]
+                    - [iTRAQ4plex-Lys119,iTRAQ8plex-Nter119,0,0,0,0,False]
+                    - [iTRAQ4plex-Lys121,iTRAQ8plex-Nter121,0,0,0,0,False]
+                  #end if
+                  #if $pg.quant_method.iso_labels.labeling == 'iodotmt6plex':
+                    - [iodoTMT6plex-Cys126,'',0,0,0,0,True]
+                    - [iodoTMT6plex-Cys127,'',0,0,0,0,True]
+                    - [iodoTMT6plex-Cys128,'',0,0,0,0,True]
+                    - [iodoTMT6plex-Cys129,'',0,0,0,0,True]
+                    - [iodoTMT6plex-Cys130,'',0,0,0,0,True]
+                    - [iodoTMT6plex-Cys131,'',0,0,0,0,True]
+                  #end if
+                #end if  
+            #end for
+        </configfile>
+        <expand macro="ptxqc"/>
+    </configfiles>
+
     <inputs>
         <section name="input_opts" title="Input Options" expanded="True">
-            <conditional name="infile">
-                <param name="select" type="select" label="choose the type of your input files">
-                    <option value="raw_files">Thermo.raw</option>
-                    <option value="mzxml_files">mzXML</option>
-                </param>
-                <when value="raw_files"> 
-                    <param multiple="true" name="raw_files" type="data"
-                           format="thermo.raw" label="RAW Files"
-                           help="Specify one or more Thermo RAW files" />
-                </when>
-                <when value="mzxml_files">
-                    <param multiple="true" name="mzxml_files" type="data"
-                           format="mzxml" label="mzXML Files"
-                           help="Specify one or more mzXML files" />
-                </when>
-            </conditional>
+            <param name="ftype" type="select" label="choose the type of your input files">
+                <option value=".thermo.raw">thermo.raw</option>
+                <option value=".mzxml">mzxml</option>
+                <option value=".mzml">mzml</option>
+            </param>
             <param format="fasta" multiple="true" name="fasta_files"
                    type="data" label="FASTA files"
                    help="Specify one or more FASTA databases." />
@@ -135,168 +240,299 @@
             <param format="tabular" name="template" type="data" optional="true"
                    label="Specify an experimental design template (if needed). For detailed
                           instructions see the help text." />
-            <param type="integer" name="missed_cleavages"
-	           label="missed cleavages" value="1"/>
             <param type="integer" name="min_peptide_len"
 	           label="minimum peptide length" value="7"/>
             <param type="integer" name="max_peptide_mass"
 	           label="maximum peptide mass" value="4600"/>
             <param type="integer" name="min_unique_pep"
-	           label="minimum unique peptides" value="1" />
+	           label="minimum unique peptides" value="0" />
             <param name="calc_peak_properties" type="boolean" checked="false"
 	           label="Calculate peak properties?"
-	           truevalue="--calc_peak_properties" falsevalue="" />
+	           truevalue="True" falsevalue="False" />
             <param name="match_between_runs" type="boolean" checked="false"
 	           label="Match between runs?"
-	           truevalue="--match_between_runs" falsevalue="" />
-            <param name="fixed_mods" type="select" label="fixed modifications"
+	           truevalue="True" falsevalue="False" />
+        </section>
+        
+        <repeat name="paramGroups" title="Parameter Group" min="1" default="1">
+            <param type="data" format="thermo.raw,mzXML,mzML" name="files" label="Infiles" multiple="true"
+                   help="Only select infiles matching the filetype specified in the input options."/>
+            <param type="integer" name="maxMissedCleavages"
+	           label="missed cleavages" value="2"/>
+            <param name="fixedModifications" type="select" label="fixed modifications"
 	           multiple="true" help="select zero or more fixed modifications">
 	        <expand macro="modification"/>
+                <expand macro="default_mod_option" value="Carbamidomethyl (C)"/>
+            </param>
+            <param name="variableModifications" type="select" label="variable modifications"
+	           multiple="true" help="select zero or more variable modifications">
+                <expand macro="default_mod_option" value="Oxidation (M)"/>
+                <expand macro="default_mod_option" value="Acetyl (Protein N-term)"/>
+	        <expand macro="modification"/>
             </param>
-            <param name="var_mods" type="select" label="variable modifications"
-	           multiple="true" help="select zero or more variable modifications">
-	        <expand macro="modification"/>
-            </param>
-            <param name="proteases" type="select" label="proteases"
+            <param name="enzymes" type="select" label="proteases"
 	           multiple="true" help="select zero or more proteases">
+                <expand macro="default_mod_option" value="Trypsin/P"/>
 	        <expand macro="proteases"/>
             </param>
-            <section title="label based quantitation" name="silac" expanded="false">
-	        <param name="light_mods" type="select" label="light labels"
-		       multiple="true" help="select zero or more light modifications">
-	            <expand macro="label"/>
-	        </param>
-	        <param name="medium_mods" type="select" label="medium labels"
-		       multiple="true" help="select zero or more medium modifications">
-	            <expand macro="label"/>
-	        </param>
-	        <param name="heavy_mods" type="select" label="heavy labels"
-		       multiple="true" help="select zero or more heavy modifications">
-	            <expand macro="label"/>
-	        </param>
-            </section>
-            <section title="label free quantification" name="lfq" expanded="false">
-	        <conditional name="do_lfq">
-                    <param name="lfq_mode" type="select" label="Perform LFQ?">
-                        <option value="">No</option>
-                        <option value="--lfq_mode=1">Yes</option>
-		    </param>
-                    <when value="--lfq_mode=1">
-		        <param type="integer" name="lfq_min_ratio_count"
-		               label="LFQ minimum ratio count" value="2"/>
-		        <param type="integer" name="lfq_min_edges_per_node"
-			       label="LFQ minimum number of neighbours" value="3"/>
-		        <param type="integer" name="lfq_avg_edges_per_node"
-			       label="LFQ average number of neighbours" value="6"/>
-		        <param name="lfq_skip_norm" type="boolean" checked="false"
-			       label="Skip normalization?"
-			       truevalue="--lfq_skip_norm" falsevalue="" />
-		        <param name="separate_lfq" type="boolean" checked="false"
-			       label="Separate LFQ in parameter Groups?"
-			       truevalue="--separate_lfq" falsevalue="" />
-		        <param name="lfq_stabilize_large_ratios" type="boolean" checked="true"
-			       label="Stabilize large LFQ ratios?"
-			       truevalue="--lfq_stabilize_large_ratios" falsevalue="" />
-		        <param name="lfq_require_msms" type="boolean" checked="true"
-			       label="Require MS/MS for LFQ comparisons?"
-			       truevalue="--lfq_require_msms" falsevalue="" />
-		        <conditional name="do_ibaq">
-                            <param name="ibaq" type="select" label="iBAQ?">
-                                <option value="">No</option>
-                                <option value="--ibaq">Yes</option>
-		            </param>
-                            <when value="--ibaq">
-                                <param name="ibaq_log_fit" type="boolean" checked="true"
-                                       label="Logarithmic fit?"
-                                       truevalue="--ibaq_log_fit" falsevalue="" />
-                            </when>
-                            <when value="">
-                            </when>
-		        </conditional>
-		        <param name="advanced_site_intensities" type="boolean" checked="true"
-			       label="Advanced site intensities?"
-			       truevalue="--advanced_site_intensities" falsevalue="" />
-		    </when>
-		    <when value="">
-	            </when>
-	        </conditional>    
-            </section>
+            <conditional name="quant_method">
+                <param name="select_quant_method" type="select" label="Quantitation Methods"
+                       help="Select a method if needed.">
+                    <option value="">None</option>
+                    <option value="lfq">label free quantification</option>
+                    <option value="silac">label based quantification (SILAC)</option>
+                    <option value="reporter_ion_ms2">reporter ion MS2</option>
+                </param>
+                <when value=""/>
+                <when value="silac">
+	            <param name="light_labels" type="select" label="light labels"
+		           multiple="true" help="select zero or more light modifications">
+	                <expand macro="label"/>
+	            </param>
+	            <param name="medium_labels" type="select" label="medium labels"
+		           multiple="true" help="select zero or more medium modifications">
+	                <expand macro="label"/>
+	            </param>
+	            <param name="heavy_labels" type="select" label="heavy labels"
+		           multiple="true" help="select zero or more heavy modifications">
+	                <expand macro="label"/>
+	            </param>
+                </when>
+                <when value="lfq">
+		    <param type="integer" name="lfqMinRatioCount"
+		           label="LFQ minimum ratio count" value="2"/>
+		    <param type="integer" name="lfqMinEdgesPerNode"
+			   label="LFQ minimum number of neighbours" value="3"/>
+		    <param type="integer" name="lfqAvEdgesPerNode"
+			   label="LFQ average number of neighbours" value="6"/>
+		    <param type="boolean" name="lfqSkipNorm" checked="true"
+			   label="Skip normalization?"
+			   truevalue="True" falsevalue="False" />
+                </when>
+                <when value="reporter_ion_ms2">
+                    <conditional name="iso_labels">
+                        <param name="labeling" type="select" label="isobaric labeling"
+                               help="Select one of the standard labelings (correction factors are zero) or create a custom labeling.">
+                            <option value="custom">custom</option>
+                            <option value="tmt2plex">TMT2plex</option>
+                            <option value="tmt6plex">TMT6plex</option>
+                            <option value="tmt8plex">TMT8plex</option>
+                            <option value="tmt10plex">TMT10plex</option>
+                            <option value="tmt11plex">TMT11plex</option>
+                            <option value="itraq4plex">iTRAQ4plex</option>
+                            <option value="itraq8plex">iTRAQ8plex</option>
+                            <option value="iodotmt6plex">iodoTMT6plex</option>
+                        </param>
+                        <when value="tmt2plex"></when>
+                        <when value="tmt6plex"></when>
+                        <when value="tmt8plex"></when>
+                        <when value="tmt10plex"></when>
+                        <when value="tmt11plex"></when>
+                        <when value="itraq4plex"></when>
+                        <when value="itraq8plex"></when>
+                        <when value="iodotmt6plex"></when>
+                        <when value="custom">
+                            <repeat name="iso_label" title="Isobaric Label" min="1" default="1">
+                                <param name="internallabel" type="select" label="internal label">
+	                            <expand macro="iso_labels"/>
+	                        </param>
+                                <param name="terminallabel" type="select" label="terminal label">
+                                    <option value="">None</option>
+	                            <expand macro="iso_labels"/>
+	                        </param>
+                                <param name="cm2" type="float" label="correction factor -2%" value="0.0"/>
+                                <param name="cm1" type="float" label="correction factor -1%" value="0.0"/>
+                                <param name="cp1" type="float" label="correction factor +1%" value="0.0"/>
+                                <param name="cp2" type="float" label="correction factor +2%" value="0.0"/>
+		                <param type="boolean" name="tmtlike" checked="false"
+			               label="TMT-like"
+			               truevalue="True" falsevalue="False" />
+                            </repeat>
+                        </when>
+                    </conditional>
+                </when>
+            </conditional>
+        </repeat>
+
+        <section title="LFQ Options" name="lfq_opts" expanded="false">
+	    <param name="separateLfq" type="boolean" checked="false"
+		   label="Separate LFQ in parameter Groups?"
+		   truevalue="True" falsevalue="False" />
+	    <param name="lfqStabilizeLargeRatios" type="boolean" checked="true"
+		   label="Stabilize large LFQ ratios?"
+		   truevalue="True" falsevalue="False" />
+	    <param name="lfqRequireMsms" type="boolean" checked="true"
+		   label="Require MS/MS for LFQ comparisons?"
+		   truevalue="True" falsevalue="False" />
+	    <conditional name="do_ibaq">
+                <param name="ibaq" type="select" label="iBAQ?">
+                    <option value="False">No</option>
+                    <option value="True">Yes</option>
+		</param>
+                <when value="True">
+                    <param name="ibaqLogFit" type="boolean" checked="true"
+                           label="Logarithmic fit?"
+                           truevalue="True" falsevalue="False" />
+                </when>
+                <when value="False">
+                </when>
+	    </conditional>
+	    <param name="advancedSiteIntensities" type="boolean" checked="true"
+		   label="Advanced site intensities?"
+		   truevalue="True" falsevalue="False" />
         </section>
 
+        <expand macro="ptxqc-opts"/>
         <section title="Output Options" name="output_opts" expanded="true">
-            <param name="write_mztab" type="boolean" checked="false"
-	           label="Write mztab file?"
-	           truevalue="--write_mztab" falsevalue="" />
+            <param name="dry_run" type="boolean" checked="false"
+	           label="Only create config files? (i.e. for testing)"
+	           truevalue="True" falsevalue="" />            
             <param type="select" name="output" label="Select the desired outputs."
                    multiple="true" optional="false">
-                <expand macro="output_option" name="proteinGroups" label="Protein Groups"/>
-                <expand macro="output_option" name="mqpar_out" label="mqpar.xml"/>
-                <expand macro="output_option" name="peptides" label="Peptides"/>
-                <expand macro="output_option" name="evidence" label="Evidence"/>
-                <expand macro="output_option" name="parameters" label="Tabular Paramters"/>
-                <expand macro="output_option" name="msms" label="MSMS"/>
-                <expand macro="output_option" name="mzTab" label="mzTab"/>
-                <expand macro="output_option" name="allPeptides" label="all peptides"/>
-                <expand macro="output_option" name="libraryMatch" label="library match"/>
-                <expand macro="output_option" name="matchedFeatures" label="matched features"/>
-                <expand macro="output_option" name="modificationSpecificPeptides" label="modification specific peptides"/>
-                <expand macro="output_option" name="ms3Scans" label="ms3 scans"/>
-                <expand macro="output_option" name="msmsScans" label="msms scans"/>
-                <expand macro="output_option" name="mzRange" label="mz range"/>
-                <expand macro="output_option" name="peptideSection" label="peptide section"/>
-                <expand macro="output_option" name="summary" label="summary"/>
-                <expand macro="output_option" name="output_all" label="complete 'combined/txt/' directory (compressed)"/>
-                <expand macro="output_option" name="log" label="MaxQuant log"/>
+                <option value="proteinGroups">Protein Groups</option>
+                <option value="mqpar">mqpar.xml</option>
+                <option value="peptides">Peptides</option>
+                <option value="evidence">Evidence</option>
+                <option value="parameters">Tabular Paramters</option>
+                <option value="msms">MSMS</option>
+                <option value="mzTab">mzTab</option>
+                <option value="allPeptides">all peptides</option>
+                <option value="libraryMatch">library match</option>
+                <option value="matchedFeatures">matched features</option>
+                <option value="modificationSpecificPeptides">modification specific peptides</option>
+                <option value="ms3Scans">ms3 scans</option>
+                <option value="msmsScans">msms scans</option>
+                <option value="mzRange">mz range</option>
+                <option value="peptideSection">peptide section</option>
+                <option value="summary">summary</option>
+                <option value="output_all">complete 'combined/txt/' directory (compressed)</option>
+                <option value="log">MaxQuant and PTXQC log</option>
+                <option value="config">yaml config file</option>
             </param>
         </section>
     </inputs>
-
-    <outputs>
-        <expand macro="output" name="proteinGroups" label="MaxQuant Protein Groups"/>
-        <expand macro="output" name="mqpar_out" label="mqpar.xml" format="xml"/>
-        <expand macro="output" name="peptides" label="MaxQuant Peptides"/>
-        <expand macro="output" name="evidence" label="MaxQuant Evidence"/>
-        <expand macro="output" name="parameters" label="MaxQuant Tabular Parameters"/>
-        <expand macro="output" name="msms" label="MaxQuant MSMS"/>
-        <expand macro="output" name="mzTab" label="mzTab"/>
-        <expand macro="output" name="allPeptides" label="all peptides"/>
-        <expand macro="output" name="libraryMatch" label="library match"/>
-        <expand macro="output" name="matchedFeatures" label="matched features"/>
-        <expand macro="output" name="modificationSpecificPeptides" label="modification specific peptides"/>
-        <expand macro="output" name="ms3Scans" label="ms3 scans"/>
-        <expand macro="output" name="msmsScans" label="msms Scans"/>
-        <expand macro="output" name="mzRange" label="mz range"/>
-        <expand macro="output" name="peptideSection" label="peptide section"/>
-        <expand macro="output" name="summary" label="MaxQuant summary"/>
-        <expand macro="output" format="tar" name="output_all" label="'combined/txt/' directory"/>
-        <expand macro="output" name="log" format="txt" label="log"/>
-    </outputs>
+    
+    <expand macro="outputs"/>
 
     <tests>
-        <test>
-            <param name="select" value="mzxml_files" />
-            <param name="mzxml_files" value="BSA_min_23.mzXML" />
+        <!-- functional test with small mzXML file, no quantitation methods -->
+        <test expect_num_outputs="15">
+            <param name="ftype" value=".mzxml" />
+            <param name="fasta_files" value="bsa.fasta" />
+            <param name="identifier_parse_rule" value="&gt;([^\s]*)" />
+            <param name="description_parse_rule" value="&gt;(.*)" />
+            <repeat name="paramGroups">
+                <param name="files" value="BSA_min_23.mzXML"/>
+                <param name="maxMissedCleavages" value="1"/>
+                <param name="fixedModifications" value="Carbamidomethyl (C)" />
+                <param name="variableModifications" value="Oxidation (M)" />
+                <param name="enzymes" value="Trypsin/P" />
+            </repeat>
+            <param name="output" value="evidence,msms,allPeptides,msmsScans,mzTab,mzRange,parameters,peptides,peptideSection,proteinGroups,summary,modificationSpecificPeptides,output_all,config,mqpar" />
+            <output name="mqpar" file="01/mqpar.xml" lines_diff="6"/>
+            <output name="evidence" file="01/combined/txt/evidence.txt" />
+            <output name="msms" file="01/combined/txt/msms.txt" />
+            <output name="mzTab" file="01/combined/txt/mzTab.mzTab" lines_diff="4"/>
+            <output name="allPeptides" file="01/combined/txt/allPeptides.txt" lines_diff="4"/>
+            <output name="msmsScans" file="01/combined/txt/msmsScans.txt" lines_diff="8"/>
+            <output name="mzRange" file="01/combined/txt/mzRange.txt" />
+            <output name="parameters" file="01/combined/txt/parameters.txt" lines_diff="10"/>
+            <output name="peptides" file="01/combined/txt/peptides.txt" />
+            <output name="peptideSection" file="01/combined/txt/peptideSection.txt" />
+            <output name="proteinGroups" file="01/combined/txt/proteinGroups.txt" />
+            <output name="summary" file="01/combined/txt/summary.txt" />
+            <output name="modificationSpecificPeptides" file="01/combined/txt/modificationSpecificPeptides.txt" />
+            <output name="config" file="01/config.yml" lines_diff="2"/>
+        </test>
+        <!-- reporter ion ms2 + multiple param groups, testing yaml conf file and mqpar.xml only -->
+        <test expect_num_outputs="3">
+            <param name="ftype" value=".mzxml" />
             <param name="fasta_files" value="bsa.fasta" />
             <param name="identifier_parse_rule" value="&gt;([^\s]*)" />
             <param name="description_parse_rule" value="&gt;(.*)" />
-            <param name="min_unique_pep" value="0" />
-            <param name="fixed_mods" value="Carbamidomethyl (C)" />
-            <param name="var_mods" value="Oxidation (M)" />
-            <param name="proteases" value="Trypsin/P" />
-            <param name="write_mztab" value="true" />
-            <param name="output" value="evidence,msms,allPeptides,msmsScans,mzTab,mzRange,parameters,peptides,peptideSection,proteinGroups,summary,modificationSpecificPeptides" />
-            <output name="evidence" file="single/combined/txt/evidence.txt" />
-            <output name="msms" file="single/combined/txt/msms.txt" />
-            <output name="mzTab" file="single/combined/txt/mzTab.mzTab" lines_diff="4"/>
-            <output name="allPeptides" file="single/combined/txt/allPeptides.txt" />
-            <output name="msmsScans" file="single/combined/txt/msmsScans.txt" />
-            <output name="mzRange" file="single/combined/txt/mzRange.txt" />
-            <output name="parameters" file="single/combined/txt/parameters.txt" lines_diff="10"/>
-            <output name="peptides" file="single/combined/txt/peptides.txt" />
-            <output name="peptideSection" file="single/combined/txt/peptideSection.txt" />
-            <output name="proteinGroups" file="single/combined/txt/proteinGroups.txt" />
-            <output name="summary" file="single/combined/txt/summary.txt" />
-            <output name="modificationSpecificPeptides" file="single/combined/txt/modificationSpecificPeptides.txt" />
+            <repeat name="paramGroups">
+                <param name="files" value="BSA_min_23.mzXML"/>
+                <param name="variableModifications" value="Oxidation (M)" />
+                <param name="fixedModifications" value="" />
+                <conditional name="quant_method">
+                    <param name="select_quant_method" value="reporter_ion_ms2" />
+                    <conditional name="iso_labels">
+                        <param name="labeling" value="custom" />
+                        <repeat name="iso_label">
+                            <param name="internallabel" value="TMT2plex-Lys126" />
+                            <param name="terminallabel" value="TMT2plex-Nter126" />
+                            <param name="tmtlike" value="True" />
+                            <param name="cp1" value="6.7" />
+                            <param name="cp2" value="3" />
+                        </repeat>
+                        <repeat name="iso_label">
+                            <param name="internallabel" value="TMT2plex-Lys127" />
+                            <param name="terminallabel" value="TMT2plex-Nter127" />
+                            <param name="tmtlike" value="True" />
+                        </repeat>
+                    </conditional>
+                </conditional>
+            </repeat>
+            <repeat name="paramGroups">
+                <param name="files" value="BSA_min_22"/>
+                <param name="variableModifications" value="" />
+                <param name="fixedModifications" value="" />
+                <param name="enzymes" value="" />
+                <conditional name="quant_method">
+                    <param name="select_quant_method" value="reporter_ion_ms2" />
+                    <conditional name="iso_labels">
+                        <param name="labeling" value="itraq4plex" />
+                    </conditional>
+                </conditional>
+            </repeat>
+            <param name="dry_run" value="True" />
+            <param name="output" value="config,mqpar,mzTab" />
+            <output name="config" file="02/config.yml" lines_diff="2" />
+            <!-- high difference due to unconsistant xml formatting in MQ -->
+            <output name="mqpar" file="02/mqpar.xml" lines_diff="24" />
+        </test>
+        <!-- lfq, testing yaml conf file and mqpar.xml only -->
+        <test expect_num_outputs="2">
+            <param name="ftype" value=".mzxml" />
+            <param name="fasta_files" value="bsa.fasta" />
+            <param name="min_unique_pep" value="1" />
+            <param name="ibaq" value="True" />
+            <param name="ibaqLogFit" value="False" />
+            <repeat name="paramGroups">
+                <param name="files" value="BSA_min_22"/>
+                <param name="maxMissedCleavages" value="1"/>
+                <param name="variableModifications" value="Oxidation (M)" />
+                <conditional name="quant_method">
+                    <param name="select_quant_method" value="lfq" />
+                </conditional>
+            </repeat>
+            <param name="dry_run" value="True" />
+            <param name="output" value="config,mqpar" />
+            <output name="config" file="03/config.yml" lines_diff="2" />
+            <output name="mqpar" file="03/mqpar.xml" lines_diff="10" />
+        </test>
+        <!-- silac + fractions with experimental design template, testing yaml conf file and mqpar.xml only -->
+        <test expect_num_outputs="2">
+            <param name="ftype" value=".mzxml" />
+            <param name="fasta_files" value="bsa.fasta" />
+            <param name="identifier_parse_rule" value="&gt;([^\s]*)" />
+            <param name="description_parse_rule" value="&gt;(.*)" />
+            <param name="template" value="04/exp_design" />
+            <repeat name="paramGroups">
+                <param name="files" value="BSA_min_23.mzXML,BSA_min_22"/>
+                <param name="fixedModifications" value="Carbamidomethyl (C)" />
+                <param name="variableModifications" value="Oxidation (M)" />
+                <param name="enzymes" value="Trypsin/P" />
+                <conditional name="quant_method">
+                    <param name="select_quant_method" value="silac" />
+                    <param name="light_labels" value="Arg6,Lys4" />
+                    <param name="heavy_labels" value="Arg10,DimethLys8" />
+                </conditional>
+            </repeat>
+            <param name="dry_run" value="True" />
+            <param name="output" value="config,mqpar" />
+            <output name="config" file="04/config.yml" lines_diff="2" />
+            <output name="mqpar" file="04/mqpar.xml" lines_diff="12" />
         </test>
     </tests>
 
@@ -307,8 +543,9 @@
 
 **Input files**
 
-- Thermo raw file or mzXML file
-    - The datatype has to be 'thermo.raw' or 'mzXML'. Make sure to specify the correct datatype either during upload to Galaxy or afterwards (edit attributes --> datatypes)
+- Thermo raw files or mzXML files (in parameter group section):
+    - The datatype of all files has to be either 'thermo.raw' or 'mzXML'. Make sure to specify the correct datatype either during upload to Galaxy or afterwards (edit attributes --> datatypes)
+- Fasta files: specify parse rules accordingly, default rules are compatible with uniprot
 - Optional files:
     - Tabular file with experimental design template:
         - Currently four columns are needed: Name, Fraction, Experiment and PTM. The headers must have this exact naming. Name and Experiment are abitrary strings, Fraction is an integer or emtpy, PTM is either 'True', 'False' or empty. Consider you uploaded files named File1.mzxml, ..., File5.mzxml. This is a (syntactically) correct experimental design template:
@@ -340,37 +577,11 @@
     - label based: 
         - for two channels: choose options from light and heavy sections, for three channels choose options from light, medium and heavy sections
     - label-free
+    - reporter ion ms2: either use the pre-defined labelings with correction factors set to 0 or specify a custom labeling
 
 **Output files**
 
-Different output file options are available, most of them are part of the MaxQuant txt directory. 
+Different output file options are available, most of them are part of the MaxQuant txt directory. If ptxqc report ist selected, a quality control report will be created.
     ]]></help>
-    <citations>
-        <citation type="bibtex">
-        @article{cox2008maxquant,
-        title={MaxQuant enables high peptide identification rates, individualized
-        ppb-range mass accuracies and proteome-wide protein quantification},
-        author={Cox, J{\"u}rgen and Mann, Matthias},
-        journal={Nature biotechnology},
-        volume={26},
-        number={12},
-        pages={1367},
-        year={2008},
-        publisher={Nature Publishing Group}
-        }
-        </citation>
-        <citation type="bibtex">
-        @article{tyanova2016maxquant,
-        title={The MaxQuant computational platform for mass
-        spectrometry-based shotgun proteomics},
-        author={Tyanova, Stefka and Temu, Tikira and Cox, J{\"u}rgen},
-        journal={Nature protocols},
-        volume={11},
-        number={12},
-        pages={2301},
-        year={2016},
-        publisher={Nature Publishing Group}
-        }
-        </citation>
-    </citations>
+    <expand macro="citations"/>
 </tool>