Multiple values in <when> tags for <conditiona> parameters

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Multiple values in <when> tags for <conditiona> parameters

Peter Cock
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
___________________________________________________________
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/
Reply | Threaded
Open this post in threaded view
|

Re: Multiple values in <when> tags for <conditiona> parameters

John Chilton
Yup, off list by mistake.

-John

On Thu, May 9, 2013 at 8:40 AM, Peter Cock <[hidden email]> wrote:

> Off list by mistake?
>
> On Thu, May 9, 2013 at 1:25 PM, John Chilton <[hidden email]> wrote:
>> This is one of the use cases I was trying to address with tool macros. This
>> has the added benefit of reducing the level of XML nesting in such tools as
>> well.
>>
>> https://bitbucket.org/galaxyp/galaxyp-toolshed-maxquant/src/fc2de41f51a9168e71d90756450e14f392d3be3a/maxquant.xml?at=default#cl-129
>>
>> -John
>
> Yep - macros could be a solution here - and I could start using them in
> the NCBI BLAST+ wrappers to reduce the duplication too.
>
> Peter
___________________________________________________________
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/
Reply | Threaded
Open this post in threaded view
|

Re: Multiple values in <when> tags for <conditiona> parameters

Peter Cock
In reply to this post by Peter Cock
On Thu, May 9, 2013 at 12:23 PM, Peter Cock <[hidden email]> 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
___________________________________________________________
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/