Hello Martin, Galaxy already provides the ability to do this using the UniqueValueFilter class in ~/lib/galaxy/tools/parameters/ dynamic_options.py. For an example of how this works, see the tool config for the extract_GFF_Features tool in ~/tools/extract, which includes tags like the following: <param name="feature" type="select" multiple="true" label="Extract features" help="Multi-select list - hold the appropriate key while clicking to select multiple columns"> <options from_dataset="input1"> <column name="name" index="0"/> <column name="value" index="0"/> <filter type="unique_value" name="unique" column="0"/> </options> </param> On Dec 20, 2009, at 11:06 PM, Martin Aryee wrote:
Hi Greg,
Thanks for the feedback. I've now been able to use set_meta() to set my metadata as I'd like.
Regarding the SelectToolParameter, I'd like to dynamically generate the options from all the unique values in a column in an input data set. The column number is specified in the dataset's metadata. From the tool config section on the wiki page it doesn't look like this particular functionality is available. Am I right in thinking I should go ahead and define a new SelectToolParameter subclass?
Thanks, Martin.
On Fri, Dec 18, 2009 at 11:04 AM, Greg Von Kuster <greg@bx.psu.edu> wrote: Hello Martin,
From your brief description of what you are trying to do, I don't see the need for tool hooks. The SelectToolParameter can be dynamically generated using tool config settings. Metadata is set as part of the job, so the set_meta() method of the data type of the output dataset can be enhanced to set whatever metadata you want.
We have been migrating what used to be done in tool code hooks into the Galaxy framework, although the framework still supports hooks for now.
On Dec 9, 2009, at 2:17 PM, Martin Aryee wrote:
Hi,
I'm trying to work out how to run custom python code as a tool is loaded (to get generate options for a select parameter) and after job completion (to set metadata). It looks like the <code> tags would have been the place to point to my code, but since they are now deprecated I was wondering if someone could point me in the right direction?
Thanks, Martin Aryee.
_______________________________________________ galaxy-dev mailing list galaxy-dev@lists.bx.psu.edu http://lists.bx.psu.edu/listinfo/galaxy-dev
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu