Re: [galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-10-09 Thread Bjoern Gruening

Awesome, thanks Greg!

On 09.10.2015 15:50, Greg Von Kuster wrote:

I’ve finally had a chance to update the wiki - I’ve updated the following 
section to include information about the “dynamic_options=…” option for 
populating the select list:

https://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax#A.3Cparam.3E_tag_set

I’ve included the information from this email as an additional example in this 
section:

https://wiki.galaxyproject.org/Admin/Tools/ToolConfigSyntax#A.3Coptions.3E_tag_set

I hope this helps others use this approach or something similar.

Greg Von Kuster



On Oct 2, 2015, at 12:41 PM, Björn Grüning  wrote:

Thanks Greg for this nice example, I guess this is useful for others as
well!
I will try to put it into the Wiki soon.

Am 30.09.2015 um 20:05 schrieb Greg Von Kuster:

Here’s the answer to my question:

The ability to use associated dynamic select lists on Galaxy tool forms where 
selecting an option in the first select list dynamically re-renders the options 
in the second select list is possible after this change:

https://github.com/galaxyproject/galaxy/pull/815 


In my case, I am populating both dynamic select lists from metadata elements 
associated with my tool’s single input dataset. The 2 metadata elements I’m 
using look like this.

MetadataElement( name="field_names", default=[], desc="Field names",
 readonly=True, optional=True,
 visible=True, no_value=[] )
# The keys in the field_components map to the list of field_names in the 
above element
# which ensures order for select list options that are built from it.
MetadataElement( name="field_components", default={}, desc="Field names and 
components",
 readonly=True, optional=True, visible=True, no_value={} )


My tool config includes a code file tag like this.




Here are the relevant input parameters in my tool config.  The first parameter 
is the input dataset that includes the above metadata elements.



value is not None and len(value.metadata.field_names) > 0



The following parameter dynamically renders a select list consisting of the 
elements in the “field_names” metadata element associated with the selected 
input dataset.










The following parameter calls the “get_field_components_options() method in the 
“tool_form_utils.py” code file discussed above. This method returns the value 
of the input dataset’s “field_components” metadata element dictionary whose key 
is the currently selected “field_name” from the select list parameter above.





Changing the selected option in the “field_name” select list will dynamically 
re-render the options available in the associated “field_component_index” 
select list, which is the behavior we want.


The “get_field_components_options() method looks like this.

def get_field_components_options( dataset, field_name ):
options = []
if dataset.metadata is None:
return options
if not hasattr( dataset.metadata, 'field_names' ):
return options
if dataset.metadata.field_names is None:
return options
if field_name is None:
# The expression validator that helps populate the select list of input
# datsets in the icqsol_color_surface_field tool does not filter out
# datasets with no field field_names, so we need this check.
if len( dataset.metadata.field_names ) == 0:
return options
field_name = dataset.metadata.field_names[0]
field_components = dataset.metadata.field_components.get( field_name, [] )
for i, field_component in enumerate( field_components ):
options.append( ( field_component, field_component, i == 0 ) )
return options


Greg Von Kuster



On Sep 20, 2015, at 9:51 PM, Greg Von Kuster  wrote:

Hello all,

I’m working on adding support to the Galaxy framework for datatypes in the 
constructive solid geometry (CSG) space and I have several working Galaxy tools 
and a visualization plugin that deal with 3d shapes in this environment.  All 
of this work will soon be contributed to open source.

For one of the tools, I need to provide 2 select lists on the tool form that 
are associated in such a way that when an option in select list 1 is chosen, 
the options in select list 2 are altered and re-rendered.  This behavior would 
probably use a combination of dynamic options and refresh_on_change between the 
2 associated select lists.

I’ve not seen a tool that does this precisely, so I’m hoping that if it is 
currently possible to do this within Galaxy tools, someone will point me to an 
example.

If it is not currently possible, I will contribute a PR for supporting it, but 
would like some input as to how it should be done.

Dynamic options are currently rendered using 4 

Re: [galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-10-02 Thread Björn Grüning
Thanks Greg for this nice example, I guess this is useful for others as
well!
I will try to put it into the Wiki soon.

Am 30.09.2015 um 20:05 schrieb Greg Von Kuster:
> Here’s the answer to my question:
> 
> The ability to use associated dynamic select lists on Galaxy tool forms where 
> selecting an option in the first select list dynamically re-renders the 
> options in the second select list is possible after this change:
> 
> https://github.com/galaxyproject/galaxy/pull/815 
> 
> 
> In my case, I am populating both dynamic select lists from metadata elements 
> associated with my tool’s single input dataset.  The 2 metadata elements I’m 
> using look like this.
> 
> MetadataElement( name="field_names", default=[], desc="Field names",
>  readonly=True, optional=True,
>  visible=True, no_value=[] )
> # The keys in the field_components map to the list of field_names in the 
> above element
> # which ensures order for select list options that are built from it.
> MetadataElement( name="field_components", default={}, desc="Field names 
> and components",
>  readonly=True, optional=True, visible=True, no_value={} )
> 
> 
> My tool config includes a code file tag like this.
> 
> 
> 
> 
> Here are the relevant input parameters in my tool config.  The first 
> parameter is the input dataset that includes the above metadata elements.
> 
> 
>  label="Shape with uncolored surface field">
> value is not None and 
> len(value.metadata.field_names) > 0
> 
> 
> 
> The following parameter dynamically renders a select list consisting of the 
> elements in the “field_names” metadata element associated with the selected 
> input dataset.
> 
> 
>  refresh_on_change="True">
> 
> 
> 
> 
> 
> 
> 
> The following parameter calls the “get_field_components_options() method in 
> the “tool_form_utils.py” code file discussed above.  This method returns the 
> value of the input dataset’s “field_components” metadata element dictionary 
> whose key is the currently selected “field_name” from the select list 
> parameter above.
> 
> 
> 
> 
> 
> Changing the selected option in the “field_name” select list will dynamically 
> re-render the options available in the associated “field_component_index” 
> select list, which is the behavior we want.
> 
> 
> The “get_field_components_options() method looks like this.
> 
> def get_field_components_options( dataset, field_name ):
> options = []
> if dataset.metadata is None:
> return options
> if not hasattr( dataset.metadata, 'field_names' ):
> return options
> if dataset.metadata.field_names is None:
> return options
> if field_name is None:
> # The expression validator that helps populate the select list of 
> input
> # datsets in the icqsol_color_surface_field tool does not filter out
> # datasets with no field field_names, so we need this check.
> if len( dataset.metadata.field_names ) == 0:
> return options
> field_name = dataset.metadata.field_names[0]
> field_components = dataset.metadata.field_components.get( field_name, [] )
> for i, field_component in enumerate( field_components ):
> options.append( ( field_component, field_component, i == 0 ) )
> return options
> 
> 
> Greg Von Kuster
> 
> 
>> On Sep 20, 2015, at 9:51 PM, Greg Von Kuster  wrote:
>>
>> Hello all,
>>
>> I’m working on adding support to the Galaxy framework for datatypes in the 
>> constructive solid geometry (CSG) space and I have several working Galaxy 
>> tools and a visualization plugin that deal with 3d shapes in this 
>> environment.  All of this work will soon be contributed to open source.
>>
>> For one of the tools, I need to provide 2 select lists on the tool form that 
>> are associated in such a way that when an option in select list 1 is chosen, 
>> the options in select list 2 are altered and re-rendered.  This behavior 
>> would probably use a combination of dynamic options and refresh_on_change 
>> between the 2 associated select lists.
>>
>> I’ve not seen a tool that does this precisely, so I’m hoping that if it is 
>> currently possible to do this within Galaxy tools, someone will point me to 
>> an example.
>>
>> If it is not currently possible, I will contribute a PR for supporting it, 
>> but would like some input as to how it should be done.
>>
>> Dynamic options are currently rendered using 4 approaches; from_file, 
>> from_dataset, from_parameter and from_data_table.  One or more of several 
>> filters can then be applied to the options to alter them if desired.  
>>
>> Since these CSG tools involve new datatypes, I have flexibility into how the 
>> metadata elements are set up that are needed to render these 2 select lists. 
>>  A 

Re: [galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-09-30 Thread Aysam Guerler
If the select field did not properly render before, it should not render
properly now.
___
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/

Re: [galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-09-30 Thread Greg Von Kuster
The answer for this is available here:

http://dev.list.galaxyproject.org/Question-about-using-dynamic-options-and-refresh-on-change-for-rendering-2-associated-select-lists-td4667950.html#none


> On Sep 20, 2015, at 9:56 PM, Greg Von Kuster  wrote:
> 
> Thanks Sam,
> 
> I’ll repost my original question to see if someone can provide an answer.
> 
> Greg Von Kuster
> 
>> On Sep 18, 2015, at 4:20 PM, Aysam Guerler > > wrote:
>> 
>> Hi Greg,
>> 
>> I am not sure which data source would be the most suitable for your use case 
>> (maybe someone else can help here) but either should work and refresh 
>> properly if filtered properly.
>> 
>> Thanks,
>> Sam
>> 
>> On Fri, Sep 18, 2015 at 11:02 AM, Greg Von Kuster > > wrote:
>> Hi Sam,
>> 
>> I have another related question that I’m hoping you can help with.  In my 
>> case, the dataset contains the information I need as the contents of the 
>> test_select_options.txt file, so that file is not static.  The values that 
>> are needed to provide the options in my select list 2 would have to come 
>> from the metadata generated for the dataset.  I investigted using the 
>> dynamic otions “from_file” approach, but looking at the current tools that 
>> use that approach (e.g., maf tools), it seems like it is not quite geared 
>> toward what I need.
>> 
>> Thans again!
>> 
>> Greg
>> 
>> 
>> 
>>> On Sep 18, 2015, at 10:41 AM, Greg Von Kuster >> > wrote:
>>> 
>>> Hi Sam,
>>> 
>>> Thanks for the pointer to the Trello card.  I noticed the card is kind of 
>>> old (I think it predates data tables), so I just wanted to confirm the 
>>> approach.  For my tool, should I use the existing from_file option for 
>>> dynamic options (call the file test_select_options.txt”) with the file 
>>> located in a tool-data directory within a TS repo?  The current TS install 
>>> process would then install test_select_options.txt into the 
>>> ~/shed_tool_data directory within the Galaxy root.  Is this still the 
>>> advised approach, or should the tool that requries test_select_options.txt 
>>> be of type “manage_data”?
>>> 
>>> Thanks!
>>> 
>>> Greg
>>> 
>>> 
 On Sep 18, 2015, at 9:42 AM, Aysam Guerler > wrote:
 
 Hi Greg,
 
 The tool form supports multiple dynamic fields which depend on each other. 
 You may want to take a look at this: 
 https://trello.com/c/NOmjJxCi/428-305-potential-bug-in-dynamic-options-filters
  
 .
 
 Hope this helps,
 Sam
 
 On Fri, Sep 18, 2015 at 8:30 AM, Greg Von Kuster > wrote:
 Hello all,
 
 I’m working on adding support to the Galaxy framework for datatypes in the 
 constructive solid geometry (CSG) space and I have several working Galaxy 
 tools and a visualization plugin that deal with 3d shapes in this 
 environment.  All of this work will soon be contributed to open source.
 
 For one of the tools, I need to provide 2 select lists on the tool form 
 that are associated in such a way that when an option in select list 1 is 
 chosen, the options in select list 2 are altered and re-rendered.  This 
 behavior would probably use a combination of dynamic options and 
 refresh_on_change between the 2 associated select lists.
 
 I’ve not seen a tool that does this precisely, so I’m hoping that if it is 
 currently possible to do this within Galaxy tools, someone will point me 
 to an example.
 
 If it is not currently possible, I will contribute a PR for supporting it, 
 but would like some input as to how it should be done.
 
 Dynamic options are currently rendered using 4 approaches; from_file, 
 from_dataset, from_parameter and from_data_table.  One or more of several 
 filters can then be applied to the options to alter them if desired.  
 
 Since these CSG tools involve new datatypes, I have flexibility into how 
 the metadata elements are set up that are needed to render these 2 select 
 lists.  A dictionary may work where the metadata element contents look 
 like this:
 
 {a: [‘1’, ‘2’], b: [‘3’, ‘4’] }
 
 The options in select list 1 would be ‘a’ and ‘b’.  When ‘a’ is selected, 
 select list 2 would have options ‘1’ and ‘2’, and when ‘b’ is selected, 
 select list 2 would have options ‘3’ and ‘4’.
 
 To support this approach, perhaps dynamic options could be enhanced to 
 include a from_dict option.  There would be some complxity involved in 
 associating the lists using refresh_on_change so that select list 2 is 
 refreshed with the correct options when select list one is changed.  I 
 haven’t 

[galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-09-20 Thread Greg Von Kuster
Hello all,

I’m working on adding support to the Galaxy framework for datatypes in the 
constructive solid geometry (CSG) space and I have several working Galaxy tools 
and a visualization plugin that deal with 3d shapes in this environment.  All 
of this work will soon be contributed to open source.

For one of the tools, I need to provide 2 select lists on the tool form that 
are associated in such a way that when an option in select list 1 is chosen, 
the options in select list 2 are altered and re-rendered.  This behavior would 
probably use a combination of dynamic options and refresh_on_change between the 
2 associated select lists.

I’ve not seen a tool that does this precisely, so I’m hoping that if it is 
currently possible to do this within Galaxy tools, someone will point me to an 
example.

If it is not currently possible, I will contribute a PR for supporting it, but 
would like some input as to how it should be done.

Dynamic options are currently rendered using 4 approaches; from_file, 
from_dataset, from_parameter and from_data_table.  One or more of several 
filters can then be applied to the options to alter them if desired.  

Since these CSG tools involve new datatypes, I have flexibility into how the 
metadata elements are set up that are needed to render these 2 select lists.  A 
dictionary may work where the metadata element contents look like this:

{a: [‘1’, ‘2’], b: [‘3’, ‘4’] }

The options in select list 1 would be ‘a’ and ‘b’.  When ‘a’ is selected, 
select list 2 would have options ‘1’ and ‘2’, and when ‘b’ is selected, select 
list 2 would have options ‘3’ and ‘4’.

To support this approach, perhaps dynamic options could be enhanced to include 
a from_dict option.  There would be some complxity involved in associating the 
lists using refresh_on_change so that select list 2 is refreshed with the 
correct options when select list one is changed.  I haven’t yet worked out 
these details.

Also, using a dictionary will not keep order for the options, so perhaps a list 
of tuples would be better?

[ [ ‘a’, [‘1’, ‘2’]], [‘b’, [‘3’, ‘4’]]]

Can someone let me know if this is currently possible, and if so, an example 
tool that does it?  If it’s not possible, does the above approach seem 
reasonable, or is there a better way?

Thanks very much,

Greg Von Kuster
___
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/

Re: [galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-09-20 Thread Greg Von Kuster
Thanks Sam,

I’ll repost my original question to see if someone can provide an answer.

Greg Von Kuster

> On Sep 18, 2015, at 4:20 PM, Aysam Guerler  > wrote:
> 
> Hi Greg,
> 
> I am not sure which data source would be the most suitable for your use case 
> (maybe someone else can help here) but either should work and refresh 
> properly if filtered properly.
> 
> Thanks,
> Sam
> 
> On Fri, Sep 18, 2015 at 11:02 AM, Greg Von Kuster  > wrote:
> Hi Sam,
> 
> I have another related question that I’m hoping you can help with.  In my 
> case, the dataset contains the information I need as the contents of the 
> test_select_options.txt file, so that file is not static.  The values that 
> are needed to provide the options in my select list 2 would have to come from 
> the metadata generated for the dataset.  I investigted using the dynamic 
> otions “from_file” approach, but looking at the current tools that use that 
> approach (e.g., maf tools), it seems like it is not quite geared toward what 
> I need.
> 
> Thans again!
> 
> Greg
> 
> 
> 
>> On Sep 18, 2015, at 10:41 AM, Greg Von Kuster > > wrote:
>> 
>> Hi Sam,
>> 
>> Thanks for the pointer to the Trello card.  I noticed the card is kind of 
>> old (I think it predates data tables), so I just wanted to confirm the 
>> approach.  For my tool, should I use the existing from_file option for 
>> dynamic options (call the file test_select_options.txt”) with the file 
>> located in a tool-data directory within a TS repo?  The current TS install 
>> process would then install test_select_options.txt into the ~/shed_tool_data 
>> directory within the Galaxy root.  Is this still the advised approach, or 
>> should the tool that requries test_select_options.txt be of type 
>> “manage_data”?
>> 
>> Thanks!
>> 
>> Greg
>> 
>> 
>>> On Sep 18, 2015, at 9:42 AM, Aysam Guerler >> > wrote:
>>> 
>>> Hi Greg,
>>> 
>>> The tool form supports multiple dynamic fields which depend on each other. 
>>> You may want to take a look at this: 
>>> https://trello.com/c/NOmjJxCi/428-305-potential-bug-in-dynamic-options-filters
>>>  
>>> .
>>> 
>>> Hope this helps,
>>> Sam
>>> 
>>> On Fri, Sep 18, 2015 at 8:30 AM, Greg Von Kuster >> > wrote:
>>> Hello all,
>>> 
>>> I’m working on adding support to the Galaxy framework for datatypes in the 
>>> constructive solid geometry (CSG) space and I have several working Galaxy 
>>> tools and a visualization plugin that deal with 3d shapes in this 
>>> environment.  All of this work will soon be contributed to open source.
>>> 
>>> For one of the tools, I need to provide 2 select lists on the tool form 
>>> that are associated in such a way that when an option in select list 1 is 
>>> chosen, the options in select list 2 are altered and re-rendered.  This 
>>> behavior would probably use a combination of dynamic options and 
>>> refresh_on_change between the 2 associated select lists.
>>> 
>>> I’ve not seen a tool that does this precisely, so I’m hoping that if it is 
>>> currently possible to do this within Galaxy tools, someone will point me to 
>>> an example.
>>> 
>>> If it is not currently possible, I will contribute a PR for supporting it, 
>>> but would like some input as to how it should be done.
>>> 
>>> Dynamic options are currently rendered using 4 approaches; from_file, 
>>> from_dataset, from_parameter and from_data_table.  One or more of several 
>>> filters can then be applied to the options to alter them if desired.  
>>> 
>>> Since these CSG tools involve new datatypes, I have flexibility into how 
>>> the metadata elements are set up that are needed to render these 2 select 
>>> lists.  A dictionary may work where the metadata element contents look like 
>>> this:
>>> 
>>> {a: [‘1’, ‘2’], b: [‘3’, ‘4’] }
>>> 
>>> The options in select list 1 would be ‘a’ and ‘b’.  When ‘a’ is selected, 
>>> select list 2 would have options ‘1’ and ‘2’, and when ‘b’ is selected, 
>>> select list 2 would have options ‘3’ and ‘4’.
>>> 
>>> To support this approach, perhaps dynamic options could be enhanced to 
>>> include a from_dict option.  There would be some complxity involved in 
>>> associating the lists using refresh_on_change so that select list 2 is 
>>> refreshed with the correct options when select list one is changed.  I 
>>> haven’t yet worked out these details.
>>> 
>>> Also, using a dictionary will not keep order for the options, so perhaps a 
>>> list of tuples would be better?
>>> 
>>> [ [ ‘a’, [‘1’, ‘2’]], [‘b’, [‘3’, ‘4’]]]
>>> 
>>> Can someone let me know if this is currently possible, and if so, an 
>>> example tool that does it?  If it’s not possible, does the above approach 
>>> seem reasonable, or is there 

Re: [galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-09-20 Thread Greg Von Kuster
Thanks Sam,

I’ll repost my original question to see if someone can provide an answer.

Greg Von Kuster

> On Sep 18, 2015, at 4:20 PM, Aysam Guerler  > wrote:
> 
> Hi Greg,
> 
> I am not sure which data source would be the most suitable for your use case 
> (maybe someone else can help here) but either should work and refresh 
> properly if filtered properly.
> 
> Thanks,
> Sam
> 
> On Fri, Sep 18, 2015 at 11:02 AM, Greg Von Kuster  > wrote:
> Hi Sam,
> 
> I have another related question that I’m hoping you can help with.  In my 
> case, the dataset contains the information I need as the contents of the 
> test_select_options.txt file, so that file is not static.  The values that 
> are needed to provide the options in my select list 2 would have to come from 
> the metadata generated for the dataset.  I investigted using the dynamic 
> otions “from_file” approach, but looking at the current tools that use that 
> approach (e.g., maf tools), it seems like it is not quite geared toward what 
> I need.
> 
> Thans again!
> 
> Greg
> 
> 
> 
>> On Sep 18, 2015, at 10:41 AM, Greg Von Kuster > > wrote:
>> 
>> Hi Sam,
>> 
>> Thanks for the pointer to the Trello card.  I noticed the card is kind of 
>> old (I think it predates data tables), so I just wanted to confirm the 
>> approach.  For my tool, should I use the existing from_file option for 
>> dynamic options (call the file test_select_options.txt”) with the file 
>> located in a tool-data directory within a TS repo?  The current TS install 
>> process would then install test_select_options.txt into the ~/shed_tool_data 
>> directory within the Galaxy root.  Is this still the advised approach, or 
>> should the tool that requries test_select_options.txt be of type 
>> “manage_data”?
>> 
>> Thanks!
>> 
>> Greg
>> 
>> 
>>> On Sep 18, 2015, at 9:42 AM, Aysam Guerler >> > wrote:
>>> 
>>> Hi Greg,
>>> 
>>> The tool form supports multiple dynamic fields which depend on each other. 
>>> You may want to take a look at this: 
>>> https://trello.com/c/NOmjJxCi/428-305-potential-bug-in-dynamic-options-filters
>>>  
>>> .
>>> 
>>> Hope this helps,
>>> Sam
>>> 
>>> On Fri, Sep 18, 2015 at 8:30 AM, Greg Von Kuster >> > wrote:
>>> Hello all,
>>> 
>>> I’m working on adding support to the Galaxy framework for datatypes in the 
>>> constructive solid geometry (CSG) space and I have several working Galaxy 
>>> tools and a visualization plugin that deal with 3d shapes in this 
>>> environment.  All of this work will soon be contributed to open source.
>>> 
>>> For one of the tools, I need to provide 2 select lists on the tool form 
>>> that are associated in such a way that when an option in select list 1 is 
>>> chosen, the options in select list 2 are altered and re-rendered.  This 
>>> behavior would probably use a combination of dynamic options and 
>>> refresh_on_change between the 2 associated select lists.
>>> 
>>> I’ve not seen a tool that does this precisely, so I’m hoping that if it is 
>>> currently possible to do this within Galaxy tools, someone will point me to 
>>> an example.
>>> 
>>> If it is not currently possible, I will contribute a PR for supporting it, 
>>> but would like some input as to how it should be done.
>>> 
>>> Dynamic options are currently rendered using 4 approaches; from_file, 
>>> from_dataset, from_parameter and from_data_table.  One or more of several 
>>> filters can then be applied to the options to alter them if desired.  
>>> 
>>> Since these CSG tools involve new datatypes, I have flexibility into how 
>>> the metadata elements are set up that are needed to render these 2 select 
>>> lists.  A dictionary may work where the metadata element contents look like 
>>> this:
>>> 
>>> {a: [‘1’, ‘2’], b: [‘3’, ‘4’] }
>>> 
>>> The options in select list 1 would be ‘a’ and ‘b’.  When ‘a’ is selected, 
>>> select list 2 would have options ‘1’ and ‘2’, and when ‘b’ is selected, 
>>> select list 2 would have options ‘3’ and ‘4’.
>>> 
>>> To support this approach, perhaps dynamic options could be enhanced to 
>>> include a from_dict option.  There would be some complxity involved in 
>>> associating the lists using refresh_on_change so that select list 2 is 
>>> refreshed with the correct options when select list one is changed.  I 
>>> haven’t yet worked out these details.
>>> 
>>> Also, using a dictionary will not keep order for the options, so perhaps a 
>>> list of tuples would be better?
>>> 
>>> [ [ ‘a’, [‘1’, ‘2’]], [‘b’, [‘3’, ‘4’]]]
>>> 
>>> Can someone let me know if this is currently possible, and if so, an 
>>> example tool that does it?  If it’s not possible, does the above approach 
>>> seem reasonable, or is there 

[galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-09-18 Thread Greg Von Kuster
Hello all,

I’m working on adding support to the Galaxy framework for datatypes in the 
constructive solid geometry (CSG) space and I have several working Galaxy tools 
and a visualization plugin that deal with 3d shapes in this environment.  All 
of this work will soon be contributed to open source.

For one of the tools, I need to provide 2 select lists on the tool form that 
are associated in such a way that when an option in select list 1 is chosen, 
the options in select list 2 are altered and re-rendered.  This behavior would 
probably use a combination of dynamic options and refresh_on_change between the 
2 associated select lists.

I’ve not seen a tool that does this precisely, so I’m hoping that if it is 
currently possible to do this within Galaxy tools, someone will point me to an 
example.

If it is not currently possible, I will contribute a PR for supporting it, but 
would like some input as to how it should be done.

Dynamic options are currently rendered using 4 approaches; from_file, 
from_dataset, from_parameter and from_data_table.  One or more of several 
filters can then be applied to the options to alter them if desired.  

Since these CSG tools involve new datatypes, I have flexibility into how the 
metadata elements are set up that are needed to render these 2 select lists.  A 
dictionary may work where the metadata element contents look like this:

{a: [‘1’, ‘2’], b: [‘3’, ‘4’] }

The options in select list 1 would be ‘a’ and ‘b’.  When ‘a’ is selected, 
select list 2 would have options ‘1’ and ‘2’, and when ‘b’ is selected, select 
list 2 would have options ‘3’ and ‘4’.

To support this approach, perhaps dynamic options could be enhanced to include 
a from_dict option.  There would be some complxity involved in associating the 
lists using refresh_on_change so that select list 2 is refreshed with the 
correct options when select list one is changed.  I haven’t yet worked out 
these details.

Also, using a dictionary will not keep order for the options, so perhaps a list 
of tuples would be better?

[ [ ‘a’, [‘1’, ‘2’]], [‘b’, [‘3’, ‘4’]]]

Can someone let me know if this is currently possible, and if so, an example 
tool that does it?  If it’s not possible, does the above approach seem 
reasonable, or is there a better way?

Thanks very much,

Greg Von Kuster___
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/

Re: [galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-09-18 Thread Greg Von Kuster
Hi Sam,

Thanks for the pointer to the Trello card.  I noticed the card is kind of old 
(I think it predates data tables), so I just wanted to confirm the approach.  
For my tool, should I use the existing from_file option for dynamic options 
(call the file test_select_options.txt”) with the file located in a tool-data 
directory within a TS repo?  The current TS install process would then install 
test_select_options.txt into the ~/shed_tool_data directory within the Galaxy 
root.  Is this still the advised approach, or should the tool that requries 
test_select_options.txt be of type “manage_data”?

Thanks!

Greg


> On Sep 18, 2015, at 9:42 AM, Aysam Guerler  wrote:
> 
> Hi Greg,
> 
> The tool form supports multiple dynamic fields which depend on each other. 
> You may want to take a look at this: 
> https://trello.com/c/NOmjJxCi/428-305-potential-bug-in-dynamic-options-filters
>  
> .
> 
> Hope this helps,
> Sam
> 
> On Fri, Sep 18, 2015 at 8:30 AM, Greg Von Kuster  > wrote:
> Hello all,
> 
> I’m working on adding support to the Galaxy framework for datatypes in the 
> constructive solid geometry (CSG) space and I have several working Galaxy 
> tools and a visualization plugin that deal with 3d shapes in this 
> environment.  All of this work will soon be contributed to open source.
> 
> For one of the tools, I need to provide 2 select lists on the tool form that 
> are associated in such a way that when an option in select list 1 is chosen, 
> the options in select list 2 are altered and re-rendered.  This behavior 
> would probably use a combination of dynamic options and refresh_on_change 
> between the 2 associated select lists.
> 
> I’ve not seen a tool that does this precisely, so I’m hoping that if it is 
> currently possible to do this within Galaxy tools, someone will point me to 
> an example.
> 
> If it is not currently possible, I will contribute a PR for supporting it, 
> but would like some input as to how it should be done.
> 
> Dynamic options are currently rendered using 4 approaches; from_file, 
> from_dataset, from_parameter and from_data_table.  One or more of several 
> filters can then be applied to the options to alter them if desired.  
> 
> Since these CSG tools involve new datatypes, I have flexibility into how the 
> metadata elements are set up that are needed to render these 2 select lists.  
> A dictionary may work where the metadata element contents look like this:
> 
> {a: [‘1’, ‘2’], b: [‘3’, ‘4’] }
> 
> The options in select list 1 would be ‘a’ and ‘b’.  When ‘a’ is selected, 
> select list 2 would have options ‘1’ and ‘2’, and when ‘b’ is selected, 
> select list 2 would have options ‘3’ and ‘4’.
> 
> To support this approach, perhaps dynamic options could be enhanced to 
> include a from_dict option.  There would be some complxity involved in 
> associating the lists using refresh_on_change so that select list 2 is 
> refreshed with the correct options when select list one is changed.  I 
> haven’t yet worked out these details.
> 
> Also, using a dictionary will not keep order for the options, so perhaps a 
> list of tuples would be better?
> 
> [ [ ‘a’, [‘1’, ‘2’]], [‘b’, [‘3’, ‘4’]]]
> 
> Can someone let me know if this is currently possible, and if so, an example 
> tool that does it?  If it’s not possible, does the above approach seem 
> reasonable, or is there a better way?
> 
> Thanks very much,
> 
> Greg Von Kuster
> 
> ___
> 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/

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

Re: [galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-09-18 Thread Greg Von Kuster
Hi Sam,

I have another related question that I’m hoping you can help with.  In my case, 
the dataset contains the information I need as the contents of the 
test_select_options.txt file, so that file is not static.  The values that are 
needed to provide the options in my select list 2 would have to come from the 
metadata generated for the dataset.  I investigted using the dynamic otions 
“from_file” approach, but looking at the current tools that use that approach 
(e.g., maf tools), it seems like it is not quite geared toward what I need.

Thans again!

Greg


> On Sep 18, 2015, at 10:41 AM, Greg Von Kuster  wrote:
> 
> Hi Sam,
> 
> Thanks for the pointer to the Trello card.  I noticed the card is kind of old 
> (I think it predates data tables), so I just wanted to confirm the approach.  
> For my tool, should I use the existing from_file option for dynamic options 
> (call the file test_select_options.txt”) with the file located in a tool-data 
> directory within a TS repo?  The current TS install process would then 
> install test_select_options.txt into the ~/shed_tool_data directory within 
> the Galaxy root.  Is this still the advised approach, or should the tool that 
> requries test_select_options.txt be of type “manage_data”?
> 
> Thanks!
> 
> Greg
> 
> 
>> On Sep 18, 2015, at 9:42 AM, Aysam Guerler > > wrote:
>> 
>> Hi Greg,
>> 
>> The tool form supports multiple dynamic fields which depend on each other. 
>> You may want to take a look at this: 
>> https://trello.com/c/NOmjJxCi/428-305-potential-bug-in-dynamic-options-filters
>>  
>> .
>> 
>> Hope this helps,
>> Sam
>> 
>> On Fri, Sep 18, 2015 at 8:30 AM, Greg Von Kuster > > wrote:
>> Hello all,
>> 
>> I’m working on adding support to the Galaxy framework for datatypes in the 
>> constructive solid geometry (CSG) space and I have several working Galaxy 
>> tools and a visualization plugin that deal with 3d shapes in this 
>> environment.  All of this work will soon be contributed to open source.
>> 
>> For one of the tools, I need to provide 2 select lists on the tool form that 
>> are associated in such a way that when an option in select list 1 is chosen, 
>> the options in select list 2 are altered and re-rendered.  This behavior 
>> would probably use a combination of dynamic options and refresh_on_change 
>> between the 2 associated select lists.
>> 
>> I’ve not seen a tool that does this precisely, so I’m hoping that if it is 
>> currently possible to do this within Galaxy tools, someone will point me to 
>> an example.
>> 
>> If it is not currently possible, I will contribute a PR for supporting it, 
>> but would like some input as to how it should be done.
>> 
>> Dynamic options are currently rendered using 4 approaches; from_file, 
>> from_dataset, from_parameter and from_data_table.  One or more of several 
>> filters can then be applied to the options to alter them if desired.  
>> 
>> Since these CSG tools involve new datatypes, I have flexibility into how the 
>> metadata elements are set up that are needed to render these 2 select lists. 
>>  A dictionary may work where the metadata element contents look like this:
>> 
>> {a: [‘1’, ‘2’], b: [‘3’, ‘4’] }
>> 
>> The options in select list 1 would be ‘a’ and ‘b’.  When ‘a’ is selected, 
>> select list 2 would have options ‘1’ and ‘2’, and when ‘b’ is selected, 
>> select list 2 would have options ‘3’ and ‘4’.
>> 
>> To support this approach, perhaps dynamic options could be enhanced to 
>> include a from_dict option.  There would be some complxity involved in 
>> associating the lists using refresh_on_change so that select list 2 is 
>> refreshed with the correct options when select list one is changed.  I 
>> haven’t yet worked out these details.
>> 
>> Also, using a dictionary will not keep order for the options, so perhaps a 
>> list of tuples would be better?
>> 
>> [ [ ‘a’, [‘1’, ‘2’]], [‘b’, [‘3’, ‘4’]]]
>> 
>> Can someone let me know if this is currently possible, and if so, an example 
>> tool that does it?  If it’s not possible, does the above approach seem 
>> reasonable, or is there a better way?
>> 
>> Thanks very much,
>> 
>> Greg Von Kuster
>> 
>> ___
>> 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 

Re: [galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-09-18 Thread Aysam Guerler
Hi Greg,

The tool form supports multiple dynamic fields which depend on each other.
You may want to take a look at this:
https://trello.com/c/NOmjJxCi/428-305-potential-bug-in-dynamic-options-filters
.

Hope this helps,
Sam

On Fri, Sep 18, 2015 at 8:30 AM, Greg Von Kuster  wrote:

> Hello all,
>
> I’m working on adding support to the Galaxy framework for datatypes in the
> constructive solid geometry (CSG) space and I have several working Galaxy
> tools and a visualization plugin that deal with 3d shapes in this
> environment.  All of this work will soon be contributed to open source.
>
> For one of the tools, I need to provide 2 select lists on the tool form
> that are associated in such a way that when an option in select list 1 is
> chosen, the options in select list 2 are altered and re-rendered.  This
> behavior would probably use a combination of dynamic options and
> refresh_on_change between the 2 associated select lists.
>
> I’ve not seen a tool that does this precisely, so I’m hoping that if it is
> currently possible to do this within Galaxy tools, someone will point me to
> an example.
>
> If it is not currently possible, I will contribute a PR for supporting it,
> but would like some input as to how it should be done.
>
> Dynamic options are currently rendered using 4 approaches; from_file,
> from_dataset, from_parameter and from_data_table.  One or more of several
> filters can then be applied to the options to alter them if desired.
>
> Since these CSG tools involve new datatypes, I have flexibility into how
> the metadata elements are set up that are needed to render these 2 select
> lists.  A dictionary may work where the metadata element contents look like
> this:
>
> {a: [‘1’, ‘2’], b: [‘3’, ‘4’] }
>
> The options in select list 1 would be ‘a’ and ‘b’.  When ‘a’ is selected,
> select list 2 would have options ‘1’ and ‘2’, and when ‘b’ is selected,
> select list 2 would have options ‘3’ and ‘4’.
>
> To support this approach, perhaps dynamic options could be enhanced to
> include a from_dict option.  There would be some complxity involved in
> associating the lists using refresh_on_change so that select list 2 is
> refreshed with the correct options when select list one is changed.  I
> haven’t yet worked out these details.
>
> Also, using a dictionary will not keep order for the options, so perhaps a
> list of tuples would be better?
>
> [ [ ‘a’, [‘1’, ‘2’]], [‘b’, [‘3’, ‘4’]]]
>
> Can someone let me know if this is currently possible, and if so, an
> example tool that does it?  If it’s not possible, does the above approach
> seem reasonable, or is there a better way?
>
> Thanks very much,
>
> Greg Von Kuster
>
> ___
> 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/

Re: [galaxy-dev] Question about using dynamic options and refresh_on_change for rendering 2 associated select lists

2015-09-18 Thread Aysam Guerler
Hi Greg,

I am not sure which data source would be the most suitable for your use
case (maybe someone else can help here) but either should work and refresh
properly if filtered properly.

Thanks,
Sam

On Fri, Sep 18, 2015 at 11:02 AM, Greg Von Kuster  wrote:

> Hi Sam,
>
> I have another related question that I’m hoping you can help with.  In my
> case, the dataset contains the information I need as the contents of the
> test_select_options.txt file, so that file is not static.  The values that
> are needed to provide the options in my select list 2 would have to come
> from the metadata generated for the dataset.  I investigted using the
> dynamic otions “from_file” approach, but looking at the current tools that
> use that approach (e.g., maf tools), it seems like it is not quite geared
> toward what I need.
>
> Thans again!
>
> Greg
>
>
>
> On Sep 18, 2015, at 10:41 AM, Greg Von Kuster  wrote:
>
> Hi Sam,
>
> Thanks for the pointer to the Trello card.  I noticed the card is kind of
> old (I think it predates data tables), so I just wanted to confirm the
> approach.  For my tool, should I use the existing from_file option for
> dynamic options (call the file test_select_options.txt”) with the file
> located in a tool-data directory within a TS repo?  The current TS install
> process would then install test_select_options.txt into the
> ~/shed_tool_data directory within the Galaxy root.  Is this still the
> advised approach, or should the tool that requries test_select_options.txt
> be of type “manage_data”?
>
> Thanks!
>
> Greg
>
>
> On Sep 18, 2015, at 9:42 AM, Aysam Guerler 
> wrote:
>
> Hi Greg,
>
> The tool form supports multiple dynamic fields which depend on each other.
> You may want to take a look at this:
> https://trello.com/c/NOmjJxCi/428-305-potential-bug-in-dynamic-options-filters
> .
>
> Hope this helps,
> Sam
>
> On Fri, Sep 18, 2015 at 8:30 AM, Greg Von Kuster  wrote:
>
>> Hello all,
>>
>> I’m working on adding support to the Galaxy framework for datatypes in
>> the constructive solid geometry (CSG) space and I have several working
>> Galaxy tools and a visualization plugin that deal with 3d shapes in this
>> environment.  All of this work will soon be contributed to open source.
>>
>> For one of the tools, I need to provide 2 select lists on the tool form
>> that are associated in such a way that when an option in select list 1 is
>> chosen, the options in select list 2 are altered and re-rendered.  This
>> behavior would probably use a combination of dynamic options and
>> refresh_on_change between the 2 associated select lists.
>>
>> I’ve not seen a tool that does this precisely, so I’m hoping that if it
>> is currently possible to do this within Galaxy tools, someone will point me
>> to an example.
>>
>> If it is not currently possible, I will contribute a PR for supporting
>> it, but would like some input as to how it should be done.
>>
>> Dynamic options are currently rendered using 4 approaches; from_file,
>> from_dataset, from_parameter and from_data_table.  One or more of several
>> filters can then be applied to the options to alter them if desired.
>>
>> Since these CSG tools involve new datatypes, I have flexibility into how
>> the metadata elements are set up that are needed to render these 2 select
>> lists.  A dictionary may work where the metadata element contents look like
>> this:
>>
>> {a: [‘1’, ‘2’], b: [‘3’, ‘4’] }
>>
>> The options in select list 1 would be ‘a’ and ‘b’.  When ‘a’ is selected,
>> select list 2 would have options ‘1’ and ‘2’, and when ‘b’ is selected,
>> select list 2 would have options ‘3’ and ‘4’.
>>
>> To support this approach, perhaps dynamic options could be enhanced to
>> include a from_dict option.  There would be some complxity involved in
>> associating the lists using refresh_on_change so that select list 2 is
>> refreshed with the correct options when select list one is changed.  I
>> haven’t yet worked out these details.
>>
>> Also, using a dictionary will not keep order for the options, so perhaps
>> a list of tuples would be better?
>>
>> [ [ ‘a’, [‘1’, ‘2’]], [‘b’, [‘3’, ‘4’]]]
>>
>> Can someone let me know if this is currently possible, and if so, an
>> example tool that does it?  If it’s not possible, does the above approach
>> seem reasonable, or is there a better way?
>>
>> Thanks very much,
>>
>> Greg Von Kuster
>>
>> ___
>> 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