Question: How to access user preferences from inside tool XML
0
gravatar for christopherbare
3.9 years ago by
United States
christopherbare • 10 wrote:

I defined a form using Admin | Form Definitions | Manage form definitions, which contains settings for a tool. Now, I'm wondering if I can access that my the Galaxy Tool XML File.

What I'm hoping to do is fill in defaults settings for the tool's parameters and include an API key for accessing a remote web service that requires a login

The genomespace tool does something like this with OpenID credentials:

#set $username = $__user__.preferences.get( 'genomespace_username', None )
#set $token = $__user__.preferences.get( 'genomespace_token', None )

But, I'd like to do it with the User Information form, if possible. Any hints?

 

tool galaxy • 879 views
ADD COMMENT • link • modified 3.8 years ago • written 3.9 years ago by christopherbare • 10
2
gravatar for christopherbare
3.8 years ago by
United States
christopherbare • 10 wrote:

Cool, this does work. The command section of my galaxy tool XML file looks something like this:

  <command interpreter="python">foo_script.py
    --html "$html_outfile"
    foo
    #set $param_a = $__user__.values.content.get( 'my_app_param_a', None )
    #set $param_b = $__user__.values.content.get( 'my_app_param_b', None )
    --a "${param_a}"
    --b "${param_b}"
  </command>

 

ADD COMMENT • link written 3.8 years ago by christopherbare • 10

Glad you figured this out, and thanks for following up with a way to do it!

ADD REPLY • link written 3.8 years ago by Dannon Baker ♦ 3.7k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 186 users visited in the last hour