Repository 'maxquant'
hg clone https://toolshed.g2.bx.psu.edu/repos/galaxyp/maxquant

Changeset 23:022e886e8f94 (2026-04-04)
Previous changeset 22:9c52362ae7bb (2024-03-18) Next changeset 24:fce1301d386c (2026-06-05)
Commit message:
planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/maxquant commit 598948efdd1500b24d2c8cb1ec9f87a9c9868a6e
modified:
macros.xml
maxquant.xml
maxquant_mqpar.xml
modify_mqpar.py
b
diff -r 9c52362ae7bb -r 022e886e8f94 macros.xml
--- a/macros.xml Mon Mar 18 13:07:04 2024 +0000
+++ b/macros.xml Sat Apr 04 21:38:16 2026 +0000
[
b'@@ -2,9 +2,8 @@\n <macros>\n     <token name="@PROFILE@">21.05</token>\n     <token name="@VERSION@">2.0.3.0</token>\n-    <token name="@VERSION_SUFFIX@">0</token>\n-    <token name="@VERSION_SUFFIX_MQPAR@">0</token>\n-    <token name="@VERSION_PTXQC@">1.0.16</token>\n+    <token name="@VERSION_SUFFIX@">2</token>\n+    <token name="@VERSION_SUFFIX_MQPAR@">2</token>\n     <token name="@SUBSTITUTION_RX@">[^\\w\\-\\s\\.]</token>\n     <token name="@TMT2PLEX@">\n                     - [TMT2plex-Lys126,TMT2plex-Nter126,0,0,0,0,True]\n@@ -96,10 +95,9 @@\n     <xml name="requirements">\n         <requirements>\n             <requirement type="package" version="@VERSION@">maxquant</requirement>\n-            <requirement type="package" version="5.4.1">pyyaml</requirement>\n-            <requirement type="package" version="3.1.418">dotnet</requirement>\n-            <requirement type="package" version="@VERSION_PTXQC@">r-ptxqc</requirement>\n-            <requirement type="package" version="1.32">tar</requirement>\n+            <requirement type="package" version="6.0.2">pyyaml</requirement>\n+            <requirement type="package" version="3.1.426">dotnet</requirement>\n+            <requirement type="package" version="1.34">tar</requirement>\n         </requirements>\n     </xml>\n     <xml name="required_files">\n@@ -109,140 +107,12 @@\n             <include path="mqparam.py" />\n         </required_files>\n     </xml>\n-    <xml name="ptxqc">\n-        <configfile name="qr_yaml">\n-            PTXQC:\n-              ReportFilename:\n-                extended: yes\n-              UseLocalMQPar: yes\n-              NameLengthMax_num: 10.0\n-              OutputFormats:\n-              - plainPDF\n-              PlainPDF:\n-                AddPageNumbers: \'on\'\n-            File:\n-              Parameters:\n-              #if $qc.do_it == "true":\n-                enabled: ${qc.parameters}\n-              #end if\n-              Summary:\n-              #if $qc.do_it == "true":\n-                enabled: ${qc.summary}\n-              #end if\n-                IDRate:\n-                  Thresh_bad_num: 20.0\n-                  Thresh_great_num: 35.0\n-              ProteinGroups:\n-              #if $qc.do_it == "true":\n-                enabled: ${qc.proteingroups}\n-              #end if\n-                RatioPlot:\n-                  LabelIncThresh_num: 4.0\n-                IntensityThreshLog2_num: 25.0\n-              Evidence:\n-              #if $qc.do_it == "true":\n-                enabled: ${qc.evidence}\n-              #end if\n-                ProteinCountThresh_num: 3500.0\n-                IntensityThreshLog2_num: 23.0\n-                PeptideCountThresh_num: 15000.0\n-                SpecialContaminants:\n-                  cont_MYCO:\n-                  - MYCOPLASMA\n-                  - \'1\'\n-            #if $varExists("mqpar_input"):\n-                #import re\n-                #set $mqpar_xml = open(str($mqpar_input), "r").read()\n-                #set $matchingTimeWindow = re.search("matchingTimeWindow>(.*)./matchingTimeWindow", $mqpar_xml).group(1)\n-                MQpar_MatchingTimeWindow_num: ${matchingTimeWindow}\n-            #else:\n-                #if $search_opts.mbr.match_between_runs == \'True\':\n-                MQpar_MatchingTimeWindow_num: ${search_opts.mbr.matching_time_window}\n-                #else:\n-                MQpar_MatchingTimeWindow_num: 0.0\n-                #end if\n-            #end if\n-                MatchBetweenRuns_wA: auto\n-                MQpar_firstSearchTol_num: 20.0\n-                firstSearch_outOfCalWarnSD_num: 2.0\n-                MQpar_mainSearchTol_num: 4.5\n-              MsMs:\n-              #if $qc.do_it == "true":\n-                enabled: ${qc.msms}\n-              #end if\n-              MsMsScans:\n-              #if $qc.do_it == "true":\n-                enabled: ${qc.msmsscans}\n-              #end if\n-                IonInjectionThresh_num: 10.0\n-            order:\n-              qcMetric_PAR: 1.0\n-              qcMetric_PG_PCA: 3.0\n-          '..b'_EVD_Top5Cont: 10.0\n-              qcMetric_PG_Ratio: 19.0\n-              qcMetric_EVD_UserContaminant: 20.0\n-              qcMetric_EVD_PeptideInt: 30.0\n-              qcMetric_EVD_ReporterInt: 31.0\n-              qcMetric_PG_RawInt: 32.0\n-              qcMetric_PG_LFQInt: 33.0\n-              qcMetric_PG_ReporterInt: 34.0\n-              qcMetric_MSMS_MissedCleavages: 40.0\n-              qcMetric_EVD_Charge: 100.0\n-              qcMetric_PG_Cont: 110.0\n-              qcMetric_MSMSScans_TopNoverRT: 120.0\n-              qcMetric_EVD_IDoverRT: 150.0\n-              qcMetric_EVD_RTPeakWidth: 170.0\n-              qcMetric_EVD_MBRAlign: 210.0\n-              qcMetric_EVD_MBRIdTransfer: 220.0\n-              qcMetric_EVD_MBRaux: 221.0\n-              qcMetric_MSMSScans_IonInjTime: 240.0\n-              qcMetric_MSMSScans_MSMSIntensity: 245.0\n-              qcMetric_EVD_MS2OverSampling: 250.0\n-              qcMetric_EVD_PreCal: 260.0\n-              qcMetric_EVD_PostCal: 270.0\n-              qcMetric_MSMS_MSMSDecal: 280.0\n-              qcMetric_SM_MSMSIdRate: 300.0\n-              qcMetric_MSMSScans_TopNID: 380.0\n-              qcMetric_MSMSScans_DepPep: 383.0\n-              qcMetric_EVD_MissingValues: 390.0\n-              qcMetric_EVD_PeptideCount: 400.0\n-              qcMetric_EVD_ProteinCount: 450.0\n-              qcMetric_AverageQualOverall: 9999.0\n-        </configfile>\n-        <configfile name="qr">\n-            library(PTXQC)\n-            library(data.table)\n-            library(yaml)\n-            library(methods)\n-            args = commandArgs(trailingOnly=TRUE)\n-            yaml_config = yaml.load_file(input = args[1])\n-            r = createReport(\'./combined/txt\', yaml_obj=yaml_config)\n-            cat(paste0("\\nReport generated as \'", r\\$report_file, "\'\\n\\n"))\n-        </configfile>\n-    </xml>\n     <xml name="mod_option" token_value="default">\n         <option value="@VALUE@">@VALUE@</option>\n     </xml>\n     <xml name="default_mod_option" token_value="default">\n         <option selected="true" value="@VALUE@">@VALUE@</option>\n     </xml>\n-    <xml name="ptxqc-opts">\n-        <conditional name="qc">\n-            <param name="do_it" label="Generate PTXQC (proteomics quality control pipeline) report? (experimental setting)" type="select">\n-                <option value="true">True</option>\n-                <option value="false" selected="true">False</option>\n-            </param>\n-            <when value="true">\n-                <param name="parameters" type="boolean" checked="true" label="use parameters.txt?" truevalue="yes" falsevalue="no"/>\n-                <param name="summary" type="boolean" checked="true" label="use summary.txt?" truevalue="yes" falsevalue="no"/>\n-                <param name="proteingroups" type="boolean" checked="true" label="use proteinGroups.txt?" truevalue="yes" falsevalue="no"/>\n-                <param name="evidence" type="boolean" checked="true" label="use evidence.txt?" truevalue="yes" falsevalue="no"/>\n-                <param name="msms" type="boolean" checked="true" label="use msms.txt?" truevalue="yes" falsevalue="no"/>\n-                <param name="msmsscans" type="boolean" checked="true" label="use msmsScans.txt?" truevalue="yes" falsevalue="no"/>\n-            </when>\n-            <when value="false"/>\n-        </conditional>\n-    </xml>\n \n     <xml name="output" tokens="name,label" token_format="tabular">\n         <data format="@FORMAT@" label="${on_string}: @LABEL@" name="@NAME@">\n@@ -276,9 +146,6 @@\n             <expand macro="output" name="output_all" format="tar" label="\'combined/txt/\' directory"/>\n             <expand macro="output" name="log" format="txt" label="log"/>\n             <expand macro="output" name="config" format="txt" label="yaml config file"/>\n-            <data format="pdf" label="PTXQC report for ${on_string}" name="ptxqc_report">\n-                <filter>qc[\'do_it\'] == "true"</filter>\n-            </data>\n         </outputs>\n     </xml>\n     <xml name="modification">\n'
b
diff -r 9c52362ae7bb -r 022e886e8f94 maxquant.xml
--- a/maxquant.xml Mon Mar 18 13:07:04 2024 +0000
+++ b/maxquant.xml Sat Apr 04 21:38:16 2026 +0000
[
b'@@ -9,30 +9,35 @@\n     ## this is needed to avoid dotnet from crashing, in a newer dotnet version we can remove that\n     export COMPlus_EnableDiagnostics=0 &&\n     #import re\n-    maxquant -c mqpar.xml 2>/dev/null  ## MQ writes success of creation to stderr\n+    maxquant -c mqpar.xml 2>/dev/null &&  ## MQ writes success of creation to stderr\n \n     #if \'config\' in $output_opts.output:\n-      &&\n-      cp \'$mq_conf\' \'$config\'\n+      cp \'$mq_conf\' \'$config\'  &&\n     #end if\n-    #set infiles = [$name for $pg in $paramGroups for $name in $pg.files]\n-    #set names = [re.sub(\'@SUBSTITUTION_RX@\', \'_\', str($n.element_identifier)) for $n in $infiles]\n-    #set names_with_ext = [($name if ($name).lower().endswith(str($input_opts.ftype)) else $name + str($input_opts.ftype)) for $name in $names]\n-    #for $target, $link in zip($infiles, $names_with_ext)\n-        &&\n-        #if str($input_opts.ftype) == \'.thermo.raw\':\n-        cp \'$target\' \'$link\'\n-        #else:\n-        ln -s \'$target\' \'$link\'\n-        #end if\n+    #set $link_names = []\n+    #for $pg in $paramGroups\n+        #for $infile in $pg.files\n+            #set $identifier = re.sub(\'@SUBSTITUTION_RX@\', \'_\', str($infile.element_identifier))\n+            #if $identifier.lower().endswith("."+$infile.ext)\n+                #set $link_name = $identifier\n+            #else    \n+                #set $link_name = $identifier + "." + $infile.ext\n+            #end if\n+            #if $infile.ext == \'thermo.raw\':\n+            cp \'$infile\' \'$link_name\' &&\n+            #else:\n+            ln -s \'$infile\' \'$link_name\' &&\n+            #end if\n+            #silent $link_names.append($link_name)\n+        #end for\n     #end for\n-    &&\n+\n     python3 \'$__tool_directory__/create_mqpar.py\'\n     #if $search_opts.template\n         --exp_design=\'$search_opts.template\'\n     #end if\n     --version=@VERSION@ \n-    --num_threads=\\${GALAXY_SLOTS:-1}\n+    --num_threads="\\${GALAXY_SLOTS:-1}"\n     --substitution_rx=\'@SUBSTITUTION_RX@\'\n     --yaml=\'$mq_conf\'\n     mqpar.xml\n@@ -54,16 +59,6 @@\n           &&\n           tar -zcf \'$output_all\' ./combined/txt\n       #end if\n-      \n-      #if $qc.do_it == \'true\':\n-        &&\n-        Rscript \'$qr\' \'$qr_yaml\'\n-          #if \'log\' in $output_opts.output:\n-              >> \'$log\' 2>&1\n-          #end if\n-        &&\n-        cp \'./combined/txt/report_v@VERSION_PTXQC@_combined.pdf\' \'$ptxqc_report\'\n-      #end if\n     #end if\n     ]]></command>\n \n@@ -114,9 +109,17 @@\n             #end if\n             paramGroups:\n             #for $pg in $paramGroups:\n-              #set names = [re.sub(\'@SUBSTITUTION_RX@\', \'_\', str($n.element_identifier)) for $n in $pg.files]\n-              #set names_with_ext = [($name if ($name).lower().endswith(str($input_opts.ftype)) else $name + str($input_opts.ftype)) for $name in $names]\n-              - files: $names_with_ext\n+                #set $link_names = []\n+                #for $infile in $pg.files\n+                    #set $identifier = re.sub(\'@SUBSTITUTION_RX@\', \'_\', str($infile.element_identifier))\n+                    #if $identifier.lower().endswith("."+$infile.ext)\n+                        #set $link_name = $identifier\n+                    #else    \n+                        #set $link_name = $identifier + "." + $infile.ext\n+                    #end if\n+                    #silent $link_names.append($link_name)\n+                #end for\n+              - files: $link_names\n                 maxMissedCleavages: ${pg.maxMissedCleavages}\n                 #if $pg.fixedModifications:\n                 fixedModifications: [${pg.fixedModifications}]\n@@ -257,16 +260,10 @@\n                 #end if\n             #end for\n         </configfile>\n-        <expand macro="ptxqc"/>\n     </configfiles>\n \n     <inputs>\n         <section name="input_opts" title="Input Options" expanded="True">\n-            <param name="ftype" type="select" label="choose the type of your input files">\n-                <option value=".thermo.raw">thermo.raw</option>\n-    '..b'ame="select_quant_method" value="reporter_ion_ms2" />\n                     <conditional name="iso_labels">\n@@ -899,8 +941,9 @@\n                     </conditional>\n                 </conditional>\n             </repeat>\n-            <param name="do_it" value="false" />\n-            <param name="output" value="msmsScans" />\n+            <section name="output_opts">\n+                <param name="output" value="msmsScans" />\n+            </section>\n             <output name="msmsScans" file="09/combined/txt/msmsScans.txt">\n                 <assert_contents>\n                     <has_text text="GANDSMMM" />\n@@ -909,23 +952,60 @@\n         </test>\n         <!-- 10 Thermo RAW file test -->\n         <test expect_num_outputs="2">\n-            <param name="ftype" value=".thermo.raw" />\n-            <param name="fasta_files" value="bsa.fasta" />\n-            <param name="identifier_parse_rule" value="^&gt;.*\\|(.*)\\|.*$" />\n-            <param name="description_parse_rule" value="^&gt;.*\\|.*\\|[^ ]+ (.*) OS.*$" />\n-            <param name="min_unique_pep" value="1" />\n+            <section name="input_opts">\n+                <param name="fasta_files" value="bsa.fasta" />\n+                <param name="identifier_parse_rule" value="^&gt;.*\\|(.*)\\|.*$" />\n+                <param name="description_parse_rule" value="^&gt;.*\\|.*\\|[^ ]+ (.*) OS.*$" />\n+            </section>\n+            <section name="search_opts">\n+                <param name="min_unique_pep" value="1" />\n+            </section>\n             <repeat name="paramGroups">\n-                <param name="files" value="thermo.raw"/>\n+                <param name="files" value="thermo.raw" ftype="thermo.raw"/>\n                 <param name="maxMissedCleavages" value="1"/>\n                 <param name="variableModifications" value="Oxidation (M)" />\n                 <conditional name="quant_method">\n                     <param name="select_quant_method" value="lfq" />\n                 </conditional>\n             </repeat>\n-            <param name="output" value="config,mqpar" />\n+            <section name="output_opts">\n+                <param name="output" value="config,mqpar" />\n+            </section>\n             <output name="config" file="10/config.yml" lines_diff="2" />\n             <output name="mqpar" file="10/mqpar.xml" lines_diff="10" />\n         </test>\n+\n+         <!-- 11 Thermo RAW file test using Modifications containing `->`\n+              (same as 10, ecxept for the modifications) -->\n+        <test expect_num_outputs="2">\n+            <section name="input_opts">\n+                <param name="fasta_files" value="bsa.fasta" />\n+                <param name="identifier_parse_rule" value="^&gt;.*\\|(.*)\\|.*$" />\n+                <param name="description_parse_rule" value="^&gt;.*\\|.*\\|[^ ]+ (.*) OS.*$" />\n+            </section>\n+            <section name="search_opts">\n+                <param name="min_unique_pep" value="1" />\n+            </section>\n+            <repeat name="paramGroups">\n+                <param name="files" value="thermo.raw" ftype="thermo.raw"/>\n+                <param name="maxMissedCleavages" value="1"/>\n+                <param name="variableModifications" value="Glu-&gt;pyro-Glu" />\n+                <param name="fixedModifications" value="Ala-&gt;Asp" />\n+                <conditional name="quant_method">\n+                    <param name="select_quant_method" value="lfq" />\n+                </conditional>\n+            </repeat>\n+            <section name="output_opts">\n+                <param name="output" value="config,mqpar" />\n+            </section>\n+            <output name="config">\n+                <assert_contents>\n+                    <has_text text="fixedModifications: [Ala->Asp]"/>\n+                    <has_text text="variableModifications: [Glu->pyro-Glu]"/>\n+                </assert_contents>\n+            </output>\n+            <output name="mqpar" file="10/mqpar.xml" lines_diff="10" />\n+        </test>\n     </tests>\n \n     <help><![CDATA[\n'
b
diff -r 9c52362ae7bb -r 022e886e8f94 maxquant_mqpar.xml
--- a/maxquant_mqpar.xml Mon Mar 18 13:07:04 2024 +0000
+++ b/maxquant_mqpar.xml Sat Apr 04 21:38:16 2026 +0000
[
@@ -9,25 +9,30 @@
     export COMPlus_EnableDiagnostics=0 &&
     ## link galaxy datasets to filenames accepted by maxquant
     #import re
-    #set names = [re.sub('@SUBSTITUTION_RX@', '_', str($n.element_identifier)) for $n in $input_opts.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)
-        #if str($input_opts.ftype) == '.thermo.raw':
-        cp '$target' '$link' &&
+    #set $link_names = []
+    #for $infile in $infiles
+        #set $identifier = re.sub('@SUBSTITUTION_RX@', '_', str($infile.element_identifier))
+        #if $identifier.lower().endswith("."+$infile.ext)
+            #set $link_name = $identifier
+        #else    
+            #set $link_name = $identifier + "." + $infile.ext
+        #end if
+        #if $infile.ext == 'thermo.raw':
+        cp '$infile' '$link_name' &&
         #else:
-        ln -s '$target' '$link' &&
+        ln -s '$infile' '$link_name' &&
         #end if
+        #silent $link_names.append($link_name)
     #end for
 
     python3 '$__tool_directory__/modify_mqpar.py'
-    #set inf = ','.join($names_with_ext)
-    --infiles='$inf'
-    --version=@VERSION@
-    --num_threads=\${GALAXY_SLOTS:-1}
-    --substitution_rx='@SUBSTITUTION_RX@'
-    --fasta_files='$fasta_files'
-    --description_parse_rule='$description_parse_rule'
-    --identifier_parse_rule='$identifier_parse_rule'
+    --infiles #echo ' '.join([f"'{n}'" for n in $link_names])
+    --version @VERSION@
+    --num_threads "\${GALAXY_SLOTS:-1}"
+    --substitution_rx '@SUBSTITUTION_RX@'
+    --fasta_files '$fasta_files'
+    --description_parse_rule '$description_parse_rule'
+    --identifier_parse_rule '$identifier_parse_rule'
     '$mqpar_input'
 
     &&
@@ -40,45 +45,12 @@
         &&
         tar -zcf '$output_all' ./combined/txt
     #end if
-  
-    #if $qc.do_it == 'true':
-        &&
-        Rscript '$qr' '$qr_yaml'
-        #if 'log' in $output:
-            >> '$log' 2>&1
-        #end if
-        &&
-        cp ./combined/txt/report_v@VERSION_PTXQC@_combined.pdf '$ptxqc_report'
-    #end if
     ]]></command>
 
-    <configfiles>
-        <expand macro="ptxqc"/>
-    </configfiles>
-
     <inputs>
-        <conditional name="input_opts">
-            <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>
-            <when value=".thermo.raw"> 
-                <param multiple="true" name="infiles" type="data"
-                       format="thermo.raw" label="RAW Files"
-                       help="Specify one or more Thermo RAW files" />
-            </when>
-            <when value=".mzxml">
-                <param multiple="true" name="infiles" type="data"
-                       format="mzxml" label="mzXML Files"
-                       help="Specify one or more mzXML files" />
-            </when>
-            <when value=".mzml">
-                <param multiple="true" name="infiles" type="data"
-                       format="mzml" label="mzML Files"
-                       help="Specify one or more mzML files" />
-            </when>
-        </conditional>
+        <param multiple="true" name="infiles" type="data"
+            format="thermo.raw,mzml,mzxml" label="Infiles"
+            help="One or more files. All need to be of the same datatype." />
         <param format="fasta" multiple="true" name="fasta_files"
                type="data" label="FASTA files"
                help="Specify one or more FASTA databases." />
@@ -105,7 +77,6 @@
                       from the local machine are ignored. E.g. a file named
                       'test01.raw' in galaxy can either be named 'test01.raw' or
                       'D:\path\to\test01.raw' in the mqpar.xml."/>
-        <expand macro="ptxqc-opts"/>
         <param type="select" name="output" label="Select the desired outputs."
                multiple="true" optional="false">
             <option value="proteinGroups">Protein Groups</option>
@@ -128,13 +99,10 @@
             <option value="log">MaxQuant and PTXQC log</option>
         </param>
     </inputs>
-
     <expand macro="outputs"/>
-
     <tests>
         <test expect_num_outputs="19">
-            <param name="ftype" value=".mzxml" />
-            <param name="infiles" value="BSA_min_22,BSA_min_21.mzXML" />
+            <param name="infiles" value="BSA_min_22,BSA_min_21.mzXML" ftype="mzxml"/>
             <param name="fasta_files" value="bsa.fasta" />
             <param name="identifier_parse_rule" value="&gt;([^\s]*)" />
             <param name="description_parse_rule" value="&gt;(.*)" />
b
diff -r 9c52362ae7bb -r 022e886e8f94 modify_mqpar.py
--- a/modify_mqpar.py Mon Mar 18 13:07:04 2024 +0000
+++ b/modify_mqpar.py Sat Apr 04 21:38:16 2026 +0000
[
@@ -7,8 +7,7 @@
 
 parser = argparse.ArgumentParser()
 
-arguments = ('--infiles',
-             '--version',
+arguments = ('--version',
              '--num_threads',
              '--substitution_rx',
              '--fasta_files',
@@ -16,13 +15,14 @@
              '--identifier_parse_rule',
              'mqpar')
 
+parser.add_argument('--infiles', nargs='+')
 for arg in arguments:
     parser.add_argument(arg)
 
 args = parser.parse_args()
 
 mqpar_out = os.path.join(os.getcwd(), 'mqpar.xml')
-infiles = [os.path.join(os.getcwd(), f) for f in args.infiles.split(',')]
+infiles = [os.path.join(os.getcwd(), f) for f in args.infiles]
 mqparam = MQParam(args.mqpar, None, substitution_rx=args.substitution_rx)
 if mqparam.version != args.version:
     raise Exception('mqpar version is ' + mqparam.version + '. Tool uses version {}.'.format(args.version))