diff idconvert/idconvert.xml @ 4:158a71ee5733 draft

planemo upload commit b4871f9659a924a68430aed3a93f4f9bad733fd6
author galaxyp
date Wed, 07 Dec 2016 17:43:19 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/idconvert/idconvert.xml	Wed Dec 07 17:43:19 2016 -0500
@@ -0,0 +1,123 @@
+<tool id="idconvert" name="idconvert" version="@VERSION@.0">
+    <description>Convert mass spectrometry identification files</description>
+    <macros>
+        <import>msconvert_macros.xml</import>
+    </macros>
+    <expand macro="generic_requirements" />
+    <stdio>
+        <exit_code range="1:" />
+        <regex match="Error"
+           source="both"
+           level="fatal"
+           description="Error" />
+    </stdio>
+    <command>
+<![CDATA[
+#import os.path
+#set $input_name = '.'.join([$os.path.basename(str($from.input)),str($from.input.extension).replace('xml','.xml')])
+ln -s "$from.input" "$input_name" &&
+idconvert $input_name 
+#if str($to_format) == 'pep.xml':
+--pepXML
+#elif str($to_format) == 'text':
+--text
+#end if
+--outdir outdir 
+&& cp outdir/* $output
+]]>
+    </command>
+    <inputs> 
+        <conditional name="from">
+            <param name="from_format" type="select" label="Convert from">
+                <option value="mzid">mzIdentML (mzid)</option>
+                <option value="pepxml">pepXML (pepxml)</option>
+                <option value="protxml">protXML (protxml)</option>
+            </param>
+            <when value="mzid">
+                <param name="input" type="data" format="pepxml,protxml,mzid" label="MS mzIdentML (mzid)" />
+            </when>
+            <when value="protxml">
+                <param name="input" type="data" format="protxml" label="MS pepXML (pepxml)" />
+                <param name="pepxml" type="data" format="pepxml" multiple="true" label="MS Identification" />
+            </when>
+            <when value="pepxml">
+                <param name="input" type="data" format="pepxml" label="MS Identification" />
+            </when>
+        </conditional>
+        <param name="to_format" type="select" label="Convert to">
+            <option value="mzid">mzIdentML (mzid)</option>
+            <option value="pep.xml">pepXML (pepxml)</option>
+            <option value="text">text</option>
+        </param>
+  </inputs>
+  <outputs>
+      <data format="mzid" name="output" label="${from.input.name.rsplit('.',1)[0]}.${to_format}">
+        <change_format>
+          <when input="to_format" value="pep.xml" format="pepxml" />
+          <when input="to_format" value="text" format="txt" />
+        </change_format>
+      </data>
+  </outputs>
+  <tests>
+      <test>
+          <param name="input" value="Rpal_01.pepXML" />
+          <param name="from_format" value="pepxml" />
+          <param name="to_format" value="mzid" />
+          <output name="output_psms">
+              <assert_contents>
+                  <has_text text="MzIdentML" />
+                  <has_text text="VIKKSTTGRVLSDDILVIRKGEIAARNASHKMR" />
+              </assert_contents>
+          </output>
+      </test>
+      <test>
+          <param name="input" value="Rpal_01.mzid" />
+          <param name="from_format" value="mzid" />
+          <param name="to_format" value="pep.xml" />
+          <output name="output_psms">
+              <assert_contents>
+                  <has_text text="msms_pipeline_analysis" />
+                  <has_text text="VIKKSTTGRVLSDDILVIRKGEIAARNASHKMR" />
+              </assert_contents>
+          </output>
+      </test>
+  </tests>
+  <help>
+<![CDATA[
+idconvert [options] [filemasks]
+Convert mass spec identification file formats.
+
+Return value: # of failed files.
+
+Options:
+  -f [ --filelist ] arg    : specify text file containing filenames
+  -o [ --outdir ] arg (=.) : set output directory ('-' for stdout) [.]
+  -c [ --config ] arg      : configuration file (optionName=value)
+  -e [ --ext ] arg         : set extension for output files [mzid|pepXML|txt]
+  --mzIdentML              : write mzIdentML format [default]
+  --pepXML                 : write pepXML format
+  --text                   : write hierarchical text format
+  -v [ --verbose ]         : display detailed progress information
+Examples:
+
+# convert sequest.pepXML to sequest.mzid
+idconvert sequest.pepXML
+
+# convert sequest.protXML to sequest.mzid
+# Also reads any pepXML file referenced in the 
+# protXML file if available.  If the protXML 
+# file has been moved from its original location, 
+# the pepXML will still be found if it has also 
+# been moved to the same position relative to the 
+# protXML file. This relative position is determined 
+# by reading the protXML protein_summary:summary_xml 
+# and protein_summary_header:source_files values.
+idconvert sequest.protXML
+
+# convert mascot.mzid to mascot.pepXML
+idconvert mascot.mzid --pepXML
+
+]]>
+  </help>
+  <expand macro="citations" />
+</tool>