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

Changeset 4:9cb7dcc07dae (2021-02-19)
Previous changeset 3:2d67fb758956 (2020-04-11)
Commit message:
"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/maxquant commit 5e4f8567c0145de8c6f9344fe4ee4c3bf2a81e59"
modified:
macros.xml
maxquant_mqpar.xml
mqparam.py
added:
test-data/txt/mqpar.xml
b
diff -r 2d67fb758956 -r 9cb7dcc07dae macros.xml
--- a/macros.xml Sat Apr 11 11:50:09 2020 -0400
+++ b/macros.xml Fri Feb 19 21:25:06 2021 +0000
b
@@ -133,7 +133,7 @@
 
     <xml name="ptxqc-opts">
         <conditional name="qc">
-            <param name="do_it" label="Generate PTXQC (proteomics quality control pipeline) report? (at own risk)"
+            <param name="do_it" label="Generate PTXQC (proteomics quality control pipeline) report? (experimental setting)"
                    type="boolean" checked="false"/>
             <when value="true">
                 <param name="parameters" type="boolean" checked="true"
b
diff -r 2d67fb758956 -r 9cb7dcc07dae maxquant_mqpar.xml
--- a/maxquant_mqpar.xml Sat Apr 11 11:50:09 2020 -0400
+++ b/maxquant_mqpar.xml Fri Feb 19 21:25:06 2021 +0000
[
@@ -31,14 +31,14 @@
     --fasta_files='$fasta_files'
     --description_parse_rule='$description_parse_rule'
     --identifier_parse_rule='$identifier_parse_rule'
-    '$mqpar'
+    '$mqpar_input'
 
     &&
     maxquant mqpar.xml
     #if 'log' in $output:
         >> '$log'
     #end if
-    && mv '$mqpar' combined/txt/mqpar.xml
+    && mv mqpar.xml combined/txt/mqpar.xml
     #if 'output_all' in $output:
         &&
         tar -zcf '$output_all' ./combined/txt
@@ -102,7 +102,7 @@
                 </valid>
             </sanitizer>
         </param>
-        <param type="data" name="mqpar" format="xml"
+        <param type="data" name="mqpar_input" format="xml"
                label="mqpar.xml file with your search parameters. RAW file names 
                       must match the names displayed in galaxy. Their paths 
                       from the local machine are ignored. E.g. a file named
@@ -141,8 +141,8 @@
             <param name="fasta_files" value="bsa.fasta" />
             <param name="identifier_parse_rule" value="&gt;([^\s]*)" />
             <param name="description_parse_rule" value="&gt;(.*)" />
-            <param name="mqpar" value="mqpar.xml" />
-            <param name="output" value="evidence,msms,mzTab,allPeptides,msmsScans,mzRange,parameters,peptides,peptideSection,proteinGroups,summary,modificationSpecificPeptides,output_all" />
+            <param name="mqpar_input" value="mqpar.xml" />
+            <param name="output" value="evidence,msms,mzTab,allPeptides,msmsScans,mzRange,parameters,peptides,peptideSection,proteinGroups,summary,modificationSpecificPeptides,mqpar,output_all" />
             <output name="evidence" file="txt/evidence.txt" />
             <output name="msms" file="txt/msms.txt" lines_diff="2" />
             <output name="allPeptides" file="txt/allPeptides.txt" lines_diff="32" />
@@ -153,6 +153,7 @@
             <output name="proteinGroups" file="txt/proteinGroups.txt" />
             <output name="summary" file="txt/summary.txt" />
             <output name="modificationSpecificPeptides" file="txt/modificationSpecificPeptides.txt" />
+            <output name="mqpar" file="txt/mqpar.xml" lines_diff="8" />
         </test>
     </tests>
     <help><![CDATA[
b
diff -r 2d67fb758956 -r 9cb7dcc07dae mqparam.py
--- a/mqparam.py Sat Apr 11 11:50:09 2020 -0400
+++ b/mqparam.py Fri Feb 19 21:25:06 2021 +0000
[
@@ -6,11 +6,12 @@
 import ntpath
 import os
 import re
-import yaml
 import xml.etree.ElementTree as ET
 from itertools import zip_longest
 from xml.dom import minidom
 
+import yaml
+
 
 def et_add_child(el, name, text, attrib=None):
     "Add a child element to an xml.etree.ElementTree.Element"
@@ -308,6 +309,23 @@
                              .format(key))
         node.text = str(value)
 
+    def set_list_param(self, key, values):
+        """Set a list parameter.
+        Args:
+            key: (string) XML tag of the parameter
+            values: the lit of values of the parameter XML node
+        Returns:
+            None
+        """
+        node = self._root.find(key)
+        if node is None:
+            raise ValueError('Element {} not found in parameter file'
+                             .format(key))
+        node.clear()
+        node.tag = key
+        for e in values:
+            et_add_child(node, name='string', text=e)
+
     def _from_yaml(self, conf):
         """Read a yaml config file.
         Args:
@@ -317,6 +335,7 @@
         """
         with open(conf) as f:
             conf_dict = yaml.safe_load(f.read())
+
         paramGroups = conf_dict.pop('paramGroups')
         self.add_infiles([pg.pop('files') for pg in paramGroups])
         for i, pg in enumerate(paramGroups):
@@ -325,8 +344,8 @@
                 self[i].set_silac(*silac)
             isobaricLabels = pg.pop('isobaricLabels', False)
             if isobaricLabels:
-                for l in isobaricLabels:
-                    self[i].set_isobaric_label(*l)
+                for ibl in isobaricLabels:
+                    self[i].set_isobaric_label(*ibl)
             for el in ['fixedModifications', 'variableModifications', 'enzymes']:
                 lst = pg.pop(el, None)
                 if lst is not None:
@@ -339,7 +358,10 @@
         else:
             raise Exception('No fasta files provided.')
         for key in conf_dict:
-            self.set_simple_param(key, conf_dict[key])
+            if key in ['restrictMods']:
+                self.set_list_param(key, conf_dict[key])
+            else:
+                self.set_simple_param(key, conf_dict[key])
 
     def write(self, mqpar_out):
         """Write pretty formatted xml parameter file.
b
diff -r 2d67fb758956 -r 9cb7dcc07dae test-data/txt/mqpar.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/txt/mqpar.xml Fri Feb 19 21:25:06 2021 +0000
[
b'@@ -0,0 +1,458 @@\n+<?xml version="1.0" ?>\n+<MaxQuantParams>\n+\t<fastaFiles>\n+\t\t<FastaFileInfo>\n+\t\t\t<fastaFilePath>/mnt/galaxy/data/003/dataset_3981.dat</fastaFilePath>\n+\t\t\t<identifierParseRule>&gt;([^\\s]*)</identifierParseRule>\n+\t\t\t<descriptionParseRule>&gt;(.*)</descriptionParseRule>\n+\t\t\t<taxonomyParseRule/>\n+\t\t\t<variationParseRule/>\n+\t\t\t<modificationParseRule/>\n+\t\t\t<taxonomyId/>\n+\t\t</FastaFileInfo>\n+\t</fastaFiles>\n+\t<fastaFilesProteogenomics>\n+   </fastaFilesProteogenomics>\n+\t<fastaFilesFirstSearch>\n+   </fastaFilesFirstSearch>\n+\t<fixedSearchFolder/>\n+\t<andromedaCacheSize>350000</andromedaCacheSize>\n+\t<advancedRatios>True</advancedRatios>\n+\t<pvalThres>0.005</pvalThres>\n+\t<neucodeRatioBasedQuantification>False</neucodeRatioBasedQuantification>\n+\t<neucodeStabilizeLargeRatios>False</neucodeStabilizeLargeRatios>\n+\t<rtShift>False</rtShift>\n+\t<separateLfq>False</separateLfq>\n+\t<lfqStabilizeLargeRatios>True</lfqStabilizeLargeRatios>\n+\t<lfqRequireMsms>True</lfqRequireMsms>\n+\t<decoyMode>revert</decoyMode>\n+\t<boxCarMode>all</boxCarMode>\n+\t<includeContaminants>True</includeContaminants>\n+\t<maxPeptideMass>4600</maxPeptideMass>\n+\t<epsilonMutationScore>True</epsilonMutationScore>\n+\t<mutatedPeptidesSeparately>True</mutatedPeptidesSeparately>\n+\t<proteogenomicPeptidesSeparately>True</proteogenomicPeptidesSeparately>\n+\t<minDeltaScoreUnmodifiedPeptides>0</minDeltaScoreUnmodifiedPeptides>\n+\t<minDeltaScoreModifiedPeptides>6</minDeltaScoreModifiedPeptides>\n+\t<minScoreUnmodifiedPeptides>0</minScoreUnmodifiedPeptides>\n+\t<minScoreModifiedPeptides>40</minScoreModifiedPeptides>\n+\t<secondPeptide>True</secondPeptide>\n+\t<matchBetweenRuns>False</matchBetweenRuns>\n+\t<matchUnidentifiedFeatures>False</matchUnidentifiedFeatures>\n+\t<matchBetweenRunsFdr>False</matchBetweenRunsFdr>\n+\t<dependentPeptides>False</dependentPeptides>\n+\t<dependentPeptideFdr>0</dependentPeptideFdr>\n+\t<dependentPeptideMassBin>0</dependentPeptideMassBin>\n+\t<dependentPeptidesBetweenRuns>False</dependentPeptidesBetweenRuns>\n+\t<dependentPeptidesWithinExperiment>False</dependentPeptidesWithinExperiment>\n+\t<dependentPeptidesWithinParameterGroup>False</dependentPeptidesWithinParameterGroup>\n+\t<dependentPeptidesRestrictFractions>False</dependentPeptidesRestrictFractions>\n+\t<dependentPeptidesFractionDifference>0</dependentPeptidesFractionDifference>\n+\t<msmsConnection>False</msmsConnection>\n+\t<ibaq>False</ibaq>\n+\t<top3>False</top3>\n+\t<independentEnzymes>False</independentEnzymes>\n+\t<useDeltaScore>False</useDeltaScore>\n+\t<splitProteinGroupsByTaxonomy>False</splitProteinGroupsByTaxonomy>\n+\t<taxonomyLevel>Species</taxonomyLevel>\n+\t<avalon>False</avalon>\n+\t<nModColumns>3</nModColumns>\n+\t<ibaqLogFit>False</ibaqLogFit>\n+\t<razorProteinFdr>True</razorProteinFdr>\n+\t<deNovoSequencing>False</deNovoSequencing>\n+\t<deNovoVarMods>True</deNovoVarMods>\n+\t<massDifferenceSearch>False</massDifferenceSearch>\n+\t<isotopeCalc>False</isotopeCalc>\n+\t<writePeptidesForSpectrumFile/>\n+\t<intensityPredictionsFile>\n+   </intensityPredictionsFile>\n+\t<minPepLen>7</minPepLen>\n+\t<psmFdrCrosslink>0.01</psmFdrCrosslink>\n+\t<peptideFdr>0.01</peptideFdr>\n+\t<proteinFdr>0.01</proteinFdr>\n+\t<siteFdr>0.01</siteFdr>\n+\t<minPeptideLengthForUnspecificSearch>8</minPeptideLengthForUnspecificSearch>\n+\t<maxPeptideLengthForUnspecificSearch>25</maxPeptideLengthForUnspecificSearch>\n+\t<useNormRatiosForOccupancy>True</useNormRatiosForOccupancy>\n+\t<minPeptides>1</minPeptides>\n+\t<minRazorPeptides>1</minRazorPeptides>\n+\t<minUniquePeptides>0</minUniquePeptides>\n+\t<useCounterparts>False</useCounterparts>\n+\t<advancedSiteIntensities>True</advancedSiteIntensities>\n+\t<customProteinQuantification>False</customProteinQuantification>\n+\t<customProteinQuantificationFile/>\n+\t<minRatioCount>2</minRatioCount>\n+\t<restrictProteinQuantification>True</restrictProteinQuantification>\n+\t<restrictMods>\n+\t\t<string>Oxidation (M)</string>\n+\t\t<string>Acetyl (Protein N-term)</string>\n+\t</restrictMods>\n+\t<matchingTimeWindow>0</matchingTimeWindow>\n+\t<matchingIonMobilityWindow>0</matchi'..b'<IncludeWater>True</IncludeWater>\n+\t\t\t<IncludeAmmonia>True</IncludeAmmonia>\n+\t\t\t<DependentLosses>True</DependentLosses>\n+\t\t\t<Recalibration>False</Recalibration>\n+\t\t</msmsParams>\n+\t\t<msmsParams>\n+\t\t\t<Name>Unknown</Name>\n+\t\t\t<MatchTolerance>20</MatchTolerance>\n+\t\t\t<MatchToleranceInPpm>True</MatchToleranceInPpm>\n+\t\t\t<DeisotopeTolerance>7</DeisotopeTolerance>\n+\t\t\t<DeisotopeToleranceInPpm>True</DeisotopeToleranceInPpm>\n+\t\t\t<DeNovoTolerance>10</DeNovoTolerance>\n+\t\t\t<DeNovoToleranceInPpm>True</DeNovoToleranceInPpm>\n+\t\t\t<Deisotope>True</Deisotope>\n+\t\t\t<Topx>12</Topx>\n+\t\t\t<TopxInterval>100</TopxInterval>\n+\t\t\t<HigherCharges>True</HigherCharges>\n+\t\t\t<IncludeWater>True</IncludeWater>\n+\t\t\t<IncludeAmmonia>True</IncludeAmmonia>\n+\t\t\t<DependentLosses>True</DependentLosses>\n+\t\t\t<Recalibration>False</Recalibration>\n+\t\t</msmsParams>\n+\t</msmsParamsArray>\n+\t<fragmentationParamsArray>\n+\t\t<fragmentationParams>\n+\t\t\t<Name>CID</Name>\n+\t\t\t<Connected>False</Connected>\n+\t\t\t<ConnectedScore0>1</ConnectedScore0>\n+\t\t\t<ConnectedScore1>1</ConnectedScore1>\n+\t\t\t<ConnectedScore2>1</ConnectedScore2>\n+\t\t\t<InternalFragments>False</InternalFragments>\n+\t\t\t<InternalFragmentWeight>1</InternalFragmentWeight>\n+\t\t\t<InternalFragmentAas>KRH</InternalFragmentAas>\n+\t\t</fragmentationParams>\n+\t\t<fragmentationParams>\n+\t\t\t<Name>HCD</Name>\n+\t\t\t<Connected>False</Connected>\n+\t\t\t<ConnectedScore0>1</ConnectedScore0>\n+\t\t\t<ConnectedScore1>1</ConnectedScore1>\n+\t\t\t<ConnectedScore2>1</ConnectedScore2>\n+\t\t\t<InternalFragments>False</InternalFragments>\n+\t\t\t<InternalFragmentWeight>1</InternalFragmentWeight>\n+\t\t\t<InternalFragmentAas>KRH</InternalFragmentAas>\n+\t\t</fragmentationParams>\n+\t\t<fragmentationParams>\n+\t\t\t<Name>ETD</Name>\n+\t\t\t<Connected>False</Connected>\n+\t\t\t<ConnectedScore0>1</ConnectedScore0>\n+\t\t\t<ConnectedScore1>1</ConnectedScore1>\n+\t\t\t<ConnectedScore2>1</ConnectedScore2>\n+\t\t\t<InternalFragments>False</InternalFragments>\n+\t\t\t<InternalFragmentWeight>1</InternalFragmentWeight>\n+\t\t\t<InternalFragmentAas>KRH</InternalFragmentAas>\n+\t\t</fragmentationParams>\n+\t\t<fragmentationParams>\n+\t\t\t<Name>PQD</Name>\n+\t\t\t<Connected>False</Connected>\n+\t\t\t<ConnectedScore0>1</ConnectedScore0>\n+\t\t\t<ConnectedScore1>1</ConnectedScore1>\n+\t\t\t<ConnectedScore2>1</ConnectedScore2>\n+\t\t\t<InternalFragments>False</InternalFragments>\n+\t\t\t<InternalFragmentWeight>1</InternalFragmentWeight>\n+\t\t\t<InternalFragmentAas>KRH</InternalFragmentAas>\n+\t\t</fragmentationParams>\n+\t\t<fragmentationParams>\n+\t\t\t<Name>ETHCD</Name>\n+\t\t\t<Connected>False</Connected>\n+\t\t\t<ConnectedScore0>1</ConnectedScore0>\n+\t\t\t<ConnectedScore1>1</ConnectedScore1>\n+\t\t\t<ConnectedScore2>1</ConnectedScore2>\n+\t\t\t<InternalFragments>False</InternalFragments>\n+\t\t\t<InternalFragmentWeight>1</InternalFragmentWeight>\n+\t\t\t<InternalFragmentAas>KRH</InternalFragmentAas>\n+\t\t</fragmentationParams>\n+\t\t<fragmentationParams>\n+\t\t\t<Name>ETCID</Name>\n+\t\t\t<Connected>False</Connected>\n+\t\t\t<ConnectedScore0>1</ConnectedScore0>\n+\t\t\t<ConnectedScore1>1</ConnectedScore1>\n+\t\t\t<ConnectedScore2>1</ConnectedScore2>\n+\t\t\t<InternalFragments>False</InternalFragments>\n+\t\t\t<InternalFragmentWeight>1</InternalFragmentWeight>\n+\t\t\t<InternalFragmentAas>KRH</InternalFragmentAas>\n+\t\t</fragmentationParams>\n+\t\t<fragmentationParams>\n+\t\t\t<Name>UVPD</Name>\n+\t\t\t<Connected>False</Connected>\n+\t\t\t<ConnectedScore0>1</ConnectedScore0>\n+\t\t\t<ConnectedScore1>1</ConnectedScore1>\n+\t\t\t<ConnectedScore2>1</ConnectedScore2>\n+\t\t\t<InternalFragments>False</InternalFragments>\n+\t\t\t<InternalFragmentWeight>1</InternalFragmentWeight>\n+\t\t\t<InternalFragmentAas>KRH</InternalFragmentAas>\n+\t\t</fragmentationParams>\n+\t\t<fragmentationParams>\n+\t\t\t<Name>Unknown</Name>\n+\t\t\t<Connected>False</Connected>\n+\t\t\t<ConnectedScore0>1</ConnectedScore0>\n+\t\t\t<ConnectedScore1>1</ConnectedScore1>\n+\t\t\t<ConnectedScore2>1</ConnectedScore2>\n+\t\t\t<InternalFragments>False</InternalFragments>\n+\t\t\t<InternalFragmentWeight>1</InternalFragmentWeight>\n+\t\t\t<InternalFragmentAas>KRH</InternalFragmentAas>\n+\t\t</fragmentationParams>\n+\t</fragmentationParamsArray>\n+</MaxQuantParams>\n+\n'