Hello Christian

Thanks for taking the time to look at this issue, and for your suggestions - apologies for the delayed response.


From the context of the current Galaxy code (and the default used by planemo's --install_galaxy option) I think you're right: i.e. omitting the truevalue/falsevalue attributes; using value="true"/"false" not "True"/"False" in the tool tests; and using the much simpler syntax for testing "truthiness" in the <command> section, seems to work for me.

It looks that John's fixes will address this in future Galaxy releases so that the more general cases will also work.

One point: I understand that the correct way to reference "nested" parameter names within the tool tests is to use a pipe (i.e. |) rather than a dot (.) to separate the name components - that is,

<param name="bdg_options|bdg2" ...

will work but

<param name="bdg_options.bdg2" ...

probably won't. I think that you always need the fully qualified name (using dot notation) to get the values in the <command> section.

Thanks again for looking into this,

Best wishes

Peter

On 21/05/15 10:56, Christian Brenninkmeijer wrote:
HI Peter,

I forgot to add.
In test it is.
<param name="bdg2" value="true" />
Do not use the full name as the value is simply ignored

This time True/false  it is not case sensitive,

But in <Command> it is
$bdg_options.bdg2
Do not use the short name as this causes an error

Christian
University of Manchester
________________________________________
From: galaxy-dev [galaxy-dev-boun...@lists.galaxyproject.org] on behalf of 
Christian Brenninkmeijer [christian.brenninkmei...@manchester.ac.uk]
Sent: Thursday, May 21, 2015 10:34 AM
To: Peter Briggs; galaxy-dev@lists.galaxyproject.org
Subject: Re: [galaxy-dev] Can't set value of conditional boolean parameter in   
tool tests

Hi Peter,

1. I would not recommend using truevalue= in boolean parm values inside of 
conditionals are the behaviour is buggy! (I will post a test example in another 
post)

2, In the when statement the boolean values must be LOWER case as in
<when value="true">

3. In the <command> the Boolean values are CAPITALIZED as in
#if str($bdg_options.bdg2) == 'True'

3a. or better yet  do not cast to string but just do
#if $bdg_options.bdg2

Christian
University of Manchester

________________________________________
From: galaxy-dev [galaxy-dev-boun...@lists.galaxyproject.org] on behalf of 
Peter Briggs [peter.bri...@manchester.ac.uk]
Sent: Tuesday, May 19, 2015 3:01 PM
To: galaxy-dev@lists.galaxyproject.org
Subject: [galaxy-dev] Can't set value of conditional boolean parameter in       
tool tests

Hello

I've encountered a problem with my tool tests when using a boolean as
the "control" parameter within a conditional: it doesn't appear to be
possible to change the value from the default "true" or "false" values
within the tests.

For example if I have a boolean 'bdg2' which controls a conditional
block and which defaults to its falsevalue:

    ...
    <conditional name="bdg_options">
      <param name="bdg2" type="boolean" checked="False"
            truevalue="-B2" falsevalue="" label="Save pileups in bedGraph?" />
      <when value="-B2">
    ...

and then try to set the value within a test using:

      <param name="bdg_options|bdg2" value="true" />

then the value remains unchanged from the default when the tests are
run. (Similarly if I set checked="True" then the value in the tests is
always "True" regardless of the value I try to set.)

I've tried various ways of referencing the parameter (e.g.
'bdg_options|bdg2', 'bdg2' and 'bdg_options') but none of these work for me.

Am I doing something obviously wrong? (nb this is a different problem
from my previous post about setting boolean values in tests - that works
fine for booleans which are not conditional control parameters).

I've made a small example tool to investigate the issue, the files are here:

https://gist.github.com/pjbriggs/c27e4366dfcdd6d96cb2

and using planemo 0.11.1 to run the tests.

(On a side note, it also seems that within the <command> section, the
values returned for this type of boolean only ever appear to be 'True'
or 'False' - but it seems okay to match against the truevalue and
falsevalues in the <when> tag.)

Thanks for any help,

Best wishes

Peter

--
Peter Briggs peter.bri...@manchester.ac.uk
Bioinformatics Core Facility University of Manchester
B.1083 Michael Smith Bldg Tel: (0161) 2751482
___________________________________________________________
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:
   https://lists.galaxyproject.org/

To search Galaxy mailing lists use the unified search at:
   http://galaxyproject.org/search/mailinglists/
___________________________________________________________
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:
   https://lists.galaxyproject.org/

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


--
Peter Briggs peter.bri...@manchester.ac.uk
Bioinformatics Core Facility University of Manchester
B.1083 Michael Smith Bldg Tel: (0161) 2751482
___________________________________________________________
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:
 https://lists.galaxyproject.org/

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

Reply via email to