diff MapRTTransformer.xml @ 9:fd6de4cdb9e9 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:22:43 +0000
parents 0fc718253aab
children 88ac532206c7
line wrap: on
line diff
--- a/MapRTTransformer.xml	Fri May 17 10:07:30 2019 -0400
+++ b/MapRTTransformer.xml	Thu Sep 03 16:22:43 2020 +0000
@@ -1,165 +1,186 @@
 <?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: [Map Alignment]-->
-<tool id="MapRTTransformer" name="MapRTTransformer" version="2.3.0">
+<tool id="MapRTTransformer" name="MapRTTransformer" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@" profile="20.05">
   <description>Applies retention time transformations to maps.</description>
   <macros>
     <token name="@EXECUTABLE@">MapRTTransformer</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[MapRTTransformer
+  <command detect_errors="exit_code"><![CDATA[@QUOTE_FOO@
+@EXT_FOO@
+#import re
 
-#if $param_in:
-  -in $param_in
-#end if
-#if $param_out:
-  -out $param_out
-#end if
-#if $param_trafo_in:
-  -trafo_in $param_trafo_in
+## Preprocessing
+#if $in:
+  mkdir in &&
+  ln -s '$in' 'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)' &&
 #end if
-#if $param_trafo_out:
-  -trafo_out $param_trafo_out
-#end if
-#if $param_invert:
-  -invert
+#if "out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  mkdir out &&
 #end if
-#if $param_store_original_rt:
-  -store_original_rt
-#end if
-#if $param_model_type:
-  -model:type
-  #if " " in str($param_model_type):
-    "$param_model_type"
-  #else
-    $param_model_type
-  #end if
+mkdir trafo_in &&
+ln -s '$trafo_in' 'trafo_in/${re.sub("[^\w\-_]", "_", $trafo_in.element_identifier)}.$gxy2omsext($trafo_in.ext)' &&
+#if "trafo_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  mkdir trafo_out &&
 #end if
-#if $param_model_linear_symmetric_regression:
-  -model:linear:symmetric_regression
-#end if
-#if $param_model_b_spline_wavelength:
-  -model:b_spline:wavelength $param_model_b_spline_wavelength
+
+## Main program call
+
+set -o pipefail &&
+@EXECUTABLE@ -write_ctd ./ &&
+python3 '$__tool_directory__/fill_ctd.py' '@EXECUTABLE@.ctd' '$args_json' '$hardcoded_json' &&
+@EXECUTABLE@ -ini @EXECUTABLE@.ctd
+#if $in:
+  -in
+  'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)'
 #end if
-#if $param_model_b_spline_num_nodes:
-  -model:b_spline:num_nodes $param_model_b_spline_num_nodes
-#end if
-#if $param_model_b_spline_extrapolate:
-  -model:b_spline:extrapolate
-  #if " " in str($param_model_b_spline_extrapolate):
-    "$param_model_b_spline_extrapolate"
-  #else
-    $param_model_b_spline_extrapolate
-  #end if
+#if "out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  -out
+  'out/output.${in.ext}'
 #end if
-#if $param_model_b_spline_boundary_condition:
-  -model:b_spline:boundary_condition $param_model_b_spline_boundary_condition
-#end if
-#if $param_model_lowess_span:
-  -model:lowess:span $param_model_lowess_span
-#end if
-#if $param_model_lowess_num_iterations:
-  -model:lowess:num_iterations $param_model_lowess_num_iterations
+-trafo_in
+'trafo_in/${re.sub("[^\w\-_]", "_", $trafo_in.element_identifier)}.$gxy2omsext($trafo_in.ext)'
+#if "trafo_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  -trafo_out
+  'trafo_out/output.${gxy2omsext("trafoxml")}'
 #end if
-#if $param_model_lowess_delta:
-  -model:lowess:delta $param_model_lowess_delta
+#if len(str($OPTIONAL_OUTPUTS).split(',')) == 0
+  | tee '$stdout'
 #end if
-#if $param_model_lowess_interpolation_type:
-  -model:lowess:interpolation_type
-  #if " " in str($param_model_lowess_interpolation_type):
-    "$param_model_lowess_interpolation_type"
-  #else
-    $param_model_lowess_interpolation_type
-  #end if
+
+## Postprocessing
+#if "out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  && mv 'out/output.${in.ext}' '$out'
+#end if
+#if "trafo_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  && mv 'trafo_out/output.${gxy2omsext("trafoxml")}' '$trafo_out'
 #end if
-#if $param_model_lowess_extrapolation_type:
-  -model:lowess:extrapolation_type
-  #if " " in str($param_model_lowess_extrapolation_type):
-    "$param_model_lowess_extrapolation_type"
-  #else
-    $param_model_lowess_extrapolation_type
-  #end if
-#end if
-#if $param_model_interpolated_interpolation_type:
-  -model:interpolated:interpolation_type
-  #if " " in str($param_model_interpolated_interpolation_type):
-    "$param_model_interpolated_interpolation_type"
-  #else
-    $param_model_interpolated_interpolation_type
-  #end if
-#end if
-#if $param_model_interpolated_extrapolation_type:
-  -model:interpolated:extrapolation_type
-  #if " " in str($param_model_interpolated_extrapolation_type):
-    "$param_model_interpolated_extrapolation_type"
-  #else
-    $param_model_interpolated_extrapolation_type
-  #end if
-#end if
-#if $adv_opts.adv_opts_selector=='advanced':
-    #if $adv_opts.param_force:
-  -force
-#end if
-#end if
-]]></command>
+#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,featurexml,consensusxml,idxml" optional="True" label="Input file to transform (separated by blanks)" help="(-in) "/>
-    <param name="param_trafo_in" type="data" format="trafoxml" optional="False" label="Transformation to apply" help="(-trafo_in) "/>
-    <param name="param_invert" display="radio" type="boolean" truevalue="-invert" falsevalue="" checked="false" optional="True" label="Invert transformation (approximatively) before applying it" help="(-invert) "/>
-    <param name="param_store_original_rt" display="radio" type="boolean" truevalue="-store_original_rt" falsevalue="" checked="false" optional="True" label="Store the original retention times (before transformation) as meta data in the output file" help="(-store_original_rt) "/>
-    <param name="param_model_type" type="select" optional="False" value="none" label="Type of model" help="(-type) ">
-      <option value="none" selected="true">none</option>
-      <option value="linear">linear</option>
-      <option value="b_spline">b_spline</option>
-      <option value="lowess">lowess</option>
-      <option value="interpolated">interpolated</option>
-    </param>
-    <param name="param_model_linear_symmetric_regression" display="radio" type="boolean" truevalue="-model:linear:symmetric_regression" falsevalue="" checked="false" optional="True" label="Perform linear regression on 'y - x' vs" help="(-symmetric_regression) 'y + x', instead of on 'y' vs. 'x'"/>
-    <param name="param_model_b_spline_wavelength" type="float" min="0.0" optional="True" value="0.0" label="Determines the amount of smoothing by setting the number of nodes for the B-spline" help="(-wavelength) The number is chosen so that the spline approximates a low-pass filter with this cutoff wavelength. The wavelength is given in the same units as the data; a higher value means more smoothing. '0' sets the number of nodes to twice the number of input points"/>
-    <param name="param_model_b_spline_num_nodes" type="integer" min="0" optional="True" value="5" label="Number of nodes for B-spline fitting" help="(-num_nodes) Overrides 'wavelength' if set (to two or greater). A lower value means more smoothing"/>
-    <param name="param_model_b_spline_extrapolate" display="radio" type="select" optional="False" value="linear" label="Method to use for extrapolation beyond the original data range" help="(-extrapolate) 'linear': Linear extrapolation using the slope of the B-spline at the corresponding endpoint. 'b_spline': Use the B-spline (as for interpolation). 'constant': Use the constant value of the B-spline at the corresponding endpoint. 'global_linear': Use a linear fit through the data (which will most probably introduce discontinuities at the ends of the data range)">
-      <option value="linear" selected="true">linear</option>
-      <option value="b_spline">b_spline</option>
-      <option value="constant">constant</option>
-      <option value="global_linear">global_linear</option>
+    <param name="in" argument="-in" type="data" format="consensusxml,featurexml,idxml,mzml" optional="true" label="Input file to transform (separated by blanks)" help=" select consensusxml,featurexml,idxml,mzml data sets(s)"/>
+    <param name="trafo_in" argument="-trafo_in" type="data" format="trafoxml" optional="false" label="Transformation to apply" help=" select trafoxml data sets(s)"/>
+    <param name="invert" argument="-invert" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Invert transformation (approximatively) before applying it" help=""/>
+    <param name="store_original_rt" argument="-store_original_rt" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Store the original retention times (before transformation) as meta data in the output file" help=""/>
+    <section name="model" title="Options to control the modeling of retention time transformations from data" help="" expanded="false">
+      <param name="type" argument="-model:type" type="select" optional="false" label="Type of model" help="">
+        <option value="none" selected="true">none</option>
+        <option value="linear">linear</option>
+        <option value="b_spline">b_spline</option>
+        <option value="lowess">lowess</option>
+        <option value="interpolated">interpolated</option>
+        <expand macro="list_string_san"/>
+      </param>
+      <section name="linear" title="Parameters for 'linear' model" help="" expanded="false">
+        <param name="symmetric_regression" argument="-model:linear:symmetric_regression" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Perform linear regression on 'y - x' vs" help="'y + x', instead of on 'y' vs. 'x'"/>
+        <param name="x_weight" argument="-model:linear:x_weight" display="radio" type="select" optional="true" label="Weight x values" help="">
+          <option value="">default (nothing chosen)</option>
+          <option value="1/x">1/x</option>
+          <option value="1/x2">1/x2</option>
+          <option value="ln(x)">ln(x)</option>
+          <option value=""></option>
+          <expand macro="list_string_san"/>
+        </param>
+        <param name="y_weight" argument="-model:linear:y_weight" display="radio" type="select" optional="true" label="Weight y values" help="">
+          <option value="">default (nothing chosen)</option>
+          <option value="1/y">1/y</option>
+          <option value="1/y2">1/y2</option>
+          <option value="ln(y)">ln(y)</option>
+          <option value=""></option>
+          <expand macro="list_string_san"/>
+        </param>
+        <param name="x_datum_min" argument="-model:linear:x_datum_min" type="float" optional="true" value="1e-15" label="Minimum x value" help=""/>
+        <param name="x_datum_max" argument="-model:linear:x_datum_max" type="float" optional="true" value="1000000000000000.0" label="Maximum x value" help=""/>
+        <param name="y_datum_min" argument="-model:linear:y_datum_min" type="float" optional="true" value="1e-15" label="Minimum y value" help=""/>
+        <param name="y_datum_max" argument="-model:linear:y_datum_max" type="float" optional="true" value="1000000000000000.0" label="Maximum y value" help=""/>
+      </section>
+      <section name="b_spline" title="Parameters for 'b_spline' model" help="" expanded="false">
+        <param name="wavelength" argument="-model:b_spline:wavelength" type="float" optional="true" min="0.0" value="0.0" label="Determines the amount of smoothing by setting the number of nodes for the B-spline" help="The number is chosen so that the spline approximates a low-pass filter with this cutoff wavelength. The wavelength is given in the same units as the data; a higher value means more smoothing. '0' sets the number of nodes to twice the number of input points"/>
+        <param name="num_nodes" argument="-model:b_spline:num_nodes" type="integer" optional="true" min="0" value="5" label="Number of nodes for B-spline fitting" help="Overrides 'wavelength' if set (to two or greater). A lower value means more smoothing"/>
+        <param name="extrapolate" argument="-model:b_spline:extrapolate" display="radio" type="select" optional="false" label="Method to use for extrapolation beyond the original data range" help="'linear': Linear extrapolation using the slope of the B-spline at the corresponding endpoint. 'b_spline': Use the B-spline (as for interpolation). 'constant': Use the constant value of the B-spline at the corresponding endpoint. 'global_linear': Use a linear fit through the data (which will most probably introduce discontinuities at the ends of the data range)">
+          <option value="linear" selected="true">linear</option>
+          <option value="b_spline">b_spline</option>
+          <option value="constant">constant</option>
+          <option value="global_linear">global_linear</option>
+          <expand macro="list_string_san"/>
+        </param>
+        <param name="boundary_condition" argument="-model:b_spline:boundary_condition" type="integer" optional="true" min="0" max="2" value="2" label="Boundary condition at B-spline endpoints: 0 (value zero), 1 (first derivative zero) or 2 (second derivative zero)" help=""/>
+      </section>
+      <section name="lowess" title="Parameters for 'lowess' model" help="" expanded="false">
+        <param name="span" argument="-model:lowess:span" type="float" optional="true" min="0.0" max="1.0" value="0.666666666666667" label="Fraction of datapoints (f) to use for each local regression (determines the amount of smoothing)" help="Choosing this parameter in the range .2 to .8 usually results in a good fit"/>
+        <param name="num_iterations" argument="-model:lowess:num_iterations" type="integer" optional="true" min="0" value="3" label="Number of robustifying iterations for lowess fitting" help=""/>
+        <param name="delta" argument="-model:lowess:delta" type="float" optional="true" value="-1.0" label="Nonnegative parameter which may be used to save computations (recommended value is 0.01 of the range of the input" help="e.g. for data ranging from 1000 seconds to 2000 seconds, it could be set to 10). Setting a negative value will automatically do this"/>
+        <param name="interpolation_type" argument="-model:lowess:interpolation_type" display="radio" type="select" optional="false" label="Method to use for interpolation between datapoints computed by lowess" help="'linear': Linear interpolation. 'cspline': Use the cubic spline for interpolation. 'akima': Use an akima spline for interpolation">
+          <option value="linear">linear</option>
+          <option value="cspline" selected="true">cspline</option>
+          <option value="akima">akima</option>
+          <expand macro="list_string_san"/>
+        </param>
+        <param name="extrapolation_type" argument="-model:lowess:extrapolation_type" display="radio" type="select" optional="false" label="Method to use for extrapolation outside the data range" help="'two-point-linear': Uses a line through the first and last point to extrapolate. 'four-point-linear': Uses a line through the first and second point to extrapolate in front and and a line through the last and second-to-last point in the end. 'global-linear': Uses a linear regression to fit a line through all data points and use it for interpolation">
+          <option value="two-point-linear">two-point-linear</option>
+          <option value="four-point-linear" selected="true">four-point-linear</option>
+          <option value="global-linear">global-linear</option>
+          <expand macro="list_string_san"/>
+        </param>
+      </section>
+      <section name="interpolated" title="Parameters for 'interpolated' model" help="" expanded="false">
+        <param name="interpolation_type" argument="-model:interpolated:interpolation_type" display="radio" type="select" optional="false" label="Type of interpolation to apply" help="">
+          <option value="linear">linear</option>
+          <option value="cspline" selected="true">cspline</option>
+          <option value="akima">akima</option>
+          <expand macro="list_string_san"/>
+        </param>
+        <param name="extrapolation_type" argument="-model:interpolated:extrapolation_type" display="radio" type="select" optional="false" label="Type of extrapolation to apply: two-point-linear: use the first and last data point to build a single linear model, four-point-linear: build two linear models on both ends using the first two / last two points, global-linear: use all points to build a single linear model" help="Note that global-linear may not be continuous at the border">
+          <option value="two-point-linear" selected="true">two-point-linear</option>
+          <option value="four-point-linear">four-point-linear</option>
+          <option value="global-linear">global-linear</option>
+          <expand macro="list_string_san"/>
+        </param>
+      </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="false">
+      <option value="out_FLAG">out (Type of extrapolation to apply: two-point-linear: use the first and last data point to build a single linear model, four-point-linear: build two linear models on both ends using the first two / last two points, global-linear: use all points to build a single linear model)</option>
+      <option value="trafo_out_FLAG">trafo_out (Type of extrapolation to apply: two-point-linear: use the first and last data point to build a single linear model, four-point-linear: build two linear models on both ends using the first two / last two points, global-linear: use all points to build a single linear model)</option>
+      <option value="ctd_out_FLAG">Output used ctd (ini) configuration file</option>
     </param>
-    <param name="param_model_b_spline_boundary_condition" type="integer" min="0" max="2" optional="True" value="2" label="Boundary condition at B-spline endpoints: 0 (value zero), 1 (first derivative zero) or 2 (second derivative zero)" help="(-boundary_condition) "/>
-    <param name="param_model_lowess_span" type="float" min="0.0" max="1.0" optional="True" value="0.666666666667" label="Fraction of datapoints (f) to use for each local regression (determines the amount of smoothing)" help="(-span) Choosing this parameter in the range .2 to .8 usually results in a good fit"/>
-    <param name="param_model_lowess_num_iterations" type="integer" min="0" optional="True" value="3" label="Number of robustifying iterations for lowess fitting" help="(-num_iterations) "/>
-    <param name="param_model_lowess_delta" type="float" value="-1.0" label="Nonnegative parameter which may be used to save computations (recommended value is 0.01 of the range of the input," help="(-delta) e.g. for data ranging from 1000 seconds to 2000 seconds, it could be set to 10). Setting a negative value will automatically do this"/>
-    <param name="param_model_lowess_interpolation_type" display="radio" type="select" optional="False" value="cspline" label="Method to use for interpolation between datapoints computed by lowess" help="(-interpolation_type) 'linear': Linear interpolation. 'cspline': Use the cubic spline for interpolation. 'akima': Use an akima spline for interpolation">
-      <option value="linear">linear</option>
-      <option value="cspline" selected="true">cspline</option>
-      <option value="akima">akima</option>
-    </param>
-    <param name="param_model_lowess_extrapolation_type" display="radio" type="select" optional="False" value="four-point-linear" label="Method to use for extrapolation outside the data range" help="(-extrapolation_type) 'two-point-linear': Uses a line through the first and last point to extrapolate. 'four-point-linear': Uses a line through the first and second point to extrapolate in front and and a line through the last and second-to-last point in the end. 'global-linear': Uses a linear regression to fit a line through all data points and use it for interpolation">
-      <option value="two-point-linear">two-point-linear</option>
-      <option value="four-point-linear" selected="true">four-point-linear</option>
-      <option value="global-linear">global-linear</option>
-    </param>
-    <param name="param_model_interpolated_interpolation_type" display="radio" type="select" optional="False" value="cspline" label="Type of interpolation to apply" help="(-interpolation_type) ">
-      <option value="linear">linear</option>
-      <option value="cspline" selected="true">cspline</option>
-      <option value="akima">akima</option>
-    </param>
-    <param name="param_model_interpolated_extrapolation_type" display="radio" type="select" optional="False" value="two-point-linear" label="Type of extrapolation to apply: two-point-linear: use the first and last data point to build a single linear model, four-point-linear: build two linear models on both ends using the first two / last two points, global-linear: use all points to build a single linear model" help="(-extrapolation_type) Note that global-linear may not be continuous at the border">
-      <option value="two-point-linear" selected="true">two-point-linear</option>
-      <option value="four-point-linear">four-point-linear</option>
-      <option value="global-linear">global-linear</option>
-    </param>
-    <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) "/>
-    </expand>
   </inputs>
   <outputs>
