diff GNPSExport.xml @ 4:2da14ae3844a draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
author galaxyp
date Thu, 01 Dec 2022 18:57:27 +0000
parents 2dabae2814df
children 87a970d1514b
line wrap: on
line diff
--- a/GNPSExport.xml	Fri Nov 06 19:46:28 2020 +0000
+++ b/GNPSExport.xml	Thu Dec 01 18:57:27 2022 +0000
@@ -1,13 +1,12 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <!--This is a configuration file for the integration of a tools into Galaxy (https://galaxyproject.org/). This file was automatically generated using CTDConverter.-->
-<!--Proposed Tool Section: []-->
-<tool id="GNPSExport" name="GNPSExport" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@" profile="20.05">
-  <description>Tool to export consensus features into MGF format</description>
+<!--Proposed Tool Section: [File Handling]-->
+<tool id="GNPSExport" name="GNPSExport" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
+  <description>Tool to export representative consensus MS/MS scan per consensusElement into a .MGF file format.
+See the documentation on https://ccms-ucsd.github.io/GNPSDocumentation/featurebasedmolecularnetworking-with-openms</description>
   <macros>
     <token name="@EXECUTABLE@">GNPSExport</token>
     <import>macros.xml</import>
-    <import>macros_autotest.xml</import>
-    <import>macros_test.xml</import>
   </macros>
   <expand macro="requirements"/>
   <expand macro="stdio"/>
@@ -18,8 +17,13 @@
 ## Preprocessing
 mkdir in_cm &&
 ln -s '$in_cm' 'in_cm/${re.sub("[^\w\-_]", "_", $in_cm.element_identifier)}.$gxy2omsext($in_cm.ext)' &&
-mkdir in_mzml &&
-${ ' '.join(["ln -s '%s' 'in_mzml/%s.%s' &&" % (_, re.sub('[^\w\-_]', '_', _.element_identifier), $gxy2omsext(_.ext)) for _ in $in_mzml if _]) }
+mkdir in_mzml_cond.in_mzml &&
+#if $in_mzml_cond.in_mzml_select == "no"
+mkdir ${' '.join(["'in_mzml_cond.in_mzml/%s'" % (i) for i, f in enumerate($in_mzml_cond.in_mzml) if f])} && 
+${' '.join(["ln -s '%s' 'in_mzml_cond.in_mzml/%s/%s.%s' && " % (f, i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($in_mzml_cond.in_mzml) if f])}
+#else
+ln -s '$in_mzml_cond.in_mzml' 'in_mzml_cond.in_mzml/${re.sub("[^\w\-_]", "_", $in_mzml_cond.in_mzml.element_identifier)}.$gxy2omsext($in_mzml_cond.in_mzml.ext)' &&
+#end if
 mkdir out &&
 
 ## Main program call
@@ -31,7 +35,11 @@
 -in_cm
 'in_cm/${re.sub("[^\w\-_]", "_", $in_cm.element_identifier)}.$gxy2omsext($in_cm.ext)'
 -in_mzml
-${' '.join(["'in_mzml/%s.%s'"%(re.sub('[^\w\-_]', '_', _.element_identifier), $gxy2omsext(_.ext)) for _ in $in_mzml if _])}
+#if $in_mzml_cond.in_mzml_select == "no"
+${' '.join(["'in_mzml_cond.in_mzml/%s/%s.%s'"%(i, re.sub('[^\w\-_]', '_', f.element_identifier), $gxy2omsext(f.ext)) for i, f in enumerate($in_mzml_cond.in_mzml) if f])}
+#else
+'in_mzml_cond.in_mzml/${re.sub("[^\w\-_]", "_", $in_mzml_cond.in_mzml.element_identifier)}.$gxy2omsext($in_mzml_cond.in_mzml.ext)'
+#end if
 -out
 'out/output.${gxy2omsext("mgf")}'
 
@@ -45,22 +53,33 @@
     <configfile name="hardcoded_json"><![CDATA[{"log": "log.txt", "threads": "\${GALAXY_SLOTS:-1}", "no_progress": true}]]></configfile>
   </configfiles>
   <inputs>
-    <param name="in_cm" argument="-in_cm" type="data" format="consensusxml" optional="false" label="input file containing consensus elements with 'peptide' annotations" help=" select consensusxml data sets(s)"/>
-    <param name="in_mzml" argument="-in_mzml" type="data" format="mzml" multiple="true" optional="false" label="original mzml files containing ms/ms spectrum information" help=" select mzml data sets(s)"/>
-    <param name="output_type" argument="-output_type" display="radio" type="select" optional="false" label="specificity of mgf output information" help="">
-      <option value="full_spectra" selected="true">full_spectra</option>
+    <param argument="-in_cm" type="data" format="consensusxml" optional="false" label="Input consensusXML file containing only consensusElements with &quot;peptide&quot; annotations" help=" select consensusxml data sets(s)"/>
+    <conditional name="in_mzml_cond">
+      <param name="in_mzml_select" type="select" label="Run tool in batch mode for -in_mzml">
+        <option value="no">No: process all datasets jointly</option>
+        <option value="yes">Yes: process each dataset in an independent job</option>
+      </param>
+      <when value="no">
+        <param argument="-in_mzml" type="data" format="mzml" multiple="true" optional="false" label="Original mzml files containing the ms2 spectra (aka peptide annotation)" help="Must be in order that the consensusXML file maps the original mzML files select mzml data sets(s)"/>
+      </when>
+      <when value="yes">
+        <param argument="-in_mzml" type="data" format="mzml" multiple="false" optional="false" label="Original mzml files containing the ms2 spectra (aka peptide annotation)" help="Must be in order that the consensusXML file maps the original mzML files select mzml data sets(s)"/>
+      </when>
+    </conditional>
+    <param argument="-output_type" type="select" optional="true" label="specificity of mgf output information" help="">
       <option value="merged_spectra">merged_spectra</option>
-      <expand macro="list_string_san"/>
+      <option value="most_intense" selected="true">most_intense</option>
+      <expand macro="list_string_san" name="output_type"/>
     </param>
-    <param name="precursor_mz_tolerance" argument="-precursor_mz_tolerance" type="float" optional="true" value="0.0001" label="Tolerance mz window for precursor selection" help=""/>
-    <param name="precursor_rt_tolerance" argument="-precursor_rt_tolerance" type="float" optional="true" value="5.0" label="Tolerance rt window for precursor selection" help=""/>
-    <section name="merged_spectra" title="Options for exporting mgf file with merged spectra per feature" help="" expanded="false">
-      <param name="cos_similarity" argument="-merged_spectra:cos_similarity" type="float" optional="true" value="0.95" label="Cosine similarity threshold for merged_spectra output" help=""/>
+    <param argument="-peptide_cutoff" type="integer" optional="true" min="-1" value="5" label="Number of most intense peptides to consider per consensus element; '-1' to consider all identifications" help=""/>
+    <param argument="-ms2_bin_size" type="float" optional="true" min="0.0" value="0.019999999552965" label="Bin size (Da) for fragment ions when merging ms2 scans" help=""/>
+    <section name="merged_spectra" title="Options for exporting mgf file with merged spectra per consensusElement" help="" expanded="false">
+      <param name="cos_similarity" argument="-merged_spectra:cos_similarity" type="float" optional="true" min="0.0" value="0.9" label="Cosine similarity threshold for merged_spectra output" help=""/>
     </section>
     <expand macro="adv_opts_macro">
-      <param name="force" argument="-force" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Overrides tool-specific checks" help=""/>
-      <param name="test" argument="-test" type="hidden" optional="true" value="False" label="Enables the test mode (needed for internal use only)" help="">
-        <expand macro="list_string_san"/>
+      <param argument="-force" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Overrides tool-specific checks" help=""/>
+      <param argument="-test" type="hidden" optional="true" value="False" label="Enables the test mode (needed for internal use only)" help="">
+        <expand macro="list_string_san" name="test"/>
       </param>
     </expand>
     <param name="OPTIONAL_OUTPUTS" type="select" optional="true" multiple="true" label="Optional outputs">
@@ -73,12 +92,83 @@
       <filter>OPTIONAL_OUTPUTS is not None and "ctd_out_FLAG" in OPTIONAL_OUTPUTS</filter>
     </data>
   </outputs>
-  <tests>
-    <expand macro="autotest_GNPSExport"/>
-    <expand macro="manutest_GNPSExport"/>
+  <tests><!-- TOPP_GNPSExport_1 -->
+    <test expect_num_outputs="2">
+      <section name="adv_opts">
+        <param name="force" value="false"/>
+        <param name="test" value="true"/>
+      </section>
+      <param name="in_cm" value="GNPSExport_cons1.consensusXML"/>
+      <conditional name="in_mzml_cond">
+        <param name="in_mzml" value="GNPSExport_mzml1.mzML,GNPSExport_mzml2.mzML"/>
+      </conditional>
+      <output name="out" file="GNPSExport_1_out.mgf" compare="sim_size" delta_frac="0.7" ftype="mgf"/>
+      <param name="output_type" value="most_intense"/>
+      <param name="peptide_cutoff" value="10"/>
+      <param name="ms2_bin_size" value="2.0"/>
+      <section name="merged_spectra">
+        <param name="cos_similarity" value="0.85"/>
+      </section>
+      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
+      <output name="ctd_out" ftype="xml">
+        <assert_contents>
+          <is_valid_xml/>
+        </assert_contents>
+      </output>
+    </test>
+    <!-- TOPP_GNPSExport_2 -->
+    <test expect_num_outputs="2">
+      <section name="adv_opts">
+        <param name="force" value="false"/>
+        <param name="test" value="true"/>
+      </section>
+      <param name="in_cm" value="GNPSExport_cons1.consensusXML"/>
+      <conditional name="in_mzml_cond">
+        <param name="in_mzml" value="GNPSExport_mzml1.mzML,GNPSExport_mzml2.mzML"/>
+      </conditional>
+      <output name="out" file="GNPSExport_2_out.mgf" compare="sim_size" delta_frac="0.7" ftype="mgf"/>
+      <param name="output_type" value="merged_spectra"/>
+      <param name="peptide_cutoff" value="10"/>
+      <param name="ms2_bin_size" value="2.0"/>
+      <section name="merged_spectra">
+        <param name="cos_similarity" value="0.85"/>
+      </section>
+      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
+      <output name="ctd_out" ftype="xml">
+        <assert_contents>
+          <is_valid_xml/>
+        </assert_contents>
+      </output>
+    </test>
+    <!-- TOPP_GNPSExport_3 -->
+    <test expect_num_outputs="2">
+      <section name="adv_opts">
+        <param name="force" value="false"/>
+        <param name="test" value="true"/>
+      </section>
+      <param name="in_cm" value="GNPSExport_cons1.consensusXML"/>
+      <conditional name="in_mzml_cond">
+        <param name="in_mzml" value="GNPSExport_mzml1.mzML,GNPSExport_mzml2.mzML"/>
+      </conditional>
+      <output name="out" file="GNPSExport_3_out.mgf" compare="sim_size" delta_frac="0.7" ftype="mgf"/>
+      <param name="output_type" value="most_intense"/>
+      <param name="peptide_cutoff" value="10"/>
+      <param name="ms2_bin_size" value="0.02"/>
+      <section name="merged_spectra">
+        <param name="cos_similarity" value="0.85"/>
+      </section>
+      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG"/>
+      <output name="ctd_out" ftype="xml">
+        <assert_contents>
+          <is_valid_xml/>
+        </assert_contents>
+      </output>
+    </test>
   </tests>
-  <help><![CDATA[Tool to export consensus features into MGF format
+  <help><![CDATA[Tool to export representative consensus MS/MS scan per consensusElement into a .MGF file format.
+See the documentation on https://ccms-ucsd.github.io/GNPSDocumentation/featurebasedmolecularnetworking-with-openms
 
-]]></help>
+
+For more information, visit http://www.openms.de/doxygen/release/2.8.0/html/TOPP_GNPSExport.html]]></help>
   <expand macro="references"/>
 </tool>