Hi all, 
  this would help in a tool I’m trying to write too but the problem I have implementing this approach is that my script will need an external python module - is there any way that I can list dependencies for the script?  As it happens these are the same dependancies that the tool itself will need once executed.

Thanks,

Steve

Department of Computing, Macquarie University
http://web.science.mq.edu.au/~cassidy

On 24 Nov 2017, at 6:52 pm, Hans-Rudolf Hotz <hrh@fmi.ch> wrote:

Hi Evan

Yes, this is possible with "dynamic_options"

e.g.:

<tool ...

<inputs>

<param name="year" type="select" label="from which year"
    display="radio" refresh_on_change="true" >
             <option value="/2017" selected="true">2017</option>
     <option value="/2016">2016</option>
             <option value="/2015">2015</option>
</param>

<param name="file" type="select" label="select a run"
   display="radio"
   dynamic_options="ds_readFiles(year)"/>


</inputs>
<outputs>
...
</outputs>
<help>
...
</help>
<code file="more_code.py" />

</tool>

The python function "ds_readFiles" is defined in a extra code file
"more_code.py", which is stored in the same directory as the tool definition file. The function returns all files with a matching file name (i.e.year), and could look like:


rDir = "/data/"

def ds_readFiles(year):

   l = os.listdir(rDir)
   p = re.compile('^%s_[0­9]{4}_M[0­9]{5}_[0­9]'%year)
   l.sort()
   path = rDir
   filesoptions = [(s) for s in l if os.path.exists(path + s)]
   files = [(s,s,False) for s in filesoptions if p.match(s)]
   return files



a similar case is also described here:

http://dev.list.galaxyproject.org/Dynamic-Tool-Parameter-Lists-td4175828.html


Hope this helps, Hans-Rudolf


On 11/23/2017 06:02 PM, Evan Clark wrote:
Is it possible to execute a script within a tool xml confit to retrieve
some data and append to the ui depending on the requested data. I.e if I
wanted to get a list of files and provide them as select options before
hitting the execute button.


---
Sent from VMware Boxer


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

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