Re: [galaxy-dev] Conditionally showing certain form elements on tool page

2012-08-16 Thread Dan Tenenbaum
Hi John and Peter,

On Thu, Aug 16, 2012 at 11:37 AM, Peter Cock  wrote:
> On Thu, Aug 16, 2012 at 6:53 PM, Dan Tenenbaum  wrote:
>> Hi John,
>>
>> On Thu, Aug 16, 2012 at 9:51 AM, John Patterson  wrote:
>>>
>>> Hello Dan,
>>>
>>> The easiest way to go about this, since you said that none of your
>>> filters are mutually exclusive, is to use the "select" datatype. I don't
>>> think you even need the conditional tags. Galaxy says that you need 
>>> tag sets when you use conditionals, but this is not true, as I have similar
>>> code as I have written below. Use type="select" in your parameter. This
>>> gives you a button that can have a multitude of options, but most of mine
>>> are simply used like booleans. Something like this:
>>> ...
>>
>> This is extremely helpful! Thanks.
>> I find the select box yes/no idiom a bit awkward. I'd prefer a
>> checkbox (just a single one, not one each for "yes" and "no") but
>> doing a select box is ok too, I can live with that.
>
> Using a boolean checkbox should work - although early on it
> wasn't possible thus many older tools use a select instead:
> https://bitbucket.org/galaxy/galaxy-central/issue/393/cant-use-checkbox-boolean-with-conditional
>

I can do a checkbox like this:


But I want to have a checkbox that triggers some other params to
appear when it is checked (the way I have successfully done it with a
select). I haven't been able to figure that out.

If I do this:


  
   
 
   
   


...nothing happens when I click the checkbox.

I also tried using a select with multiple="true" and
display="checkbox", but Galaxy doesn't like that because I provide
only one option ("yes").

If you could tell me how to cause params to appear/disappear by
checking a checkbox that would be great!
Thanks,
Dan


> 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/


Re: [galaxy-dev] Conditionally showing certain form elements on tool page

2012-08-16 Thread Peter Cock
On Thu, Aug 16, 2012 at 6:53 PM, Dan Tenenbaum  wrote:
> Hi John,
>
> On Thu, Aug 16, 2012 at 9:51 AM, John Patterson  wrote:
>>
>> Hello Dan,
>>
>> The easiest way to go about this, since you said that none of your
>> filters are mutually exclusive, is to use the "select" datatype. I don't
>> think you even need the conditional tags. Galaxy says that you need 
>> tag sets when you use conditionals, but this is not true, as I have similar
>> code as I have written below. Use type="select" in your parameter. This
>> gives you a button that can have a multitude of options, but most of mine
>> are simply used like booleans. Something like this:
>> ...
>
> This is extremely helpful! Thanks.
> I find the select box yes/no idiom a bit awkward. I'd prefer a
> checkbox (just a single one, not one each for "yes" and "no") but
> doing a select box is ok too, I can live with that.

Using a boolean checkbox should work - although early on it
wasn't possible thus many older tools use a select instead:
https://bitbucket.org/galaxy/galaxy-central/issue/393/cant-use-checkbox-boolean-with-conditional

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/


Re: [galaxy-dev] Conditionally showing certain form elements on tool page

