diff InternalCalibration.xml @ 9:4682dcff7e2f 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:23:50 +0000
parents 6b0c27522bcd
children cca2b6c3ae61
line wrap: on
line diff
--- a/InternalCalibration.xml	Fri May 17 10:15:18 2019 -0400
+++ b/InternalCalibration.xml	Thu Sep 03 16:23:50 2020 +0000
@@ -1,151 +1,202 @@
 <?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="InternalCalibration" name="InternalCalibration" version="2.3.0">
+<tool id="InternalCalibration" name="InternalCalibration" version="@TOOL_VERSION@+galaxy@GALAXY_VERSION@" profile="20.05">
   <description>Applies an internal mass recalibration.</description>
   <macros>
     <token name="@EXECUTABLE@">InternalCalibration</token>
     <import>macros.xml</import>
+    <import>macros_autotest.xml</import>
+    <import>macros_test.xml</import>
   </macros>
-  <expand macro="references"/>
-  <expand macro="stdio"/>
   <expand macro="requirements"/>
-  <command detect_errors="aggressive"><![CDATA[InternalCalibration
+  <expand macro="stdio"/>
+  <command detect_errors="exit_code"><![CDATA[@QUOTE_FOO@
+@EXT_FOO@
+#import re
 
-#if $param_in:
-  -in $param_in
+## Preprocessing
+mkdir in &&
+ln -s '$in' 'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)' &&
+mkdir out &&
+#if $cal.id_in:
+  mkdir cal.id_in &&
+  ln -s '$cal.id_in' 'cal.id_in/${re.sub("[^\w\-_]", "_", $cal.id_in.element_identifier)}.$gxy2omsext($cal.id_in.ext)' &&
+#end if
+#if $cal.lock_in:
+  mkdir cal.lock_in &&
+  ln -s '$cal.lock_in' 'cal.lock_in/${re.sub("[^\w\-_]", "_", $cal.lock_in.element_identifier)}.$gxy2omsext($cal.lock_in.ext)' &&
+#end if
+#if "lock_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  mkdir cal_lock_out &&
+#end if
+#if "lock_fail_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  mkdir cal_lock_fail_out &&
+#end if
+#if "models_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  mkdir quality_control_models &&
+#end if
+#if "models_plot_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  mkdir quality_control_models_plot &&
+#end if
+#if "residuals_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  mkdir quality_control_residuals &&
+#end if
+#if "residuals_plot_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  mkdir quality_control_residuals_plot &&
 #end if
-#if $param_out:
-  -out $param_out
+
+## 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
+-in
+'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)'
+-out
+'out/output.${gxy2omsext("mzml")}'
+#if $cal.id_in:
+  -cal:id_in
+  'cal.id_in/${re.sub("[^\w\-_]", "_", $cal.id_in.element_identifier)}.$gxy2omsext($cal.id_in.ext)'
+#end if
+#if $cal.lock_in:
+  -cal:lock_in
+  'cal.lock_in/${re.sub("[^\w\-_]", "_", $cal.lock_in.element_identifier)}.$gxy2omsext($cal.lock_in.ext)'
+#end if
+#if "lock_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  -cal:lock_out
+  'cal_lock_out/output.${gxy2omsext("mzml")}'
 #end if
-#if $param_rscript_executable:
-  -rscript_executable $param_rscript_executable
+#if "lock_fail_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  -cal:lock_fail_out
+  'cal_lock_fail_out/output.${gxy2omsext("mzml")}'
+#end if
+#if "models_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  -quality_control:models
+  'quality_control_models/output.${gxy2omsext("csv")}'
 #end if
-#if $param_ppm_match_tolerance:
-  -ppm_match_tolerance $param_ppm_match_tolerance
+#if "models_plot_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  -quality_control:models_plot
+  'quality_control_models_plot/output.${gxy2omsext("png")}'
+#end if
+#if "residuals_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  -quality_control:residuals
+  'quality_control_residuals/output.${gxy2omsext("csv")}'
+#end if
+#if "residuals_plot_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  -quality_control:residuals_plot
+  'quality_control_residuals_plot/output.${gxy2omsext("png")}'
+#end if
+#if len(str($OPTIONAL_OUTPUTS).split(',')) == 0
+  | tee '$stdout'
 #end if
 
-#if $rep_param_ms_level:
--ms_level
-  #for token in $rep_param_ms_level:
-    #if " " in str(token):
-      "$token.param_ms_level"
-    #else
-      $token.param_ms_level
-    #end if
-  #end for
+## Postprocessing
+&& mv 'out/output.${gxy2omsext("mzml")}' '$out'
+#if "lock_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  && mv 'cal_lock_out/output.${gxy2omsext("mzml")}' '$cal_lock_out'
 #end if
-#if $param_RT_chunking:
-  -RT_chunking $param_RT_chunking
-#end if
-#if $param_cal_id_in:
-  -cal:id_in $param_cal_id_in
-#end if
-#if $param_cal_lock_in:
-  -cal:lock_in $param_cal_lock_in
-#end if
-#if $param_cal_lock_out:
-  -cal:lock_out $param_cal_lock_out
-#end if
-#if $param_cal_lock_fail_out:
-  -cal:lock_fail_out $param_cal_lock_fail_out
+#if "lock_fail_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  && mv 'cal_lock_fail_out/output.${gxy2omsext("mzml")}' '$cal_lock_fail_out'
 #end if
-#if $param_cal_lock_require_mono:
-  -cal:lock_require_mono
-#end if
-#if $param_cal_lock_require_iso:
-  -cal:lock_require_iso
+#if "models_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  && mv 'quality_control_models/output.${gxy2omsext("csv")}' '$quality_control_models'
 #end if
-#if $param_cal_model_type:
-  -cal:model_type
-  #if " " in str($param_cal_model_type):
-    "$param_cal_model_type"
-  #else
-    $param_cal_model_type
-  #end if
+#if "models_plot_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  && mv 'quality_control_models_plot/output.${gxy2omsext("png")}' '$quality_control_models_plot'
 #end if
-#if $param_RANSAC_enabled:
-  -RANSAC:enabled
-#end if
-#if $param_RANSAC_threshold:
-  -RANSAC:threshold $param_RANSAC_threshold
+#if "residuals_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  && mv 'quality_control_residuals/output.${gxy2omsext("csv")}' '$quality_control_residuals'
 #end if
-#if $param_RANSAC_pc_inliers:
-  -RANSAC:pc_inliers $param_RANSAC_pc_inliers
-#end if
-#if $param_RANSAC_iter:
-  -RANSAC:iter $param_RANSAC_iter
-#end if
-#if $param_goodness_median:
-  -goodness:median $param_goodness_median
+#if "residuals_plot_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
+  && mv 'quality_control_residuals_plot/output.${gxy2omsext("png")}' '$quality_control_residuals_plot'
 #end if
-#if $param_goodness_MAD:
-  -goodness:MAD $param_goodness_MAD
-#end if
-#if $param_quality_control_models:
-  -quality_control:models $param_quality_control_models
-#end if
-#if $param_quality_control_models_plot:
-  -quality_control:models_plot $param_quality_control_models_plot
-#end if
-#if $param_quality_control_residuals:
-  -quality_control:residuals $param_quality_control_residuals
-#end if
-#if $param_quality_control_residuals_plot:
-  -quality_control:residuals_plot $param_quality_control_residuals_plot
-#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[{"rscript_executable": "Rscript", "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 peak file" help="(-in) "/>
-    <param name="param_rscript_executable" type="data" format="txt" value="Rscript" label="Path to the Rscript executable (default: 'Rscript')" help="(-rscript_executable) "/>
-    <param name="param_ppm_match_tolerance" type="float" value="25.0" label="Finding calibrants in raw data uses this tolerance (for lock masses and ID's)" help="(-ppm_match_tolerance) "/>
-    <repeat name="rep_param_ms_level" min="0" max="1" title="param_ms_level">
-      <param name="param_ms_level" type="text" size="30" value="1 2 3" label="Target MS levels to apply the transformation onto" help="(-ms_level) Does not affect calibrant collection">
-        <sanitizer>
-          <valid initial="string.printable">
-            <remove value="'"/>
-            <remove value="&quot;"/>
-          </valid>
-        </sanitizer>
+    <param name="in" argument="-in" type="data" format="mzml" optional="false" label="Input peak file" help=" select mzml data sets(s)"/>
+    <param name="ppm_match_tolerance" argument="-ppm_match_tolerance" type="float" optional="true" value="25.0" label="Finding calibrants in raw data uses this tolerance (for lock masses and ID's)" help=""/>
+    <param name="ms_level" argument="-ms_level" type="text" optional="true" value="1 2 3" label="Target MS levels to apply the transformation onto" help="Does not affect calibrant collection (space separated list, in order to allow for spaces in list items surround them by single quotes)">
+      <expand macro="list_integer_valsan"/>
+    </param>
+    <param name="RT_chunking" argument="-RT_chunking" type="float" optional="true" value="300.0" label="RT window (one-sided" help="i.e. left-&gt;center, or center-&gt;right) around an MS scan in which calibrants are collected to build a model. Set to -1 to use ALL calibrants for all scans, i.e. a global model"/>
+    <section name="cal" title="Chose one of two optional input files ('id_in' or 'lock_in') to define the calibration masses/function" help="" expanded="false">
+      <param name="id_in" argument="-cal:id_in" type="data" format="featurexml,idxml" optional="true" label="Identifications or features whose peptide ID's serve as calibration masses" help=" select featurexml,idxml data sets(s)"/>
+      <param name="lock_in" argument="-cal:lock_in" type="data" format="csv" optional="true" label="Input file containing reference m/z values (text file with each line as: m/z ms-level charge) which occur in all scans" help=" select csv data sets(s)"/>
+      <param name="lock_require_mono" argument="-cal:lock_require_mono" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Require all lock masses to be monoisotopic" help="i.e. not the iso1, iso2 etc ('charge' column is used to determine the spacing). Peaks which are not mono-isotopic are not used"/>
+      <param name="lock_require_iso" argument="-cal:lock_require_iso" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Require all lock masses to have at least the +1 isotope" help="Peaks without isotope pattern are not used"/>
+      <param name="model_type" argument="-cal:model_type" display="radio" type="select" optional="false" label="Type of function to be fitted to the calibration points" help="">
+        <option value="linear">linear</option>
+        <option value="linear_weighted" selected="true">linear_weighted</option>
+        <option value="quadratic">quadratic</option>
+        <option value="quadratic_weighted">quadratic_weighted</option>
+        <expand macro="list_string_san"/>
       </param>
-    </repeat>
-    <param name="param_RT_chunking" type="float" value="300.0" label="RT window (one-sided, i.e" help="(-RT_chunking) left-&gt;center, or center-&gt;right) around an MS scan in which calibrants are collected to build a model. Set to -1 to use ALL calibrants for all scans, i.e. a global model"/>
-    <param name="param_cal_id_in" type="data" format="idxml,featurexml" optional="True" label="Identifications or features whose peptide ID's serve as calibration masses" help="(-id_in) "/>
-    <param name="param_cal_lock_in" type="data" format="tabular" optional="True" label="Input file containing reference m/z values (text file with each line as: m/z ms-level charge) which occur in all scans" help="(-lock_in) "/>
-    <param name="param_cal_lock_require_mono" display="radio" type="boolean" truevalue="-cal:lock_require_mono" falsevalue="" checked="false" optional="True" label="Require all lock masses to be monoisotopic, i.e" help="(-lock_require_mono) not the iso1, iso2 etc ('charge' column is used to determine the spacing). Peaks which are not mono-isotopic are not used"/>
-    <param name="param_cal_lock_require_iso" display="radio" type="boolean" truevalue="-cal:lock_require_iso" falsevalue="" checked="false" optional="True" label="Require all lock masses to have at least the +1 isotope" help="(-lock_require_iso) Peaks without isotope pattern are not used"/>
-    <param name="param_cal_model_type" display="radio" type="select" optional="False" value="linear_weighted" label="Type of function to be fitted to the calibration points" help="(-model_type) ">
-      <option value="linear">linear</option>
-      <option value="linear_weighted" selected="true">linear_weighted</option>
-      <option value="quadratic">quadratic</option>
-      <option value="quadratic_weighted">quadratic_weighted</option>
+    </section>
+    <section name="RANSAC" title="Robust outlier removal using RANSAC" help="" expanded="false">
+      <param name="enabled" argument="-RANSAC:enabled" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Apply RANSAC to calibration points to remove outliers before fitting a model" help=""/>
+      <param name="threshold" argument="-RANSAC:threshold" type="float" optional="true" value="10.0" label="Threshold for accepting inliers (instrument precision (not accuracy!) as ppm^2 distance)" help=""/>
+      <param name="pc_inliers" argument="-RANSAC:pc_inliers" type="integer" optional="true" min="1" max="99" value="30" label="Minimum percentage (of available data) of inliers (&lt;threshold away from model) to accept the model" help=""/>
+      <param name="iter" argument="-RANSAC:iter" type="integer" optional="true" value="70" label="Maximal # iterations" help=""/>
+    </section>
+    <section name="goodness" title="Thresholds for accepting calibration success" help="" expanded="false">
+      <param name="median" argument="-goodness:median" type="float" optional="true" value="4.0" label="The median ppm error of calibrated masses must be smaller than this threshold" help=""/>
+      <param name="MAD" argument="-goodness:MAD" type="float" optional="true" value="2.0" label="The median absolute deviation of the ppm error of calibrated masses must be smaller than this threshold" help=""/>
+    </section>
+    <section name="quality_control" title="Tables and plots to verify calibration performance" help="" expanded="false"/>
+    <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="lock_out_FLAG">lock_out (Plot image of pre- and post calibration errors)</option>
+      <option value="lock_fail_out_FLAG">lock_fail_out (Plot image of pre- and post calibration errors)</option>
+      <option value="models_FLAG">models (Plot image of pre- and post calibration errors)</option>
+      <option value="models_plot_FLAG">models_plot (Plot image of pre- and post calibration errors)</option>
+      <option value="residuals_FLAG">residuals (Plot image of pre- and post calibration errors)</option>
+      <option value="residuals_plot_FLAG">residuals_plot (Plot image of pre- and post calibration errors)</option>
+      <option value="ctd_out_FLAG">Output used ctd (ini) configuration file</option>
     </param>
-    <param name="param_RANSAC_enabled" display="radio" type="boolean" truevalue="-RANSAC:enabled" falsevalue="" checked="false" optional="True" label="Apply RANSAC to calibration points to remove outliers before fitting a model" help="(-enabled) "/>
-    <param name="param_RANSAC_threshold" type="float" value="10.0" label="Threshold for accepting inliers (instrument precision (not accuracy!) as ppm^2 distance)" help="(-threshold) "/>
-    <param name="param_RANSAC_pc_inliers" type="integer" min="1" max="99" optional="True" value="30" label="Minimum percentage (of available data) of inliers (&lt;threshold away from model) to accept the model" help="(-pc_inliers) "/>
-    <param name="param_RANSAC_iter" type="integer" value="70" label="Maximal # iterations" help="(-iter) "/>
-    <param name="param_goodness_median" type="float" value="4.0" label="The median ppm error of calibrated masses must be smaller than this threshold" help="(-median) "/>
-    <param name="param_goodness_MAD" type="float" value="1.0" label="The median absolute deviation of the ppm error of calibrated masses must be smaller than this threshold" help="(-MAD) "/>
-    <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" format="mzml"/>
-    <data name="param_cal_lock_out" format="mzml"/>
-    <data name="param_cal_lock_fail_out" format="mzml"/>
-    <data name="param_quality_control_models" format="tabular"/>
-    <data name="param_quality_control_models_plot" format="png"/>
-    <data name="param_quality_control_residuals" format="tabular"/>
-    <data name="param_quality_control_residuals_plot" format="png"/>
+    <data name="out" label="${tool.name} on ${on_string}: out" format="mzml"/>
+    <data name="cal_lock_out" label="${tool.name} on ${on_string}: cal:lock_out" format="mzml">
+      <filter>OPTIONAL_OUTPUTS is not None and "lock_out_FLAG" in OPTIONAL_OUTPUTS</filter>
+    </data>
+    <data name="cal_lock_fail_out" label="${tool.name} on ${on_string}: cal:lock_fail_out" format="mzml">
+      <filter>OPTIONAL_OUTPUTS is not None and "lock_fail_out_FLAG" in OPTIONAL_OUTPUTS</filter>
+    </data>
+    <data name="quality_control_models" label="${tool.name} on ${on_string}: quality_control:models" format="csv">
+      <filter>OPTIONAL_OUTPUTS is not None and "models_FLAG" in OPTIONAL_OUTPUTS</filter>
+    </data>
+    <data name="quality_control_models_plot" label="${tool.name} on ${on_string}: quality_control:models_plot" format="png">
+      <filter>OPTIONAL_OUTPUTS is not None and "models_plot_FLAG" in OPTIONAL_OUTPUTS</filter>
+    </data>
+    <data name="quality_control_residuals" label="${tool.name} on ${on_string}: quality_control:residuals" format="csv">
+      <filter>OPTIONAL_OUTPUTS is not None and "residuals_FLAG" in OPTIONAL_OUTPUTS</filter>
+    </data>
+    <data name="quality_control_residuals_plot" label="${tool.name} on ${on_string}: quality_control:residuals_plot" format="png">
+      <filter>OPTIONAL_OUTPUTS is not None and "residuals_plot_FLAG" in OPTIONAL_OUTPUTS</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 an internal mass recalibration.
+  <tests>
+    <expand macro="autotest_InternalCalibration"/>
+    <expand macro="manutest_InternalCalibration"/>
+  </tests>
+  <help><![CDATA[Applies an internal mass recalibration.
 
 
-For more information, visit https://abibuilder.informatik.uni-tuebingen.de/archive/openms/Documentation/release/2.3.0/html/TOPP_InternalCalibration.html</help>
+For more information, visit http://www.openms.de/documentation/TOPP_InternalCalibration.html]]></help>
+  <expand macro="references"/>
 </tool>