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.briggs@manchester.ac.uk Bioinformatics Core Facility University of Manchester B.1083 Michael Smith Bldg Tel: (0161) 2751482
Peter - thanks for the detailed bug report! I believe this should be fixed with the following PR (https://github.com/galaxyproject/galaxy/pull/273) that has been merged into release_15.05 on github as well as the dev branch. I tried to fixed a few different bugs related to boolean and select handling with in the confines of tests - so let me know if it didn't fix this exact use case and I will look at it some more. There is now this test case that verifies the correctness of boolean test parameters inside of conditionals (https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/boole...) - let me know if you see anything wrong with it. The test can be run with by executing: ./run_tests.sh -framework -id boolean_conditional from Galaxy's root. Thanks again, -John On Tue, May 19, 2015 at 10:01 AM, Peter Briggs <peter.briggs@manchester.ac.uk> wrote:
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.briggs@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/
Hello John Apologies for the delayed response, but many thanks for looking into this so thoroughly. I've now tried running the test cases using planemo with the dev branch from github and all the cases pass that I expected to. (Using "bdg_options.bdg2" rather than "bdg_options|bdg2" to reference the parameter in the tests fails consistently, but I understand that this is normal behaviour so it's not a problem.) So it looks to me like you've fixed this. I'm trying it now on my real tool tests where there are a few more moving parts but I don't see why it won't work there. I'll let you know if I do encounter any other strange cases. Thanks again for taking the time to investigate and address these issues, it's greatly appreciated. Best wishes Peter On 20/05/15 20:55, John Chilton wrote:
Peter - thanks for the detailed bug report!
I believe this should be fixed with the following PR (https://github.com/galaxyproject/galaxy/pull/273) that has been merged into release_15.05 on github as well as the dev branch. I tried to fixed a few different bugs related to boolean and select handling with in the confines of tests - so let me know if it didn't fix this exact use case and I will look at it some more.
There is now this test case that verifies the correctness of boolean test parameters inside of conditionals (https://github.com/galaxyproject/galaxy/blob/dev/test/functional/tools/boole...) - let me know if you see anything wrong with it. The test can be run with by executing:
./run_tests.sh -framework -id boolean_conditional
from Galaxy's root.
Thanks again, -John
On Tue, May 19, 2015 at 10:01 AM, Peter Briggs <peter.briggs@manchester.ac.uk> wrote:
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.briggs@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/
-- Peter Briggs peter.briggs@manchester.ac.uk Bioinformatics Core Facility University of Manchester B.1083 Michael Smith Bldg Tel: (0161) 2751482
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-bounces@lists.galaxyproject.org] on behalf of Peter Briggs [peter.briggs@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.briggs@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/
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-bounces@lists.galaxyproject.org] on behalf of Christian Brenninkmeijer [christian.brenninkmeijer@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-bounces@lists.galaxyproject.org] on behalf of Peter Briggs [peter.briggs@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.briggs@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/
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-bounces@lists.galaxyproject.org] on behalf of Christian Brenninkmeijer [christian.brenninkmeijer@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-bounces@lists.galaxyproject.org] on behalf of Peter Briggs [peter.briggs@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.briggs@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.briggs@manchester.ac.uk Bioinformatics Core Facility University of Manchester B.1083 Michael Smith Bldg Tel: (0161) 2751482
participants (3)
-
Christian Brenninkmeijer
-
John Chilton
-
Peter Briggs