Galaxy REST API: multiple params per tool
The current method for supplying parameters to tools using the REST API for workflows is fairly broken. The structure is as follow: "parameters":{ "tool_1": { "param":"param_name", "value":"param value" }, "tool_2": { "param":"param_name", "value":"param value" } This structure means that it is impossible to submit more than 1 parameter per tool within a workflow. Tools themselves, and workflows that use them, have no problems with accepting multiple parameters. We should be supporting something more like the following: "parameters":{ "tool_1": { "param_name1":"param value 1" "param_name2":"param value 2" }, "tool_2": { "tool_2_param_name1":"param value 1" "tool_2_param_name2":"param value 2" } Is there any work towards something like this taking place? I imagine that the REST API could support both formats (if the tool parameters dict has anything in it other than "param" and "value", use the new structure) for backwards compatibility. Thanks, Jim
It looks like this is already the case, but only documented in the code (lib/galaxy/webapps/galaxy/api/workflows.py): def _update_step_parameters(step, param_map): """ Update ``step`` parameters based on the user-provided ``param_map`` dict. ``param_map`` should be structured as follows:: PARAM_MAP = {STEP_ID: PARAM_DICT, ...} PARAM_DICT = {NAME: VALUE, ...} For backwards compatibility, the following (deprecated) format is also supported for ``param_map``:: PARAM_MAP = {TOOL_ID: PARAM_DICT, ...} in which case PARAM_DICT affects all steps with the given tool id. If both by-tool-id and by-step-id specifications are used, the latter takes precedence. Finally (again, for backwards compatibility), PARAM_DICT can also be specified as:: PARAM_DICT = {'param': NAME, 'value': VALUE} Note that this format allows only one parameter to be set per step. """ Thanks, Jim On Mon, May 5, 2014 at 1:56 PM, Jim McCusker <jmccusker@5amsolutions.com>wrote:
The current method for supplying parameters to tools using the REST API for workflows is fairly broken. The structure is as follow:
"parameters":{ "tool_1": { "param":"param_name", "value":"param value" }, "tool_2": { "param":"param_name", "value":"param value" }
This structure means that it is impossible to submit more than 1 parameter per tool within a workflow. Tools themselves, and workflows that use them, have no problems with accepting multiple parameters. We should be supporting something more like the following:
"parameters":{ "tool_1": { "param_name1":"param value 1" "param_name2":"param value 2" }, "tool_2": { "tool_2_param_name1":"param value 1" "tool_2_param_name2":"param value 2" }
Is there any work towards something like this taking place? I imagine that the REST API could support both formats (if the tool parameters dict has anything in it other than "param" and "value", use the new structure) for backwards compatibility.
Thanks, Jim
participants (1)
-
Jim McCusker