tool development: select options from file, how to provide file?

I’m setting up a wrapper for a script we use, and need to populate a select field from a file. I’m struggling with the concept of data_tables, data manager, data manager tools etc. All I want is:

  • i have mytool/mytool.xml with the tool definition
  • i have mytool/options.loc (or csv, or txt) with a list of options (it is a list of parameters to choose from that can be extracted from a raw file)
  • i want to define a param of type select in mytool.xml that lets me choose from an item in options.loc. This is not a link to external data, it’s simply a table.
  • These parameters should be there automatically when the tool is installed, not installed separately.
  • I don’t understand how a .loc file differs from a regular TSV. Is there some info about LOC files?
  • Is my only option to hardcode the values in the mytool.xml?

It seems that simply accessing this file directly does not work, because it has to reside somewhere else. There seems to be the mechanism of a “data manager” which points to a tool which returns data which then form a table, but I don’t understand where to start. I have looked at the documentation at:
data managers
data managers
data manager xml syntax
but these look like they’re covering use cases much more complex than mine.

I have also looked at data tables but it seems that the admin would have to add the data table by hand to tool_data_table_conf.xml after installing the tool, do I understand that correctly? Overall it just seems more complex than I would expect to provide a simple list of options sourced from a file…

Hi @meowcat

I’ve cross posted your question over to the Developers chat to bring in help. They may reply here or there, and feel free to join the chat. You're invited to talk on Matrix


In general tool developers do not need to worry about the installation of data tables. This happens automatically during tool installation.

The content of the data tables can be changed manually by the admin and/or via data managers (also by the admin). In general you should create:

  • tool_data_table_conf.xml.sample
  • tool-data/DATATABLENAME.loc.sample

which define the columns of the data table and initial content (the loc.sample file usually contains also a bit of docs).

For tool tests also create

  • tool_data_table_conf.xml.test which contains a link to a loc file in the test-data directory.

Maybe dada2 is a good example tools-iuc/tools/dada2 at main · galaxyproject/tools-iuc · GitHub.

In the tools you need then to create a dynamic select using the from_datatable option: tools-iuc/tools/dada2/dada2_assignTaxonomyAddspecies.xml at 8ff9ada22d22cb94ddfff51bcdd3ab7d30104f1a · galaxyproject/tools-iuc · GitHub

1 Like