Multiple values in <when> tags for <conditiona> parameters
Hello all, I'm exploring a <conditional> example where I would like to group some of the select values into a single <when> clause. Currently it seems each value requires its own <when> which leads to duplication and worse. For example, I'd like to do something like this: <conditional name="id_opts"> <param name="set_operator" type="select" label="Source of sequence identifier list"> <option value="SINGLE">Single file - want sequences listed in ONE tabular file</option> <option value="UNION">Union - want sequences listed in ANY of given tabular files</option> <option value="INTERSECTION">Intersection - want sequences listed in ALL of given tabular files</option> </param> <when value="SINGLE"> <!-- We don't need a repeat for one file --> <param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/> </when> <!-- exactly what syntax would be best the for next line unclear --> <when values="UNION,INTERSECTION"> <repeat name="identifiers" title="Tabular file(s) with sequence identifiers" min="2"> <param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/> </repeat> </when> </conditional> But instead I am forced to use: <conditional name="id_opts"> <param name="set_operator" type="select" label="Source of sequence identifier list"> <option value="SINGLE">Single file - want sequences listed in ONE tabular file</option> <option value="UNION">Union - want sequences listed in ANY of given tabular files</option> <option value="INTERSECTION">Intersection - want sequences listed in ALL of given tabular files</option> </param> <when value="SINGLE"> <!-- We don't need a repeat for one file --> <param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/> </when> <!-- Seems must repeat the same options for both UNION and INTERSECTION --> <when value="UNION"> <repeat name="identifiers" title="Tabular file(s) with sequence identifiers" min="2"> <param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/> </repeat> </when> <when value="INTERSECTION"> <repeat name="identifiers" title="Tabular file(s) with sequence identifiers" min="2"> <param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/> </repeat> </when> </conditional> This has a major usability downside in that when the user switches from UNION to INTERSECTION, any previously entered values for the <when> parameters are lost. Is this something that has already been enhanced, or is the wiki page accurate regarding the current inflexible <when> behaviour? http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax I can see how to avoid the issue where by splitting this 3-way select into two separate parameters, but that feels more awkward. Thanks, Peter
On Thu, May 9, 2013 at 12:23 PM, Peter Cock <p.j.a.cock@googlemail.com> wrote:
Hello all,
I'm exploring a <conditional> example where I would like to group some of the select values into a single <when> clause. Currently it seems each value requires its own <when> which leads to duplication and worse.
For example, I'd like to do something like this:
<conditional name="id_opts"> <param name="set_operator" type="select" label="Source of sequence identifier list"> <option value="SINGLE">Single file - want sequences listed in ONE tabular file</option> <option value="UNION">Union - want sequences listed in ANY of given tabular files</option> <option value="INTERSECTION">Intersection - want sequences listed in ALL of given tabular files</option> </param> <when value="SINGLE"> <!-- We don't need a repeat for one file --> <param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/> </when> <!-- exactly what syntax would be best the for next line unclear --> <when values="UNION,INTERSECTION"> <repeat name="identifiers" title="Tabular file(s) with sequence identifiers" min="2"> <param name="input_tabular" type="data" format="tabular" label="Tabular file containing sequence identifiers"/> </repeat> </when> </conditional>
Note that there is precedent for defaulting to a comma separator but allowing it to be over-ridden in the <filter>. Or perhaps sub-elements would work too... As an aside, looking at the documentation on the wiki, there seem to be two different <filter> tags, one within an <options> tag set (which is documented) and one within a <data> tag (which is not documented but is used in an example). http://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax Peter
participants (1)
-
Peter Cock