2012-08-16 Thread Dan Tenenbaum
On Thu, Aug 16, 2012 at 10:53 AM, Dan Tenenbaum  wrote:
> Hi John,
>
> On Thu, Aug 16, 2012 at 9:51 AM, John Patterson  wrote:
>> On 08/15/2012 08:59 PM, Dan Tenenbaum wrote:
>>>
>>> Hi all,
>>>
>>> I'm trying to wrap my head around what the  tag does...it
>>> looks like it doesn't do what I would like.
>>>
>>> I want to create a tool that allows the user to upload a data file and
>>> then have it run through one or more filters. Each filter takes one or
>>> more parameters.
>>>
>>> I was thinking I could do something like this:
>>>
>>>
>>>
>>>   
>>>   >> value="yessir">
>>>   
>>>   
>>>   
>>>   
>>>   
>>>   
>>>
>>>
>>> The idea being, if the user checks the box labeled "foo", a text box
>>> labeled "bar" will appear.
>>> And I would have several such checkboxes and their accompanying
>>> parameters.
>>> But what I get is just the checkbox, and nothing happens when I click it.
>>>
>>> Is it possible to do what I have in mind, and if so, how?
>>>
>>> Also note that these conditions are not mutually exclusive. A user can
>>> select one *or more* filters. So I'm not sure how the body of my
>>>  tag should look. Is there a way I can just pass every
>>> possible parameter to my script like this:
>>> myscript.py param1=foo param2=bar
>>> If a parameter is not defined (because the user didn't click its
>>> associated checkbox), then the script will receive e.g.
>>> param1= param2=bar
>>> but it can deal with that.
>>>
>>> I realize I can make several tools and chain them together in a
>>> workflow, but that seems like overkill for this use case, and it would
>>> be nice if the user could set up their desired filters on one screen.
>>>
>>> Is this possible?
>>> Thanks!
>>> Dan
>>> ___
>>> 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/
>>
>> Hello Dan,
>>
>> The easiest way to go about this, since you said that none of your
>> filters are mutually exclusive, is to use the "select" datatype. I don't
>> think you even need the conditional tags. Galaxy says that you need 
>> tag sets when you use conditionals, but this is not true, as I have similar
>> code as I have written below. Use type="select" in your parameter. This
>> gives you a button that can have a multitude of options, but most of mine
>> are simply used like booleans. Something like this:
>>
>> 
>> 
>> yes
>> no
>>  
>>  
>> yes
>> no
>>  
>> 
>>
>> I had certain options that WERE mutually exclusive, and required nested
>> conditional statements, where I had an outer conditional for the extra
>> options, and an inner conditional around each parameter.
>>
>> As for the command tag, the select type parameters make it easy because you
>> can just check the string values with an if statement, like so:
>> (assuming python)
>> 
>> tool.py
>> #if $param1 == "yes":
>> --YourGetOptFlag
>> #else:
>> ##dont even need an else, just ignore
>> #end if
>>
>> 
>>
>> If I am not mistaken, this should be sufficient if all you need to pass is a
>> flag indicating your program to use the filter. If you need to pass a flag
>> AND integer values, you are going to have to wrap your parameters in
>> conditional tags and use a set of :
>>
>> 
>>   
>> 
>> yes
>> no
>>  
>>  
>>> min="(optional)" max="(optional)" label="UseParamName" help="helpful text"
>> />
>>  
>>   
>>   
>> 
>>
>> Rinse and repeat, adding conditionals around each select. I think this is
>> actually what you want to do, as you say you want a box to appear after a
>> user selects whether or not to use the filter. Also, quick note, the text
>> between the option tags are what appear on the select buttons, so they can
>> be whatever you want. The value="" is the important thing, as this is what
>> you will evaluate the "if/else" to in the  tag. One last thing, The
>> cheetah command is really no different.
>>
>> 
>>   tool.py
>>   #if $firstConditional.param1 == "yes":
>>  --testGetOpt $firstConditional.IntegerBox
>>   #end if
>>
>> 
>>
>> The second command tag is how I pass a few parameters into my command line
>> tool.
>>
>>
>> Anyway, I hope this helped a little bit. If you need anything else, let me
>> know and I will see If I can help. A lot of this was trial and error and I
>> am sure there are trickier ways to doing it, but this worked for the scope
>> of my program.
>>
>
> This is extremely helpful! Thanks.
> I find the select box yes/no idiom a bit awkward. I'd prefer a
> checkbox (just a single one, not one each for "yes" and "no") but
> doing a select box is ok too, I can live with that.
>
> I'm running into problems constructing my command, though. I'm new to
> cheetah so that

Re: [galaxy-dev] Conditionally showing certain form elements on tool page

2012-08-16 Thread Dan Tenenbaum
Hi John,

