Question: filter tool data table (remove_value)
0
gravatar for david.christiany
5 weeks ago by
david.christiany10 wrote:

Hi,

I use a tool data table to build a dropdown menu. I have my table defined in tool_data_table_conf.xml, and a proper loc file. My dropdown menu is built and fonctional.

My problem is with the filter tag. I try to remove line I don't want in my dropdown menu with <filter>. Lines I want to remove have a keyword in a specific column, I just wan to filter lines from that.

What I did after reading the galaxy doc is :

<param name="proteinatlas" type="select" label="Human Protein Atlas" >
    <options from_data_table="proteore_protein_atlas" >
        <filter type="remove_value" key="value" value="HPA_pathology"/>
    </options>
</param>

Where key is the column name and value is the keyword of lines I want to remove.

All I get is an error :

File "/home/dchristiany/proteore_project/galaxy/lib/galaxy/tools/parameters/dynamic_options.py", line 422, in filter_options
    return [(disp_name, optval, selected) for disp_name, optval, selected in options if not compare_value(optval, value)]
ValueError: too many values to unpack

Can someone can help me or tell me where I can find more instructions to use this filter tag ?

ADD COMMENTlink modified 5 weeks ago by Jennifer Hillman Jackson25k • written 5 weeks ago by david.christiany10
0
gravatar for Jennifer Hillman Jackson
5 weeks ago by
United States
Jennifer Hillman Jackson25k wrote:

Hi,

I'm personally not quite sure how to model this filter. In particular, how to model with respect to the newer macros available (should any be usable for this specific filter). I don't know of a tool that performs a filter like this currently, but of course, one or more may exist that could be used as an example.

The existing filters are based on tool form entry data to filter down the genome select list presented in the GUI. It seems entirely possible that the same filter action could be based on hard-coded criteria included in the wrapper. Another option would be to add the filter as a parameter on the tool form (with your filter criteria as the default, or better, left blank but supply suggested filter keywords in help text under the option. That would allow the tool/select/filter to be used by others, for their filter criteria, should you choose to publish the tool. Being able to filter genome select lists on more than the dbkey seems useful (across tools).

I asked for advice from the development community at Gitter. They will reply here or there. Also please feel free to comment at Gitter -- sometimes this type of help goes faster in a chat, especially for follow-up/minor tunings: https://gitter.im/galaxyproject/Lobby?at=5bcf8c60ab17df2631dcb864

If you are not using Planemo already for tool development, that will be the first thing to start doing (not just for this issue but for publishing to the ToolShed, tool test creation, etc). I included a link to a particular example in the Planemo docs in the post above and but here is the direct link: https://planemo.readthedocs.io/.

Thanks and let's see what they write back, Jen, Galaxy team

ADD COMMENTlink written 5 weeks ago by Jennifer Hillman Jackson25k

Update: I didn't see this earlier: https://github.com/galaxyproject/tools-iuc/issues/2151. It looks like you found a bug and it is getting fixed. Thanks for reporting the problem!

ADD REPLYlink written 5 weeks ago by Jennifer Hillman Jackson25k

Thanks for your help, I will try to add the filter as a parameter as you suggest until the pull request is validated (https://github.com/galaxyproject/galaxy/pull/6914). I will take a look at gitter, it may be more convenient indeed.

ADD REPLYlink written 5 weeks 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