Re: [galaxy-dev] Galaxy REST API: multiple params per tool

2014-05-05 Thread Jim McCusker
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 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
>
___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

[galaxy-dev] Galaxy REST API: multiple params per tool

2014-05-05 Thread Jim McCusker
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
___
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/