On Thu, Aug 16, 2012 at 9:51 AM, John Patterson  wrote:
> On 08/15/2012 08:59 PM, Dan Tenenbaum wrote:
>>
>> Hi all,
>>
>> I'm trying to wrap my head around what the  tag does...it
>> looks like it doesn't do what I would like.
>>
>> I want to create a tool that allows the user to upload a data file and
>> then have it run through one or more filters. Each filter takes one or
>> more parameters.
>>
>> I was thinking I could do something like this:
>>
>>
>>
>>   
>>   > value="yessir">
>>   
>>   
>>   
>>   
>>   
>>   
>>
>>
>> The idea being, if the user checks the box labeled "foo", a text box
>> labeled "bar" will appear.
>> And I would have several such checkboxes and their accompanying
>> parameters.
>> But what I get is just the checkbox, and nothing happens when I click it.
>>
>> Is it possible to do what I have in mind, and if so, how?
>>
>> Also note that these conditions are not mutually exclusive. A user can
>> select one *or more* filters. So I'm not sure how the body of my
>>  tag should look. Is there a way I can just pass every
>> possible parameter to my script like this:
>> myscript.py param1=foo param2=bar
>> If a parameter is not defined (because the user didn't click its
>> associated checkbox), then the script will receive e.g.
>> param1= param2=bar
>> but it can deal with that.
>>
>> I realize I can make several tools and chain them together in a
>> workflow, but that seems like overkill for this use case, and it would
>> be nice if the user could set up their desired filters on one screen.
>>
>> Is this possible?
>> Thanks!
>> Dan
>> ___
>> 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/
>
> Hello Dan,
>
> The easiest way to go about this, since you said that none of your
> filters are mutually exclusive, is to use the "select" datatype. I don't
> think you even need the conditional tags. Galaxy says that you need 
> tag sets when you use conditionals, but this is not true, as I have similar
> code as I have written below. Use type="select" in your parameter. This
> gives you a button that can have a multitude of options, but most of mine
> are simply used like booleans. Something like this:
>
> 
> 
> yes
> no
>  
>  
> yes
> no
>  
> 
>
> I had certain options that WERE mutually exclusive, and required nested
> conditional statements, where I had an outer conditional for the extra
> options, and an inner conditional around each parameter.
>
> As for the command tag, the select type parameters make it easy because you
> can just check the string values with an if statement, like so:
> (assuming python)
> 
> tool.py
> #if $param1 == "yes":
> --YourGetOptFlag
> #else:
> ##dont even need an else, just ignore
> #end if
>
> 
>
> If I am not mistaken, this should be sufficient if all you need to pass is a
> flag indicating your program to use the filter. If you need to pass a flag
> AND integer values, you are going to have to wrap your parameters in
> conditional tags and use a set of :
>
> 
>   
> 
> yes
> no
>  
>  
> min="(optional)" max="(optional)" label="UseParamName" help="helpful text"
> />
>  
>   
>   
> 
>
> Rinse and repeat, adding conditionals around each select. I think this is
> actually what you want to do, as you say you want a box to appear after a
> user selects whether or not to use the filter. Also, quick note, the text
> between the option tags are what appear on the select buttons, so they can
> be whatever you want. The value="" is the important thing, as this is what
> you will evaluate the "if/else" to in the  tag. One last thing, The
> cheetah command is really no different.
>
> 
>   tool.py
>   #if $firstConditional.param1 == "yes":
>  --testGetOpt $firstConditional.IntegerBox
>   #end if
>
> 
>
> The second command tag is how I pass a few parameters into my command line
> tool.
>
>
> Anyway, I hope this helped a little bit. If you need anything else, let me
> know and I will see If I can help. A lot of this was trial and error and I
> am sure there are trickier ways to doing it, but this worked for the scope
> of my program.
>

This is extremely helpful! Thanks.
I find the select box yes/no idiom a bit awkward. I'd prefer a
checkbox (just a single one, not one each for "yes" and "no") but
doing a select box is ok too, I can live with that.

I'm running into problems constructing my command, though. I'm new to
cheetah so that might be it.

First off, here's my inputs and outputs:

  

  
  no
  yes
   
   
 
   



  
  no
  yes
   
   
 

