view MassCalculator.xml @ 13:bcd50cd4fe42 draft

planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 3d1e5f37fd16524a415f707772eeb7ead848c5e3
author galaxyp
date Thu, 01 Dec 2022 19:08:33 +0000
parents 65c6e741ddf3
children d905af02ce63
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: [Utilities]-->
<tool id="MassCalculator" name="MassCalculator" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="21.05">
  <description>Calculates masses and mass-to-charge ratios of peptide sequences</description>
  <macros>
    <token name="@EXECUTABLE@">MassCalculator</token>
    <import>macros.xml</import>
  </macros>
  <expand macro="requirements"/>
  <expand macro="stdio"/>
  <command detect_errors="exit_code"><![CDATA[@QUOTE_FOO@
@EXT_FOO@
#import re

## Preprocessing
#if $in:
  mkdir in &&
  ln -s '$in' 'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)' &&
#end if
#if "out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  mkdir out &&
#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
#if $in:
  -in
  'in/${re.sub("[^\w\-_]", "_", $in.element_identifier)}.$gxy2omsext($in.ext)'
#end if
#if "out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  -out
  'out/output.${gxy2omsext("csv")}'
#end if
#if len(str($OPTIONAL_OUTPUTS).split(',')) == 0
  | tee '$stdout'
#end if

## Postprocessing
#if "out_FLAG" in str($OPTIONAL_OUTPUTS).split(',')
  && mv 'out/output.${gxy2omsext("csv")}' '$out'
#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[{"log": "log.txt", "threads": "\${GALAXY_SLOTS:-1}", "no_progress": true}]]></configfile>
  </configfiles>
  <inputs>
    <param argument="-in" type="data" format="tabular" optional="true" label="Input file with peptide sequences and optionally charge numbers (mutually exclusive to 'in_seq')" help=" select tabular data sets(s)"/>
    <param argument="-in_seq" type="text" optional="true" value="" label="List of peptide sequences (mutually exclusive to 'in')" help=" (space separated list, in order to allow for spaces in list items surround them by single quotes)">
      <expand macro="list_string_val" name="in_seq"/>
      <expand macro="list_string_san" name="in_seq"/>
    </param>
    <param argument="-charge" type="text" optional="true" value="0" label="List of charge states; required if 'in_seq' is given" help=" (space separated list, in order to allow for spaces in list items surround them by single quotes)">
      <expand macro="list_integer_valsan" name="charge"/>
    </param>
    <param argument="-format" type="select" optional="true" label="Output format ('list': human-readable list, 'table': CSV-like table, 'mass_only': mass values only, 'mz_only': m/z values only)" help="">
      <option value="list" selected="true">list</option>
      <option value="table">table</option>
      <option value="mass_only">mass_only</option>
      <option value="mz_only">mz_only</option>
      <expand macro="list_string_san" name="format"/>
    </param>
    <param argument="-average_mass" type="boolean" truevalue="true" falsevalue="false" checked="false" label="Compute average (instead of monoisotopic) peptide masses" help=""/>
    <param argument="-fragment_type" type="select" optional="true" label="For what type of sequence/fragment the mass should be computed" help="">
      <option value="full" selected="true">full</option>
      <option value="internal">internal</option>
      <option value="N-terminal">N-terminal</option>
      <option value="C-terminal">C-terminal</option>
      <option value="a-ion">a-ion</option>
      <option value="b-ion">b-ion</option>
      <option value="c-ion">c-ion</option>
      <option value="x-ion">x-ion</option>
      <option value="y-ion">y-ion</option>
      <option value="z-ion">z-ion</option>
      <expand macro="list_string_san" name="fragment_type"/>
    </param>
    <param argument="-separator" type="text" optional="true" value="" label="Field separator for 'table' output format; by default, the 'tab' character is used" help="">
      <expand macro="list_string_san" name="separator"/>
    </param>
    <expand macro="adv_opts_macro">
      <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">
      <option value="out_FLAG">out (Output file; if empty, output is written to the screen)</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="csv">
      <filter>OPTIONAL_OUTPUTS is not None and "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>
  <tests><!-- UTILS_MassCalculator_1 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <param name="in" value="MassCalculator_1_input.tsv" ftype="tabular"/>
      <param name="in_seq" value=""/>
      <output name="out" file="MassCalculator_1_output.csv" compare="sim_size" delta_frac="0.7" ftype="csv"/>
      <param name="charge" value="0 1"/>
      <param name="format" value="table"/>
      <param name="average_mass" value="false"/>
      <param name="fragment_type" value="full"/>
      <param name="separator" value=","/>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG,out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
    <!-- UTILS_MassCalculator_2 -->
    <test expect_num_outputs="2">
      <section name="adv_opts">
        <param name="force" value="false"/>
        <param name="test" value="true"/>
      </section>
      <param name="in_seq" value="&quot;LDQWLC(Carbamidomethyl)EKL&quot; &quot;(Glu-&gt;pyro-Glu)EAM(Oxidation)APKHK&quot; &quot;RANVM(Oxidation)DYR&quot; &quot;FGVEQDVDMVFASFIR&quot;"/>
      <output name="out" file="MassCalculator_2_output.txt" compare="sim_size" delta_frac="0.7" ftype="csv"/>
      <param name="charge" value="1 2 3"/>
      <param name="format" value="list"/>
      <param name="average_mass" value="false"/>
      <param name="fragment_type" value="full"/>
      <param name="separator" value=""/>
      <param name="OPTIONAL_OUTPUTS" value="ctd_out_FLAG,out_FLAG"/>
      <output name="ctd_out" ftype="xml">
        <assert_contents>
          <is_valid_xml/>
        </assert_contents>
      </output>
    </test>
  </tests>
  <help><![CDATA[Calculates masses and mass-to-charge ratios of peptide sequences


For more information, visit http://www.openms.de/doxygen/release/2.8.0/html/UTILS_MassCalculator.html]]></help>
  <expand macro="references"/>
</tool>