Tool XML parameter options from locally stored files
Hi, I am trying to write a tool xml file and want to do the following: I have a number of GTF files stored locally and referenced in a data table. I give the user a drop down list of those available using the following code: <param name="gtf" type="select" label="GTF File"> <options from_data_table="gtf_files"/> </param> I then want them to choose an annotation type based on those present in the selected gtf file above. It seems simple enough to do this if the gtf file is in your history already: <param name="feature" type="select" multiple="true" label="Extract features"> <options from_dataset="gtf"> <column name="name" index="2"/> <column name="value" index="2"/> <filter type="unique_value" name="unique" column="2"/> </options> </param> But is there a way to query locally stored files via datatables/.loc files to pull out options when the file is dynamically chosen by a different parameter? This code is also wrapped in a conditional, I'm not sure if that will affect anything. Thanks Shaun -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
Hello Shaun, Use the 'from_file' option. The referenced file should be in the ~/tool-data directory in the Galaxy root. There are several example tools in the distribution that use this option. Here is the example code from the annotation profiler tool: <param name="table_names" type="drill_down" display="checkbox" hierarchy="recurse" multiple="true" label="Choose Tables to Use" help="Selecting no tables will result in using all tables." from_file="annotation_profiler_options.xml"/> and here is an example from the microbial import tool: <param name="kingdom" type="select" label="Select the Desired Kingdom"> <options from_file="microbial_data.loc" startswith="ORG"> <column name="name" index="3"/> <column name="value" index="3"/> <filter type="unique_value" name="unique" column="3"/> </options> </param> On Jul 13, 2011, at 6:17 AM, SHAUN WEBB wrote:
Hi,
I am trying to write a tool xml file and want to do the following:
I have a number of GTF files stored locally and referenced in a data table. I give the user a drop down list of those available using the following code:
<param name="gtf" type="select" label="GTF File"> <options from_data_table="gtf_files"/> </param>
I then want them to choose an annotation type based on those present in the selected gtf file above. It seems simple enough to do this if the gtf file is in your history already:
<param name="feature" type="select" multiple="true" label="Extract features">
<options from_dataset="gtf">
<column name="name" index="2"/>
<column name="value" index="2"/>
<filter type="unique_value" name="unique" column="2"/>
</options>
</param>
But is there a way to query locally stored files via datatables/.loc files to pull out options when the file is dynamically chosen by a different parameter?
This code is also wrapped in a conditional, I'm not sure if that will affect anything.
Thanks Shaun
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu
Hi Greg, I'm not sure if this answers my question. Using options_from_file is fine if I want to refer to the same file each time. In this case I want the first select to choose which gtf file to look at (by species) and the second select to pull options (gtf annotation types) from this file. So I would somehow have to reference the file using the first parameter rather than giving a hard-coded path. Is that possible? Shaun Quoting Greg Von Kuster <greg@bx.psu.edu> on Wed, 13 Jul 2011 09:23:19 -0400:
Hello Shaun,
Use the 'from_file' option. The referenced file should be in the ~/tool-data directory in the Galaxy root. There are several example tools in the distribution that use this option. Here is the example code from the annotation profiler tool:
<param name="table_names" type="drill_down" display="checkbox" hierarchy="recurse" multiple="true" label="Choose Tables to Use" help="Selecting no tables will result in using all tables." from_file="annotation_profiler_options.xml"/>
and here is an example from the microbial import tool:
<param name="kingdom" type="select" label="Select the Desired Kingdom"> <options from_file="microbial_data.loc" startswith="ORG"> <column name="name" index="3"/> <column name="value" index="3"/> <filter type="unique_value" name="unique" column="3"/> </options> </param>
On Jul 13, 2011, at 6:17 AM, SHAUN WEBB wrote:
Hi,
I am trying to write a tool xml file and want to do the following:
I have a number of GTF files stored locally and referenced in a data table. I give the user a drop down list of those available using the following code:
<param name="gtf" type="select" label="GTF File"> <options from_data_table="gtf_files"/> </param>
I then want them to choose an annotation type based on those present in the selected gtf file above. It seems simple enough to do this if the gtf file is in your history already:
<param name="feature" type="select" multiple="true" label="Extract features">
<options from_dataset="gtf">
<column name="name" index="2"/>
<column name="value" index="2"/>
<filter type="unique_value" name="unique" column="2"/>
</options>
</param>
But is there a way to query locally stored files via datatables/.loc files to pull out options when the file is dynamically chosen by a different parameter?
This code is also wrapped in a conditional, I'm not sure if that will affect anything.
Thanks Shaun
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
Hi Shaun, This should be possible. It's been quite a long time since I worked on tools, so maybe others can provide better assistance if I am incorrect here. You'll need to have a conditional something like the following ( not tested whatsoever ): <conditional name="selected_file_select_list"> <param name="selected_gtf_file" type="select" label="Gtf file by species"> <options from_file="some_file"> <column name="name" index="2"/> <column name="some_value" index="1"/> </options> </param> <when value="some_value"> <param name="values_from_selected_gtf_file" type="select" label="Values from selected gtf file" /> <options from_file="some_value"> <column name="name" index="2"/> <column name="some_value" index="1"/> </options> </when> </conditional> On Jul 13, 2011, at 9:45 AM, SHAUN WEBB wrote:
Hi Greg, I'm not sure if this answers my question. Using options_from_file is fine if I want to refer to the same file each time.
In this case I want the first select to choose which gtf file to look at (by species) and the second select to pull options (gtf annotation types) from this file.
So I would somehow have to reference the file using the first parameter rather than giving a hard-coded path.
Is that possible?
Shaun
Quoting Greg Von Kuster <greg@bx.psu.edu> on Wed, 13 Jul 2011 09:23:19 -0400:
Hello Shaun,
Use the 'from_file' option. The referenced file should be in the ~/tool-data directory in the Galaxy root. There are several example tools in the distribution that use this option. Here is the example code from the annotation profiler tool:
<param name="table_names" type="drill_down" display="checkbox" hierarchy="recurse" multiple="true" label="Choose Tables to Use" help="Selecting no tables will result in using all tables." from_file="annotation_profiler_options.xml"/>
and here is an example from the microbial import tool:
<param name="kingdom" type="select" label="Select the Desired Kingdom"> <options from_file="microbial_data.loc" startswith="ORG"> <column name="name" index="3"/> <column name="value" index="3"/> <filter type="unique_value" name="unique" column="3"/> </options> </param>
On Jul 13, 2011, at 6:17 AM, SHAUN WEBB wrote:
Hi,
I am trying to write a tool xml file and want to do the following:
I have a number of GTF files stored locally and referenced in a data table. I give the user a drop down list of those available using the following code:
<param name="gtf" type="select" label="GTF File"> <options from_data_table="gtf_files"/> </param>
I then want them to choose an annotation type based on those present in the selected gtf file above. It seems simple enough to do this if the gtf file is in your history already:
<param name="feature" type="select" multiple="true" label="Extract features">
<options from_dataset="gtf">
<column name="name" index="2"/>
<column name="value" index="2"/>
<filter type="unique_value" name="unique" column="2"/>
</options>
</param>
But is there a way to query locally stored files via datatables/.loc files to pull out options when the file is dynamically chosen by a different parameter?
This code is also wrapped in a conditional, I'm not sure if that will affect anything.
Thanks Shaun
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu
Hi Greg, thanks for the suggestion. This line doesn't seem to work: <options from_file="some_value"> Galaxy looks for a file at galaxy_dir/tool-data/some_value rather than the value given in the .loc file I would also like to be able to use the galaxy data tables rather then referring directly to a .loc file. Any ideas? Shaun Quoting Greg Von Kuster <greg@bx.psu.edu> on Wed, 13 Jul 2011 10:28:30 -0400:
Hi Shaun,
This should be possible. It's been quite a long time since I worked on tools, so maybe others can provide better assistance if I am incorrect here. You'll need to have a conditional something like the following ( not tested whatsoever ):
<conditional name="selected_file_select_list"> <param name="selected_gtf_file" type="select" label="Gtf file by species"> <options from_file="some_file"> <column name="name" index="2"/> <column name="some_value" index="1"/> </options> </param> <when value="some_value"> <param name="values_from_selected_gtf_file" type="select" label="Values from selected gtf file" /> <options from_file="some_value"> <column name="name" index="2"/> <column name="some_value" index="1"/> </options> </when> </conditional>
On Jul 13, 2011, at 9:45 AM, SHAUN WEBB wrote:
Hi Greg, I'm not sure if this answers my question. Using options_from_file is fine if I want to refer to the same file each time.
In this case I want the first select to choose which gtf file to look at (by species) and the second select to pull options (gtf annotation types) from this file.
So I would somehow have to reference the file using the first parameter rather than giving a hard-coded path.
Is that possible?
Shaun
Quoting Greg Von Kuster <greg@bx.psu.edu> on Wed, 13 Jul 2011 09:23:19 -0400:
Hello Shaun,
Use the 'from_file' option. The referenced file should be in the ~/tool-data directory in the Galaxy root. There are several example tools in the distribution that use this option. Here is the example code from the annotation profiler tool:
<param name="table_names" type="drill_down" display="checkbox" hierarchy="recurse" multiple="true" label="Choose Tables to Use" help="Selecting no tables will result in using all tables." from_file="annotation_profiler_options.xml"/>
and here is an example from the microbial import tool:
<param name="kingdom" type="select" label="Select the Desired Kingdom"> <options from_file="microbial_data.loc" startswith="ORG"> <column name="name" index="3"/> <column name="value" index="3"/> <filter type="unique_value" name="unique" column="3"/> </options> </param>
On Jul 13, 2011, at 6:17 AM, SHAUN WEBB wrote:
Hi,
I am trying to write a tool xml file and want to do the following:
I have a number of GTF files stored locally and referenced in a data table. I give the user a drop down list of those available using the following code:
<param name="gtf" type="select" label="GTF File"> <options from_data_table="gtf_files"/> </param>
I then want them to choose an annotation type based on those present in the selected gtf file above. It seems simple enough to do this if the gtf file is in your history already:
<param name="feature" type="select" multiple="true" label="Extract features">
<options from_dataset="gtf">
<column name="name" index="2"/>
<column name="value" index="2"/>
<filter type="unique_value" name="unique" column="2"/>
</options>
</param>
But is there a way to query locally stored files via datatables/.loc files to pull out options when the file is dynamically chosen by a different parameter?
This code is also wrapped in a conditional, I'm not sure if that will affect anything.
Thanks Shaun
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
Hi. I'm still searching for a solution to this problem. Currently we have to implement a tool to read the GTF file selected via a from_data_table parameter and output a list of feature types. Secondly we have a second tool that reads this file using a from_dataset parameter so the user can select a specific datatype. Not really ideal, I would prefer to do this in one tool if possible. If I could reference the file chosen in the first select then this should work. For instance in the output data tags I can put label="${gtf.value}" and it returns the name of the selected file from the datatable. If I do the same in inputs section: <options from_file="${gtf.value}" galaxy tries to find the file [galaxy_dir]/tool-data/${gtf.value}. So the solution would ideally look like this: <param name="gtf" type="select" label="GTF File --gtf"> <options from_data_table="pycrac_gtf"/> <!--link to .loc file with gtf file per species --> </param> <param name="feature" type="select" label="Select feature"> <options from_file="${gtf.value}"> <column name="name" index="2"/> <column name="value" index="2"/> <filter type="unique_value" name="unique" column="1"/> </options> </param> Hope that makes sense. Thanks Shaun Quoting SHAUN WEBB <swebb1@staffmail.ed.ac.uk> on Fri, 15 Jul 2011 10:17:44 +0100:
Hi Greg,
thanks for the suggestion. This line doesn't seem to work:
<options from_file="some_value">
Galaxy looks for a file at galaxy_dir/tool-data/some_value rather than the value given in the .loc file
I would also like to be able to use the galaxy data tables rather then referring directly to a .loc file.
Any ideas?
Shaun
Quoting Greg Von Kuster <greg@bx.psu.edu> on Wed, 13 Jul 2011 10:28:30 -0400:
Hi Shaun,
This should be possible. It's been quite a long time since I worked on tools, so maybe others can provide better assistance if I am incorrect here. You'll need to have a conditional something like the following ( not tested whatsoever ):
<conditional name="selected_file_select_list"> <param name="selected_gtf_file" type="select" label="Gtf file by species"> <options from_file="some_file"> <column name="name" index="2"/> <column name="some_value" index="1"/> </options> </param> <when value="some_value"> <param name="values_from_selected_gtf_file" type="select" label="Values from selected gtf file" /> <options from_file="some_value"> <column name="name" index="2"/> <column name="some_value" index="1"/> </options> </when> </conditional>
On Jul 13, 2011, at 9:45 AM, SHAUN WEBB wrote:
Hi Greg, I'm not sure if this answers my question. Using options_from_file is fine if I want to refer to the same file each time.
In this case I want the first select to choose which gtf file to look at (by species) and the second select to pull options (gtf annotation types) from this file.
So I would somehow have to reference the file using the first parameter rather than giving a hard-coded path.
Is that possible?
Shaun
Quoting Greg Von Kuster <greg@bx.psu.edu> on Wed, 13 Jul 2011 09:23:19 -0400:
Hello Shaun,
Use the 'from_file' option. The referenced file should be in the ~/tool-data directory in the Galaxy root. There are several example tools in the distribution that use this option. Here is the example code from the annotation profiler tool:
<param name="table_names" type="drill_down" display="checkbox" hierarchy="recurse" multiple="true" label="Choose Tables to Use" help="Selecting no tables will result in using all tables." from_file="annotation_profiler_options.xml"/>
and here is an example from the microbial import tool:
<param name="kingdom" type="select" label="Select the Desired Kingdom"> <options from_file="microbial_data.loc" startswith="ORG"> <column name="name" index="3"/> <column name="value" index="3"/> <filter type="unique_value" name="unique" column="3"/> </options> </param>
On Jul 13, 2011, at 6:17 AM, SHAUN WEBB wrote:
Hi,
I am trying to write a tool xml file and want to do the following:
I have a number of GTF files stored locally and referenced in a data table. I give the user a drop down list of those available using the following code:
<param name="gtf" type="select" label="GTF File"> <options from_data_table="gtf_files"/> </param>
I then want them to choose an annotation type based on those present in the selected gtf file above. It seems simple enough to do this if the gtf file is in your history already:
<param name="feature" type="select" multiple="true" label="Extract features">
<options from_dataset="gtf">
<column name="name" index="2"/>
<column name="value" index="2"/>
<filter type="unique_value" name="unique" column="2"/>
</options>
</param>
But is there a way to query locally stored files via datatables/.loc files to pull out options when the file is dynamically chosen by a different parameter?
This code is also wrapped in a conditional, I'm not sure if that will affect anything.
Thanks Shaun
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
___________________________________________________________ Please keep all replies on the list by using "reply all" in your mail client. To manage your subscriptions to this and other Galaxy lists, please use the interface at:
Greg Von Kuster Galaxy Development Team greg@bx.psu.edu
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
-- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336.
participants (2)
-
Greg Von Kuster
-
SHAUN WEBB