Re: [galaxy-dev] Conditionally showing certain form elements on tool page

2012-08-16 Thread John Patterson

On 08/15/2012 08:59 PM, Dan Tenenbaum wrote:

Hi all,

I'm trying to wrap my head around what the  tag does...it
looks like it doesn't do what I would like.

I want to create a tool that allows the user to upload a data file and
then have it run through one or more filters. Each filter takes one or
more parameters.

I was thinking I could do something like this:


   
  
  
  
  
  
  
  
  
   

The idea being, if the user checks the box labeled "foo", a text box
labeled "bar" will appear.
And I would have several such checkboxes and their accompanying parameters.
But what I get is just the checkbox, and nothing happens when I click it.

Is it possible to do what I have in mind, and if so, how?

Also note that these conditions are not mutually exclusive. A user can
select one *or more* filters. So I'm not sure how the body of my
 tag should look. Is there a way I can just pass every
possible parameter to my script like this:
myscript.py param1=foo param2=bar
If a parameter is not defined (because the user didn't click its
associated checkbox), then the script will receive e.g.
param1= param2=bar
but it can deal with that.

I realize I can make several tools and chain them together in a
workflow, but that seems like overkill for this use case, and it would
be nice if the user could set up their desired filters on one screen.

Is this possible?
Thanks!
Dan
___
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/

Hello Dan,

The easiest way to go about this, since you said that none of your 
filters are mutually exclusive, is to use the "select" datatype. I don't 
think you even need the conditional tags. Galaxy says that you need 
 tag sets when you use conditionals, but this is not true, as I 
have similar code as I have written below. Use type="select" in your 
parameter. This gives you a button that can have a multitude of options, 
but most of mine are simply used like booleans. Something like this:




yes
no
 
 
yes
no
 


I had certain options that WERE mutually exclusive, and required nested 
conditional statements, where I had an outer conditional for the extra 
options, and an inner conditional around each parameter.


As for the command tag, the select type parameters make it easy because 
you can just check the string values with an if statement, like so:

(assuming python)

tool.py
#if $param1 == "yes":
--YourGetOptFlag
#else:
##dont even need an else, just ignore
#end if



If I am not mistaken, this should be sufficient if all you need to pass 
is a flag indicating your program to use the filter. If you need to pass 
a flag AND integer values, you are going to have to wrap your parameters 
in conditional tags and use a set of :



  

yes
no
 
 
   
 
  
  


Rinse and repeat, adding conditionals around each select. I think this 
is actually what you want to do, as you say you want a box to appear 
after a user selects whether or not to use the filter. Also, quick note, 
the text between the option tags are what appear on the select buttons, 
so they can be whatever you want. The value="" is the important thing, 
as this is what you will evaluate the "if/else" to in the  tag. 
One last thing, The cheetah command is really no different.



  tool.py
  #if $firstConditional.param1 == "yes":
 --testGetOpt $firstConditional.IntegerBox
  #end if



The second command tag is how I pass a few parameters into my command 
line tool.



Anyway, I hope this helped a little bit. If you need anything else, let 
me know and I will see If I can help. A lot of this was trial and error 
and I am sure there are trickier ways to doing it, but this worked for 
the scope of my program.


-John



___
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/


Re: [galaxy-dev] Conditionally showing certain form elements on tool page

2012-08-15 Thread Dan Tenenbaum
Hi John,

