Hello!
I want to write a tool that returns “text” output, similar to e. g. “Compose text parameter value”. I wrote some test xml like mentioned tool:
<tool id="scripts_test" name="scripts_test" version="1.0a" profile="19.05" tool_type="expression">
<description>xml for testing tool syntax</description>
<expression type="ecma5.1">
{return {'output': "32233"}}
</expression>
<inputs>
<param name="sample" type="text" label="sample_id"/>
</inputs>
<outputs>
<data name="out" type="text" from="output" label="output text11"/>
</outputs>
</tool>
But it returns ordinary file of type “data”.
I also tried ordinary “command” kind of tool with exactly the same result:
<tool id="scripts_test" name="scripts_test" version="1.0a">
<description>xml for testing tool syntax</description>
<command detect_errors="aggressive">
pwd; echo "test1111" > '$out'
</command>
<stdio>
<regex match="^$" source="stdout" level="warning" description="Empty exit code" />
</stdio>
<inputs>
<param name="sample" type="text" label="sample_id"/>
</inputs>
<outputs>
<data name="out" type="text" label="output text11"/>
</outputs>
</tool>
I searched Galaxy Tool XML File — Galaxy Project 21.09 documentation and https://planemo.readthedocs.io/ and found nothing about “text” output nor “expression” kind of tools.
So i have the following questions:
- What should i write in my xml to return “text” instead of file?
- Can i achieve this with “command” tool?
- Is it possible to write “expression” in other language rather than ecma5.1, e. g. python?
- Is it possible to execute some shell command from such expression and get its result?
Thanks in advance.