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

**URL:** <https://help.galaxyproject.org/t/tool-development-select-options-from-file-how-to-provide-file/11774>\
**Category:** Uncategorized\
**Tags:** development-tools, microgalaxy\
**Created:** [February 23, 2024, 10:59am UTC](https://help.galaxyproject.org/t/tool-development-select-options-from-file-how-to-provide-file/11774 "2024-02-23T10:59:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![meowcat](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@meowcat](https://help.galaxyproject.org/u/meowcat)\
**Post date:** [February 23, 2024, 10:59am UTC](https://help.galaxyproject.org/t/tool-development-select-options-from-file-how-to-provide-file/11774/1 "2024-02-23T10:59:10Z")

</div>

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](https://galaxyproject.org/admin/tools/data-managers/)  
[data managers](https://docs.galaxyproject.org/en/latest/dev/data_managers.html)  
[data manager xml syntax](https://galaxyproject.org/admin/tools/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](https://galaxyproject.org/admin/tools/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…

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [February 23, 2024, 7:29pm UTC](https://help.galaxyproject.org/t/tool-development-select-options-from-file-how-to-provide-file/11774/2 "2024-02-23T19:29:23Z")

</div>

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](https://matrix.to/#/!fVQwotRzniGGJbeUUi:gitter.im/$JM7ki4jtcaH0DaPyE63akMPUPWkh3eHXAhJfnNlLK-s?via=gitter.im&via=matrix.org)

Resources:

- [Development in Galaxy / Tutorial List](https://training.galaxyproject.org/training-material/topics/dev/) – tool development topics
- [Galaxy Main ToolShed](https://toolshed.g2.bx.psu.edu/) – existing tools for reference

---

<div class="post-metadata">

**Author:** ![bernt-matthias](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/bernt-matthias/32/502_2.png) [@bernt-matthias](https://help.galaxyproject.org/u/bernt-matthias)\
**Post date:** [February 23, 2024, 7:49pm UTC](https://help.galaxyproject.org/t/tool-development-select-options-from-file-how-to-provide-file/11774/3 "2024-02-23T19:49:13Z")

</div>

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](https://github.com/galaxyproject/tools-iuc/blob/main/tools/dada2/).

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](https://github.com/galaxyproject/tools-iuc/blob/8ff9ada22d22cb94ddfff51bcdd3ab7d30104f1a/tools/dada2/dada2_assignTaxonomyAddspecies.xml#L75)
