Mercurial > repos > mvdbeek > compose_text_param
diff compose_text_param.xml @ 0:5b459fe14efb draft default tip
"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/compose_text_param commit 6cce597c5a058322363f061d06979f733744762d-dirty"
author | mvdbeek |
---|---|
date | Mon, 13 May 2019 03:00:28 -0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compose_text_param.xml Mon May 13 03:00:28 2019 -0400 @@ -0,0 +1,86 @@ +<tool name="Compose text parameter value" id="compose_text_param" version="0.1.0" profile="19.05" tool_type="expression"> + <description>from parameters</description> + <expression type="ecma5.1"> +{ + let s = ""; + for (const repeat of $job.components) { + s += repeat.param_type.component_value + }; + return {'output': s}; +} + </expression> + <inputs> + <repeat name="components" min="1"> + <conditional name="param_type"> + <param name="select_param_type" type="select" label="Choose the type of parameter for this field"> + <option value="text">Text Parameter</option> + <option value="integer">Integer Parameter</option> + <option value="float">Float Parameter</option> + </param> + <when value="text"> + <param name="component_value" type="text" label="Enter text that should be part of the computed value"/> + </when> + <when value="integer"> + <param name="component_value" value="" type="integer" label="Enter integer that should be part of the computed value"/> + </when> + <when value="float"> + <param name="component_value" value="" type="float" label="Enter float that should be part of the computed value"/> + </when> + </conditional> + </repeat> + </inputs> + <outputs> + <output type="text" name="out1" from="output" /> + </outputs> + <tests> + <test> + <repeat name="components"> + <conditional name="param_type"> + <param name="select_param_type" value="text"/> + <param name="component_value" value="Text: "/> + </conditional> + </repeat> + <repeat name="components"> + <conditional name="param_type"> + <param name="select_param_type" value="text"/> + <param name="component_value" value="value,"/> + </conditional> + </repeat> + <repeat name="components"> + <conditional name="param_type"> + <param name="select_param_type" value="text"/> + <param name="component_value" value=" Integer: "/> + </conditional> + </repeat> + <repeat name="components"> + <conditional name="param_type"> + <param name="select_param_type" value="integer"/> + <param name="component_value" value="1"/> + </conditional> + </repeat> + <repeat name="components"> + <conditional name="param_type"> + <param name="select_param_type" value="text"/> + <param name="component_value" value=", Float: "/> + </conditional> + </repeat> + <repeat name="components"> + <conditional name="param_type"> + <param name="select_param_type" value="float"/> + <param name="component_value" value="1.5"/> + </conditional> + </repeat> + <output name="output"> + <assert_contents> + <!-- <has_line line="'"Text: value, Integer: 1, Float: 1.5"'"/> --> + <has_line line=""Text: value, Integer: 1, Float: 1.5""/> + </assert_contents> + </output> + </test> + </tests> + <help> +This tool concatenates each parameter value to a string. +If used in a workflow you can connect the output to any +text parameter value. + </help> +</tool>