Tool param type "library_data"

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

Tool param type "library_data"

Dooley, Damion
I just discovered a scant reference to this on the ToolSyntax page, and tracked it down to something that looks like it was introduced around 2011:  a "LibraryDatasetToolParameter"


http://bitbucket.org/galaxy/galaxy-central/changeset/8553b02ce9ee/
changeset:   8553b02ce9ee
user:        kanwei
date:        2011-07-19 03:56:23
summary:     Tools: Add new LibraryDataset tool parameter to expose LDDAs to tools. Use trackster's modal popup interface for item selection. Add new InputWrapper that exposes LDDA templates as well.

Now I can't quite fathom the syntax around this but it appears to be broken - python error displayed:

TypeError: get_initial_value() got an unexpected keyword argument 'history'

Which is because in the galaxy code the
   
   def get_initial_value( self, trans, context )

function is missing a "history=None" parameter like other types have?!

But is this input type essentially discontinued (no other refs to it on the web) or is it supposed to be operational?

I was hoping for a tool input that would list a particular libraries datasets, so that I could obtain their file paths for use in my tool.

<param name="test" type="library_data" label="test" help="test help"/>
   <options library="Reference Bins">
</param>

Regards,

Damion


Hsiao lab, BC Public Health Microbiology & Reference Laboratory, BC Centre for Disease Control
655 West 12th Avenue, Vancouver, British Columbia, V5Z 4R4 Canada
___________________________________________________________
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/
| Threaded
Open this post in threaded view
|

Re: Tool param type "library_data"

James Taylor
It was only ever used for one tool that I know of, but we should make
it work since we try to never break backward compatibility. If you add
the 'history=None' kwarg is that sufficient to fix the problem?

However, I think a better solution to this problem is to build it into
dataset parameters. Anywhere a dataset can be provided it should be an
option to provide a library dataset. Then one could imagine an option
to restrict to only library datasets and a specific library.




-- jt


On Wed, Jan 14, 2015 at 7:08 PM, Dooley, Damion <[hidden email]> wrote:

> I just discovered a scant reference to this on the ToolSyntax page, and tracked it down to something that looks like it was introduced around 2011:  a "LibraryDatasetToolParameter"
>
>
> http://bitbucket.org/galaxy/galaxy-central/changeset/8553b02ce9ee/
> changeset:   8553b02ce9ee
> user:        kanwei
> date:        2011-07-19 03:56:23
> summary:     Tools: Add new LibraryDataset tool parameter to expose LDDAs to tools. Use trackster's modal popup interface for item selection. Add new InputWrapper that exposes LDDA templates as well.
>
> Now I can't quite fathom the syntax around this but it appears to be broken - python error displayed:
>
> TypeError: get_initial_value() got an unexpected keyword argument 'history'
>
> Which is because in the galaxy code the
>
>    def get_initial_value( self, trans, context )
>
> function is missing a "history=None" parameter like other types have?!
>
> But is this input type essentially discontinued (no other refs to it on the web) or is it supposed to be operational?
>
> I was hoping for a tool input that would list a particular libraries datasets, so that I could obtain their file paths for use in my tool.
>
> <param name="test" type="library_data" label="test" help="test help"/>
>    <options library="Reference Bins">
> </param>
>
> Regards,
>
> Damion
>
>
> Hsiao lab, BC Public Health Microbiology & Reference Laboratory, BC Centre for Disease Control
> 655 West 12th Avenue, Vancouver, British Columbia, V5Z 4R4 Canada
> ___________________________________________________________
> 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/
| Threaded
Open this post in threaded view
|

Re: Tool param type "library_data"

Dooley, Damion
Hi,

Almost!

    def get_initial_value( self, trans, context, history=None ):

in /lib/galaxy/tools/parameters/basic.py under class LibraryDatasetToolParameter( ToolParameter ) gets past the error.  Now a popup with "Grid failed" appears, with an OK button that cleanly exits (see attached).  So I guess that part is still broken unless there is more to the input parameter setup.  I had tested with

<param name="test" type="library_data" label="test" help="test help"/>

I do like your better solution though, esp. if above control can't be primed with the desired library or folder.

d.


Hsiao lab, BC Public Health Microbiology & Reference Laboratory, BC Centre for Disease Control
655 West 12th Avenue, Vancouver, British Columbia, V5Z 4R4 Canada
________________________________________
From: James Taylor [[hidden email]]
Sent: Thursday, January 15, 2015 12:53 AM
To: Dooley, Damion
Cc: [hidden email]
Subject: Re: [galaxy-dev] Tool param type "library_data"

It was only ever used for one tool that I know of, but we should make
it work since we try to never break backward compatibility. If you add
the 'history=None' kwarg is that sufficient to fix the problem?

