diff SpectraMerger.xml @ 9:bf529c279902 draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit ddf41e8bda1ba065f5cdec98e93dee8165ffc1b9"
author galaxyp
date Thu, 03 Sep 2020 16:20:00 +0000
parents 106130886208
children e08b7d2880f4
line wrap: on
line diff
--- a/SpectraMerger.xml	Fri May 17 10:18:51 2019 -0400
+++ b/SpectraMerger.xml	Thu Sep 03 16:20:00 2020 +0000
@@ -1,177 +1,130 @@
 <?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: [Signal processing and preprocessing]-->
-<tool id="SpectraMerger" name="SpectraMerger" version="2.3.0">
+<tool id="SpectraMerger" name="SpectraMerger" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@" profile="20.05">
   <description>Merges spectra (each MS level separately), increasing S/N ratios.</description>
   <macros>
     <token name="@EXECUTABLE@">SpectraMerger</token>
     <import>macros.xml</import>
+    <import>macros_autotest.xml</import>
+    <import>macros_test.xml</import>
   </macros>
-  <expand macro="references"/>
+  <expand macro="requirements"/>
   <expand macro="stdio"/>
-  <expand macro="requirements"/>
-  <command detect_errors="aggressive"><![CDATA[SpectraMerger
+  <command detect_errors="exit_code"><![CDATA[@QUOTE_FOO@
+@EXT_FOO@
+#import re
+
+## Preprocessing
+mkdir in &&
+ln -s '$in' 'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)' &&
+mkdir out &&
+
+## Main program call
 
-#if $param_in:
-  -in $param_in
-#end if
-#if $param_out:
-  -out $param_out
-#end if
-#if $param_merging_method:
-  -merging_method
-  #if " " in str($param_merging_method):
-    "$param_merging_method"
-  #else
-    $param_merging_method
-  #end if
-#end if
-#if $param_algorithm_average_gaussian_spectrum_type:
-  -algorithm:average_gaussian:spectrum_type
-  #if " " in str($param_algorithm_average_gaussian_spectrum_type):
-    "$param_algorithm_average_gaussian_spectrum_type"
-  #else
-    $param_algorithm_average_gaussian_spectrum_type
-  #end if
-#end if
-#if $param_algorithm_average_gaussian_ms_level:
-  -algorithm:average_gaussian:ms_level $param_algorithm_average_gaussian_ms_level
-#end if
-#if $param_algorithm_average_gaussian_rt_FWHM:
-  -algorithm:average_gaussian:rt_FWHM $param_algorithm_average_gaussian_rt_FWHM
-#end if
-#if $param_algorithm_average_tophat_spectrum_type:
-  -algorithm:average_tophat:spectrum_type
-  #if " " in str($param_algorithm_average_tophat_spectrum_type):
-    "$param_algorithm_average_tophat_spectrum_type"
-  #else
-    $param_algorithm_average_tophat_spectrum_type
-  #end if
-#end if
-#if $param_algorithm_average_tophat_ms_level:
-  -algorithm:average_tophat:ms_level $param_algorithm_average_tophat_ms_level
-#end if
-#if $param_algorithm_average_tophat_rt_range:
-  -algorithm:average_tophat:rt_range $param_algorithm_average_tophat_rt_range
-#end if
-#if $param_algorithm_average_tophat_rt_unit:
-  -algorithm:average_tophat:rt_unit
-  #if " " in str($param_algorithm_average_tophat_rt_unit):
-    "$param_algorithm_average_tophat_rt_unit"
-  #else
-    $param_algorithm_average_tophat_rt_unit
-  #end if
-#end if
+set -o pipefail &&
+@EXECUTABLE@ -write_ctd ./ &&
+python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hardcoded_json' &&
+@EXECUTABLE@ -ini @EXECUTABLE@.ctd
+-in
+'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)'
+-out
+'out/output.${gxy2omsext("mzml")}'
 
-#if $rep_param_algorithm_block_method_ms_levels:
--algorithm:block_method:ms_levels
-  #for token in $rep_param_algorithm_block_method_ms_levels:
-    #if " " in str(token):
-      "$token.param_algorithm_block_method_ms_levels"
-    #else
-      $token.param_algorithm_block_method_ms_levels
-    #end if
-  #end for
-#end if
-#if $param_algorithm_block_method_rt_block_size:
-  -algorithm:block_method:rt_block_size $param_algorithm_block_method_rt_block_size
-#end if
-#if $param_algorithm_block_method_rt_max_length:
-  -algorithm:block_method:rt_max_length $param_algorithm_block_method_rt_max_length
-#end if
-#if $param_algorithm_precursor_method_mz_tolerance:
-  -algorithm:precursor_method:mz_tolerance $param_algorithm_precursor_method_mz_tolerance
-#end if
-#if $param_algorithm_precursor_method_rt_tolerance:
-  -algorithm:precursor_method:rt_tolerance $param_algorithm_precursor_method_rt_tolerance
-#end if
-#if $adv_opts.adv_opts_selector=='advanced':
-    #if $adv_opts.param_force:
-  -force
-#end if
-    #if $adv_opts.param_algorithm_mz_binning_width:
-  -algorithm:mz_binning_width $adv_opts.param_algorithm_mz_binning_width
-#end if
-    #if $adv_opts.param_algorithm_mz_binning_width_unit:
-  -algorithm:mz_binning_width_unit
-  #if " " in str($adv_opts.param_algorithm_mz_binning_width_unit):
-    "$adv_opts.param_algorithm_mz_binning_width_unit"
-  #else
-    $adv_opts.param_algorithm_mz_binning_width_unit
-  #end if
-#end if
-    #if $adv_opts.param_algorithm_sort_blocks:
-  -algorithm:sort_blocks
-  #if " " in str($adv_opts.param_algorithm_sort_blocks):
-    "$adv_opts.param_algorithm_sort_blocks"
-  #else
-    $adv_opts.param_algorithm_sort_blocks
-  #end if
-#end if
-    #if $adv_opts.param_algorithm_average_gaussian_cutoff:
-  -algorithm:average_gaussian:cutoff $adv_opts.param_algorithm_average_gaussian_cutoff
-#end if
-#end if
-]]></command>
+## Postprocessing
+&& mv 'out/output.${gxy2omsext("mzml")}' '$out'
+#if "ctd_out_FLAG" in $OPTIONAL_OUTPUTS
+  && mv '@EXECUTABLE@.ctd' '$ctd_out'
+#end if]]></command>
+  <configfiles>
+    <inputs name="args_json" data_style="paths"/>
+    <configfile name="hardcoded_json"><![CDATA[{"log": "log.txt", "threads": "\${GALAXY_SLOTS:-1}", "no_progress": true}]]></configfile>
+  </configfiles>
   <inputs>
-    <param name="param_in" type="data" format="mzml" optional="False" label="Input mzML file" help="(-in) "/>
-    <param name="param_merging_method" display="radio" type="select" optional="False" value="average_gaussian" label="Method of merging which should be used" help="(-merging_method) ">
+    <param name="in" argument="-in" type="data" format="mzml" optional="false" label="Input mzML file" help=" select mzml data sets(s)"/>
+    <param name="merging_method" argument="-merging_method" display="radio" type="select" optional="false" label="Method of merging which should be used" help="">
       <option value="average_gaussian" selected="true">average_gaussian</option>
       <option value="average_tophat">average_tophat</option>
       <option value="precursor_method">precursor_method</option>
       <option value="block_method">block_method</option>
-    </param>
-    <param name="param_algorithm_average_gaussian_spectrum_type" display="radio" type="select" optional="False" value="automatic" label="Spectrum type of the MS level to be averaged" help="(-spectrum_type) ">
-      <option value="profile">profile</option>
-      <option value="centroid">centroid</option>
-      <option value="automatic" selected="true">automatic</option>
-    </param>
-    <param name="param_algorithm_average_gaussian_ms_level" type="integer" min="1" optional="True" value="1" label="Average spectra of this level" help="(-ms_level) All other spectra remain unchanged"/>
-    <param name="param_algorithm_average_gaussian_rt_FWHM" type="float" min="0.0" max="1e+11" optional="True" value="5.0" label="FWHM of Gauss curve in seconds to be averaged ove" help="(-rt_FWHM) "/>
-    <param name="param_algorithm_average_tophat_spectrum_type" display="radio" type="select" optional="False" value="automatic" label="Spectrum type of the MS level to be averaged" help="(-spectrum_type) ">
-      <option value="profile">profile</option>
-      <option value="centroid">centroid</option>
-      <option value="automatic" selected="true">automatic</option>
-    </param>
-    <param name="param_algorithm_average_tophat_ms_level" type="integer" min="1" optional="True" value="1" label="Average spectra of this level" help="(-ms_level) All other spectra remain unchanged"/>
-    <param name="param_algorithm_average_tophat_rt_range" type="float" min="0.0" max="1e+11" optional="True" value="5.0" label="RT range to be averaged over, i.e" help="(-rt_range) +/-(RT range)/2 from each spectrum"/>
-    <param name="param_algorithm_average_tophat_rt_unit" display="radio" type="select" optional="False" value="scans" label="Unit for RT range" help="(-rt_unit) ">
-      <option value="scans" selected="true">scans</option>
-      <option value="seconds">seconds</option>
+      <expand macro="list_string_san"/>
     </param>
-    <repeat name="rep_param_algorithm_block_method_ms_levels" min="0" max="1" title="param_algorithm_block_method_ms_levels">
-      <param name="param_algorithm_block_method_ms_levels" type="text" min="1" optional="True" size="30" value="1" label="Merge spectra of this level" help="(-ms_levels) All spectra with other MS levels remain untouched">
-        <sanitizer>
-          <valid initial="string.printable">
-            <remove value="'"/>
-            <remove value="&quot;"/>
-          </valid>
-        </sanitizer>
-      </param>
-    </repeat>
-    <param name="param_algorithm_block_method_rt_block_size" type="integer" min="1" optional="True" value="5" label="Maximum number of scans to be summed up" help="(-rt_block_size) "/>
-    <param name="param_algorithm_block_method_rt_max_length" type="float" min="0.0" max="1e+11" optional="True" value="0.0" label="Maximum RT size of the block in seconds (0.0 = no size restriction)" help="(-rt_max_length) "/>
-    <param name="param_algorithm_precursor_method_mz_tolerance" type="float" min="0.0" optional="True" value="0.0001" label="Max m/z distance of the precursor entries of two spectra to be merged in [Da]" help="(-mz_tolerance) "/>
-    <param name="param_algorithm_precursor_method_rt_tolerance" type="float" min="0.0" optional="True" value="5.0" label="Max RT distance of the precursor entries of two spectra to be merged in [s]" help="(-rt_tolerance) "/>
-    <expand macro="advanced_options">
-      <param name="param_force" display="radio" type="boolean" truevalue="-force" falsevalue="" checked="false" optional="True" label="Overwrite tool specific checks" help="(-force) "/>
-      <param name="param_algorithm_mz_binning_width" type="float" min="0.0" optional="True" value="5.0" label="minimum m/z distance for two data points (profile data) or peaks (centroided data) to be considered distinct" help="(-mz_binning_width) Closer data points or peaks will be merged"/>
-      <param name="param_algorithm_mz_binning_width_unit" display="radio" type="select" optional="False" value="ppm" label="Unit in which the distance between two data points or peaks is given" help="(-mz_binning_width_unit) ">
+    <section name="algorithm" title="Algorithm section for merging spectra" help="" expanded="false">
+      <param name="mz_binning_width" argument="-algorithm:mz_binning_width" type="float" optional="true" min="0.0" value="5.0" label="minimum m/z distance for two data points (profile data) or peaks (centroided data) to be considered distinct" help="Closer data points or peaks will be merged"/>
+      <param name="mz_binning_width_unit" argument="-algorithm:mz_binning_width_unit" display="radio" type="select" optional="false" label="Unit in which the distance between two data points or peaks is given" help="">
         <option value="Da">Da</option>
         <option value="ppm" selected="true">ppm</option>
+        <expand macro="list_string_san"/>
       </param>
-      <param name="param_algorithm_sort_blocks" display="radio" type="select" optional="False" value="RT_ascending" label="Sort blocks by &lt;?&gt; before merging them (useful for precursor order)" help="(-sort_blocks) ">
+      <param name="sort_blocks" argument="-algorithm:sort_blocks" display="radio" type="select" optional="false" label="Sort blocks by &lt;?&gt; before merging them (useful for precursor order)" help="">
         <option value="RT_ascending" selected="true">RT_ascending</option>
         <option value=" RT_descending"> RT_descending</option>
+        <expand macro="list_string_san"/>
       </param>
-      <param name="param_algorithm_average_gaussian_cutoff" type="float" min="0.0" max="1.0" optional="True" value="0.01" label="Intensity cutoff for Gaussian" help="(-cutoff) The Gaussian RT profile decreases from 1 at its apex to 0 at infinity. Spectra for which the intensity of the Gaussian drops below the cutoff do not contribute to the average"/>
+      <section name="average_gaussian" title="" help="" expanded="false">
+        <param name="spectrum_type" argument="-algorithm:average_gaussian:spectrum_type" display="radio" type="select" optional="false" label="Spectrum type of the MS level to be averaged" help="">
+          <option value="profile">profile</option>
+          <option value="centroid">centroid</option>
+          <option value="automatic" selected="true">automatic</option>
+          <expand macro="list_string_san"/>
+        </param>
+        <param name="ms_level" argument="-algorithm:average_gaussian:ms_level" type="integer" optional="true" min="1" value="1" label="Average spectra of this level" help="All other spectra remain unchanged"/>
+        <param name="rt_FWHM" argument="-algorithm:average_gaussian:rt_FWHM" type="float" optional="true" min="0.0" max="100000000000.0" value="5.0" label="FWHM of Gauss curve in seconds to be averaged ove" help=""/>
+        <param name="cutoff" argument="-algorithm:average_gaussian:cutoff" type="float" optional="true" min="0.0" max="1.0" value="0.01" label="Intensity cutoff for Gaussian" help="The Gaussian RT profile decreases from 1 at its apex to 0 at infinity. Spectra for which the intensity of the Gaussian drops below the cutoff do not contribute to the average"/>
+      </section>
+      <section name="average_tophat" title="" help="" expanded="false">
+        <param name="spectrum_type" argument="-algorithm:average_tophat:spectrum_type" display="radio" type="select" optional="false" label="Spectrum type of the MS level to be averaged" help="">
+          <option value="profile">profile</option>
+          <option value="centroid">centroid</option>
+          <option value="automatic" selected="true">automatic</option>
+          <expand macro="list_string_san"/>
+        </param>
+        <param name="ms_level" argument="-algorithm:average_tophat:ms_level" type="integer" optional="true" min="1" value="1" label="Average spectra of this level" help="All other spectra remain unchanged"/>
+        <param name="rt_range" argument="-algorithm:average_tophat:rt_range" type="float" optional="true" min="0.0" max="100000000000.0" value="5.0" label="RT range to be averaged ove" help="i.e. +/-(RT range)/2 from each spectrum"/>
+        <param name="rt_unit" argument="-algorithm:average_tophat:rt_unit" display="radio" type="select" optional="false" label="Unit for RT range" help="">
+          <option value="scans" selected="true">scans</option>
+          <option value="seconds">seconds</option>
+          <expand macro="list_string_san"/>
+        </param>
+      </section>
+      <section name="block_method" title="" help="" expanded="false">
+        <param name="ms_levels" argument="-algorithm:block_method:ms_levels" type="text" optional="true" value="1" label="Merge spectra of this level" help="All spectra with other MS levels remain untouched (space separated list, in order to allow for spaces in list items surround them by single quotes)">
+          <expand macro="list_integer_valsan">
+            <validator type="expression" message="a space separated list of integer values in the range 1: is required"><![CDATA[len(value.split(' ')) == len([_ for _ in value.split(' ') if  1 <= int(_)])
+]]></validator>
+          </expand>
+        </param>
+        <param name="rt_block_size" argument="-algorithm:block_method:rt_block_size" type="integer" optional="true" min="1" value="5" label="Maximum number of scans to be summed up" help=""/>
+        <param name="rt_max_length" argument="-algorithm:block_method:rt_max_length" type="float" optional="true" min="0.0" max="100000000000.0" value="0.0" label="Maximum RT size of the block in seconds (0.0 = no size restriction)" help=""/>
+      </section>
+      <section name="precursor_method" title="" help="" expanded="false">
+        <param name="mz_tolerance" argument="-algorithm:precursor_method:mz_tolerance" type="float" optional="true" min="0.0" value="0.0001" label="Max m/z distance of the precursor entries of two spectra to be merged in [Da]" help=""/>
+        <param name="rt_tolerance" argument="-algorithm:precursor_method:rt_tolerance" type="float" optional="true" min="0.0" value="5.0" label="Max RT distance of the precursor entries of two spectra to be merged in [s]" help=""/>
+      </section>
+    </section>
+    <expand macro="adv_opts_macro">
+      <param name="force" argument="-force" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Overwrite 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>
     </expand>
+    <param name="OPTIONAL_OUTPUTS" type="select" multiple="true" label="Optional outputs" optional="true">
+      <option value="ctd_out_FLAG">Output used ctd (ini) configuration file</option>
+    </param>
   </inputs>
   <outputs>
-    <data name="param_out" format="mzml"/>
+    <data name="out" label="${tool.name} on ${on_string}: out" format="mzml"/>
+    <data name="ctd_out" format="xml" label="${tool.name} on ${on_string}: ctd">
+      <filter>OPTIONAL_OUTPUTS is not None and "ctd_out_FLAG" in OPTIONAL_OUTPUTS</filter>
+    </data>
   </outputs>
-  <help>Merges spectra (each MS level separately), increasing S/N ratios.
+  <tests>
+    <expand macro="autotest_SpectraMerger"/>
+    <expand macro="manutest_SpectraMerger"/>
+  </tests>
+  <help><![CDATA[Merges spectra (each MS level separately), increasing S/N ratios.
 
 
-For more information, visit https://abibuilder.informatik.uni-tuebingen.de/archive/openms/Documentation/release/2.3.0/html/TOPP_SpectraMerger.html</help>
+For more information, visit http://www.openms.de/documentation/TOPP_SpectraMerger.html]]></help>
+  <expand macro="references"/>
 </tool>