view 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 source

<?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="@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="requirements"/>
  <expand macro="stdio"/>
  <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 &&
#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

## 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 "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 "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

## 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 "lock_fail_out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'cal_lock_fail_out/output.${gxy2omsext("mzml")}' '$cal_lock_fail_out'
#end if
#if "models_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'quality_control_models/output.${gxy2omsext("csv")}' '$quality_control_models'
#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 "residuals_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'quality_control_residuals/output.${gxy2omsext("csv")}' '$quality_control_residuals'
#end if
#if "residuals_plot_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'quality_control_residuals_plot/output.${gxy2omsext("png")}' '$quality_control_residuals_plot'
#end if
#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="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>
    </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>
  </inputs>
  <outputs>
    <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>
  <tests>
    <expand macro="autotest_InternalCalibration"/>
    <expand macro="manutest_InternalCalibration"/>
  </tests>
  <help><![CDATA[Applies an internal mass recalibration.


For more information, visit http://www.openms.de/documentation/TOPP_InternalCalibration.html]]></help>
  <expand macro="references"/>
</tool>