I am not certain order_index solves all of the problems but I agree it is a step forward and in the latest galaxy distribution the default is to use 'order_index' instead of the old database id *IF* instead of specifying inputs via the 'ds_map' parameter you specify the parameter as 'inputs'. ('inputs' is a better name since collections can also now be specified this way.) If using 'inputs' you can also specify 'inputs_by' as either 'step_index' (new default), 'step_identifier' (old id used by 'ds_map'), or 'name' if your input datasets and dataset collections have been given names. Names has the nice feature of surviving many different changes to the workflow in the workflow editor (even more than order_index), but the down side of 'name' is that not everyone assigns input names. I have created a blend4j issue (https://github.com/jmchilton/blend4j/issues/20) to expose these new options - hopefully I will get to that soon. -John On Sun, Sep 14, 2014 at 6:57 PM, Freek de Bruijn <f.debruijn@vumc.nl> wrote:
Hi everyone,
The Galaxy API is a great way to interact with a Galaxy server and I've been using it to run workflows (supported by the blend4j library, since I'm working on a Java project). Recently, I ran into a challenge with the workflow step IDs.
When retrieving the metadata of a Galaxy workflow (using the API and blend4j), the order of the workflow step IDs appears to be random (or at least, not what I expected). This makes it complicated to specify parameters when you run a workflow via the API, because the step ID and parameter name normally are a nice way to pick the parameter you want to set (blend4j method: WorkflowInputs.setStepParameter). Is is possible to determine which step ID is assigned to - for example - the second workflow step?
From a few tests and looking at the Galaxy source code, it looks to me like the workflow steps are sorted according to their position in the workflow editor (in ascending order of sqrt(sqr(position.x) + sqr(position.y))). When storing the workflow in the database, the ID field for each step is assigned a unique unpredictable number (by SQLAlchemy or the database?). But in addition to the ID, there is also a nice order_index field, which contains the indices in the expected order! Would it be possible to add the order_index field to the API and would that solve the step order issue?
Cheers, Freek ------ Freek de Bruijn Scientific programmer | VU University medical center ___________________________________________________________ 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/