On Wed, Aug 15, 2012 at 7:32 PM, John Patterson  wrote:
> On 08/15/2012 08:59 PM, Dan Tenenbaum wrote:
>
> Hi all,
>
> I'm trying to wrap my head around what the  tag does...it
> looks like it doesn't do what I would like.
>
> I want to create a tool that allows the user to upload a data file and
> then have it run through one or more filters. Each filter takes one or
> more parameters.
>
> I was thinking I could do something like this:
>
>
>   
>  
>  
>  
>  
>  
>  
>  
>  
>   
>
> The idea being, if the user checks the box labeled "foo", a text box
> labeled "bar" will appear.
> And I would have several such checkboxes and their accompanying parameters.
> But what I get is just the checkbox, and nothing happens when I click it.
>
> Is it possible to do what I have in mind, and if so, how?
>
> Also note that these conditions are not mutually exclusive. A user can
> select one *or more* filters. So I'm not sure how the body of my
>  tag should look. Is there a way I can just pass every
> possible parameter to my script like this:
> myscript.py param1=foo param2=bar
> If a parameter is not defined (because the user didn't click its
> associated checkbox), then the script will receive e.g.
> param1= param2=bar
> but it can deal with that.
>
> I realize I can make several tools and chain them together in a
> workflow, but that seems like overkill for this use case, and it would
> be nice if the user could set up their desired filters on one screen.
>
> Is this possible?
> Thanks!
> Dan
> ___
> 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/
>
> Hello Dan,
>
> This page really helped me understand how the tags worked as well as looking
> at some older tools:
> http://wiki.g2.bx.psu.edu/Admin/Tools/Tool%20Config%20Syntax

Thanks for the pointer. I have seen this page, but I'm still stuck.
I'll read it again more carefully though.

>
> I will take a look at my tool when I get to the office tomorrow.

Thanks. I appreciate it!
Dan

>
> John
>
>
> ___
> 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/

___
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/

Re: [galaxy-dev] Conditionally showing certain form elements on tool page

2012-08-15 Thread John Patterson

On 08/15/2012 08:59 PM, Dan Tenenbaum wrote:

Hi all,

I'm trying to wrap my head around what the  tag does...it
looks like it doesn't do what I would like.

I want to create a tool that allows the user to upload a data file and
then have it run through one or more filters. Each filter takes one or
more parameters.

I was thinking I could do something like this:


   
  
  
  
  
  
  
  
  
   

The idea being, if the user checks the box labeled "foo", a text box
labeled "bar" will appear.
And I would have several such checkboxes and their accompanying parameters.
But what I get is just the checkbox, and nothing happens when I click it.

Is it possible to do what I have in mind, and if so, how?

Also note that these conditions are not mutually exclusive. A user can
select one *or more* filters. So I'm not sure how the body of my
 tag should look. Is there a way I can just pass every
possible parameter to my script like this:
myscript.py param1=foo param2=bar
If a parameter is not defined (because the user didn't click its
associated checkbox), then the script will receive e.g.
param1= param2=bar
but it can deal with that.

I realize I can make several tools and chain them together in a
workflow, but that seems like overkill for this use case, and it would
be nice if the user could set up their desired filters on one screen.

Is this possible?
Thanks!
Dan
___
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/

Hello Dan,

This page really helped me understand how the tags worked as well as 
looking at some older tools:

http://wiki.g2.bx.psu.edu/Admin/Tools/Tool%20Config%20Syntax

I will take a look at my tool when I get to the office tomorrow.

John

___
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/

[galaxy-dev] Conditionally showing certain form elements on tool page

2012-08-15 Thread Dan Tenenbaum
Hi all,

I'm trying to wrap my head around what the  tag does...it
looks like it doesn't do what I would like.

I want to create a tool that allows the user to upload a data file and
then have it run through one or more filters. Each filter takes one or
more parameters.

I was thinking I could do something like this:


  
 
 
 
 
 
 
 
 
  

The idea being, if the user checks the box labeled "foo", a text box
labeled "bar" will appear.
And I would have several such checkboxes and their accompanying parameters.
But what I get is just the checkbox, and nothing happens when I click it.

Is it possible to do what I have in mind, and if so, how?

Also note that these conditions are not mutually exclusive. A user can
select one *or more* filters. So I'm not sure how the body of my
 tag should look. Is there a way I can just pass every
possible parameter to my script like this:
myscript.py param1=foo param2=bar
If a parameter is not defined (because the user didn't click its
associated checkbox), then the script will receive e.g.
param1= param2=bar
but it can deal with that.

I realize I can make several tools and chain them together in a
workflow, but that seems like overkill for this use case, and it would
be nice if the user could set up their desired filters on one screen.

Is this possible?
Thanks!
Dan
___
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/