Question: Using value from file in when condition in galaxy xml
0
gravatar for david.christiany
4 months ago by
david.christiany10 wrote:

Hi everyone,

I started to use the option from_data_table in xml file instead of from_file as it is recommended by galaxy. It works well when I write the name defined in the tool_data_table, for example :

xml file : <param name="species" type="select" label="Select species for ID conversion" > <options from_data_table="id_mapping_file"/> </param>

tool_data_table : <tables> <table name="id_mapping_file" comment_char="#"> <columns>value, name, path</columns> <file path="tool-data/id_mapping_file.loc" /> </table> </tables>

id_mapping_file.loc : human_id_mapping Human (homo sapiens) [path]/human_id_mapping_file.tsv mouse_id_mapping Mouse (Mus musculus) [path]/mouse_id_mapping.tsv

I have a dropdown menu with two choices : Human (homo sapiens) and Mouse (Mus musculus).

But when I try to use the value from the loc file in a conditional, the value appears as not defined, for example :

xml_file : <conditional name="species"> <param name="mapping_file" type="select" label="Select species for ID conversion" > <options from_data_table="id_mapping_file"/> </param> <when value="human_id_mapping"> something... </when> <when value="mouse_id_mapping"> something... </when> </conditional>

It is not working and I get the following error with planemo lint : .. WARNING: No <option /> found for when block 'human_id_mapping' inside conditional 'species' .. WARNING: No <option /> found for when block 'mouse_id_mapping' inside conditional 'species'

Does anyone knows how to use values from a loc file in conditional statement ? I can only use it in the command section ($species.mapping_file).

ADD COMMENTlink modified 4 months ago • written 4 months ago by david.christiany10
2
gravatar for david.christiany
4 months ago by
david.christiany10 wrote:

I figured it out, I added options present in my loc file with the "option" tag and it works : <param name="mapping_file" type="select" label="Select species for ID conversion" > <options from_data_table="id_mapping_file"/> <option value="human_id_mapping"></option> <option value="mouse_id_mapping"></option> </param>

Only the names from the loc file appears in the dropdown menu. It seems that since names are already defined in the loc file, it is not added to the dropdown menu but allow you to use conditional (when tag).

ADD COMMENTlink written 4 months ago by david.christiany10
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: 172 users visited in the last hour