However, I think a better solution to this problem is to build it into
dataset parameters. Anywhere a dataset can be provided it should be an
option to provide a library dataset. Then one could imagine an option
to restrict to only library datasets and a specific library.

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

Selection_163.png (62K) Download Attachment
| Threaded
Open this post in threaded view
|

Re: Tool param type "library_data"

Aysam Guerler
Hi Damion,

I will look into this.

Thanks,
Sam

On Thu, Jan 15, 2015 at 3:30 PM, Dooley, Damion <[hidden email]> wrote:
Hi,

Almost!

    def get_initial_value( self, trans, context, history=None ):

in /lib/galaxy/tools/parameters/basic.py under class LibraryDatasetToolParameter( ToolParameter ) gets past the error.  Now a popup with "Grid failed" appears, with an OK button that cleanly exits (see attached).  So I guess that part is still broken unless there is more to the input parameter setup.  I had tested with

<param name="test" type="library_data" label="test" help="test help"/>

I do like your better solution though, esp. if above control can't be primed with the desired library or folder.

d.


Hsiao lab, BC Public Health Microbiology & Reference Laboratory, BC Centre for Disease Control
655 West 12th Avenue, Vancouver, British Columbia, V5Z 4R4 Canada
________________________________________
From: James Taylor [[hidden email]]
Sent: Thursday, January 15, 2015 12:53 AM
To: Dooley, Damion
Cc: [hidden email]
Subject: Re: [galaxy-dev] Tool param type "library_data"

It was only ever used for one tool that I know of, but we should make
it work since we try to never break backward compatibility. If you add
the 'history=None' kwarg is that sufficient to fix the problem?

However, I think a better solution to this problem is to build it into
dataset parameters. Anywhere a dataset can be provided it should be an
option to provide a library dataset. Then one could imagine an option
to restrict to only library datasets and a specific library.

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

Re: Tool param type "library_data"

Aysam Guerler
Hi Damion,


Thanks for reporting the issue,
Sam

On Thu, Jan 15, 2015 at 3:42 PM, Aysam Guerler <[hidden email]> wrote:
Hi Damion,

I will look into this.

Thanks,
Sam

On Thu, Jan 15, 2015 at 3:30 PM, Dooley, Damion <[hidden email]> wrote:
Hi,

Almost!

    def get_initial_value( self, trans, context, history=None ):

in /lib/galaxy/tools/parameters/basic.py under class LibraryDatasetToolParameter( ToolParameter ) gets past the error.  Now a popup with "Grid failed" appears, with an OK button that cleanly exits (see attached).  So I guess that part is still broken unless there is more to the input parameter setup.  I had tested with

<param name="test" type="library_data" label="test" help="test help"/>

I do like your better solution though, esp. if above control can't be primed with the desired library or folder.

d.


Hsiao lab, BC Public Health Microbiology & Reference Laboratory, BC Centre for Disease Control
655 West 12th Avenue, Vancouver, British Columbia, V5Z 4R4 Canada
________________________________________
From: James Taylor [[hidden email]]
Sent: Thursday, January 15, 2015 12:53 AM
To: Dooley, Damion
Cc: [hidden email]
Subject: Re: [galaxy-dev] Tool param type "library_data"

It was only ever used for one tool that I know of, but we should make
it work since we try to never break backward compatibility. If you add
the 'history=None' kwarg is that sufficient to fix the problem?

However, I think a better solution to this problem is to build it into
dataset parameters. Anywhere a dataset can be provided it should be an
option to provide a library dataset. Then one could imagine an option
to restrict to only library datasets and a specific library.

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

Re: Tool param type "library_data"

Dooley, Damion
Just to summarize what I found about getting tool parameter <param type="library_data" > going again (though a future expansion of dataset parameters to handle this would be great, esp. if one can specify a particular data library):

1) Aysam's patch (thanks!)
2) Tool_form.mako has a hardcoded url that doesn't work for galaxy installs that have a prefix so that needs adjustment:

  $(".add-librarydataset").click(function() {
                var link = $(this);
                $.ajax({
                    url: "/visualization/list_libraries",

Now one gets the popup form in one's tool where one or more library datasets can be selected.  Selecting one or more gets them listed in one's tool form.

However, I'm not understanding how to get those items submitted with galaxy form <command> params.  I tried for example:
  -B "$library_datasets[0].file_name"
and also tried a loop to enumerate the dataset file names.

I keep on getting:

File "cheetah_DynamicallyCompiledCheetahTemplate_1421706558_2_37415.py", line 203, in respond
TypeError: object of type 'LibraryDatasetValueWrapper' has no len()

If anyone knows the solution, that would be appreciated.

Damion

Hsiao lab, BC Public Health Microbiology & Reference Laboratory, BC Centre for Disease Control
655 West 12th Avenue, Vancouver, British Columbia, V5Z 4R4 Canada
___________________________________________________________
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/