-    <data name="param_out" metadata_source="param_in" format="input"/>
-    <data name="param_trafo_out" format="trafoxml"/>
+    <data name="out" label="${tool.name} on ${on_string}: out" format_source="in" metadata_source="in">
+      <filter>OPTIONAL_OUTPUTS is not None and "out_FLAG" in OPTIONAL_OUTPUTS</filter>
+    </data>
+    <data name="trafo_out" label="${tool.name} on ${on_string}: trafo_out" format="trafoxml">
+      <filter>OPTIONAL_OUTPUTS is not None and "trafo_out_FLAG" in OPTIONAL_OUTPUTS</filter>
+    </data>
+    <data name="stdout" format="txt" label="${tool.name} on ${on_string}: stdout">
+      <filter>OPTIONAL_OUTPUTS is None</filter>
+    </data>
+    <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>Applies retention time transformations to maps.
+  <tests>
+    <expand macro="autotest_MapRTTransformer"/>
+    <expand macro="manutest_MapRTTransformer"/>
+  </tests>
+  <help><![CDATA[Applies retention time transformations to maps.
 
 
-For more information, visit https://abibuilder.informatik.uni-tuebingen.de/archive/openms/Documentation/release/2.3.0/html/TOPP_MapRTTransformer.html</help>
+For more information, visit http://www.openms.de/documentation/TOPP_MapRTTransformer.html]]></help>
+  <expand macro="references"/>
 </tool>