Re: [galaxy-user] Optional tool arguments
On 14/02/11 19:35, Peter Cock wrote: On Mon, Feb 14, 2011 at 8:44 AM, Florent Angly wrote: Thanks for the help Alex! I got it working this way: In the section: In the section: #if $random_seed> 0 -random_seed$random_seed #end if Florent Does that actually let the user put an empty string in? My guess is not, and you are just using zero as the default (meaning no seed). This is the same workaround I have been using (where there is a suitable dummy values - not always the case). Peter Yes, it simply is a workaround that allows me to keep working with Galaxy. Hopefully, your patch that fixes this issue can be accepted soon: https://bitbucket.org/galaxy/galaxy-central/issue/403/enhance-tool-parameters-to-be-optional Best, Florent ___ The Galaxy User list should be used for the discussion of Galaxy analysis and other features on the public server at usegalaxy.org. For discussion of local Galaxy instances and the Galaxy source code, please use the Galaxy Development list: http://lists.bx.psu.edu/listinfo/galaxy-dev To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
Re: [galaxy-user] Optional tool arguments
On Mon, Feb 14, 2011 at 8:44 AM, Florent Angly wrote: > Thanks for the help Alex! I got it working this way: > > In the section: > label="Random seed" help="Seed number to use for the pseudo-random number > generator." /> > > In the section: > #if $random_seed > 0 > -random_seed $random_seed > #end if > > Florent Does that actually let the user put an empty string in? My guess is not, and you are just using zero as the default (meaning no seed). This is the same workaround I have been using (where there is a suitable dummy values - not always the case). Peter ___ The Galaxy User list should be used for the discussion of Galaxy analysis and other features on the public server at usegalaxy.org. For discussion of local Galaxy instances and the Galaxy source code, please use the Galaxy Development list: http://lists.bx.psu.edu/listinfo/galaxy-dev To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
Re: [galaxy-user] Optional tool arguments
Thanks for the help Alex! I got it working this way: In the section: label="Random seed" help="Seed number to use for the pseudo-random number generator." /> In the section: #if $random_seed > 0 -random_seed$random_seed #end if Florent On 14/02/11 01:04, Bossers, Alex wrote: Florent, you should be able to do this using cheetah scripting. Perhaps you can give the seed a specific (nonsense) default value like 0 or -1? You could check on this with cheetah scripting for this value and if so issue the command without additional parameters, otherwise issue the command witht the set values hope this helps and was your question.. lex Van: galaxy-user-boun...@lists.bx.psu.edu [galaxy-user-boun...@lists.bx.psu.edu] namens Florent Angly [florent.an...@gmail.com] Verzonden: zondag 13 februari 2011 9:13 Aan: galaxy-user@lists.bx.psu.edu Onderwerp: [galaxy-user] Optional tool arguments Hi, I am wondering how to handle optional arguments in a tool wrapper for Galaxy. I looked at other wrappers but could not find the way to do the right thing. The section of my tool contains: The section looks like: Grinder -random_seed $random_seed However, when I run the tool through the webinterface without specifying a seed value, the jobs starts but fails with the error: Traceback (most recent call last): File "/Users/galaxy/galaxy_dist/lib/galaxy/jobs/runners/local.py", line 56, in run_job job_wrapper.prepare() File "/Users/galaxy/galaxy_dist/lib/galaxy/jobs/__init__.py", line 371, in prepare self.command_line = self.tool.build_command_line( param_dict ) File "/Users/galaxy/galaxy_dist/lib/galaxy/tools/__init__.py", line 1525, in build_command_line command_line = fill_template( self.command, context=param_dict ) File "/Users/galaxy/galaxy_dist/lib/galaxy/util/template.py", line 9, in fill_template return str( Template( source=template_text, searchList=[context] ) ) File "/Users/galaxy/galaxy_dist/eggs/Cheetah-2.2.2-py2.6-macosx-10.6-universal-ucs2.egg/Cheetah/Template.py", line 1004, in __str__ return getattr(self, mainMethName)() File "DynamicallyCompiledCheetahTemplate.py", line 168, in respond NotFound: cannot find 'random_seed' I assume that I need to adjust my section so that the "-random_seed $random_seed" parameter and values are issued only if $random_seed has been set to a value. Something like: Grinder #if ??? $random_seed ??? -random_seed $random_seed #end if The question is: how to do it? I tried a variety of syntaxes without success. Thanks, Florent ___ The Galaxy User list should be used for the discussion of Galaxy analysis and other features on the public server at usegalaxy.org. For discussion of local Galaxy instances and the Galaxy source code, please use the Galaxy Development list: http://lists.bx.psu.edu/listinfo/galaxy-dev To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/ ___ The Galaxy User list should be used for the discussion of Galaxy analysis and other features on the public server at usegalaxy.org. For discussion of local Galaxy instances and the Galaxy source code, please use the Galaxy Development list: http://lists.bx.psu.edu/listinfo/galaxy-dev To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
Re: [galaxy-user] Optional tool arguments
Florent, you should be able to do this using cheetah scripting. Perhaps you can give the seed a specific (nonsense) default value like 0 or -1? You could check on this with cheetah scripting for this value and if so issue the command without additional parameters, otherwise issue the command witht the set values hope this helps and was your question.. lex Van: galaxy-user-boun...@lists.bx.psu.edu [galaxy-user-boun...@lists.bx.psu.edu] namens Florent Angly [florent.an...@gmail.com] Verzonden: zondag 13 februari 2011 9:13 Aan: galaxy-user@lists.bx.psu.edu Onderwerp: [galaxy-user] Optional tool arguments Hi, I am wondering how to handle optional arguments in a tool wrapper for Galaxy. I looked at other wrappers but could not find the way to do the right thing. The section of my tool contains: The section looks like: Grinder -random_seed $random_seed However, when I run the tool through the webinterface without specifying a seed value, the jobs starts but fails with the error: > Traceback (most recent call last): >File "/Users/galaxy/galaxy_dist/lib/galaxy/jobs/runners/local.py", line > 56, in run_job > job_wrapper.prepare() >File "/Users/galaxy/galaxy_dist/lib/galaxy/jobs/__init__.py", line 371, in > prepare > self.command_line = self.tool.build_command_line( param_dict ) >File "/Users/galaxy/galaxy_dist/lib/galaxy/tools/__init__.py", line 1525, > in build_command_line > command_line = fill_template( self.command, context=param_dict ) >File "/Users/galaxy/galaxy_dist/lib/galaxy/util/template.py", line 9, in > fill_template > return str( Template( source=template_text, searchList=[context] ) ) >File > "/Users/galaxy/galaxy_dist/eggs/Cheetah-2.2.2-py2.6-macosx-10.6-universal-ucs2.egg/Cheetah/Template.py", > line 1004, in __str__ > return getattr(self, mainMethName)() >File "DynamicallyCompiledCheetahTemplate.py", line 168, in respond > NotFound: cannot find 'random_seed' I assume that I need to adjust my section so that the "-random_seed $random_seed" parameter and values are issued only if $random_seed has been set to a value. Something like: Grinder #if ??? $random_seed ??? -random_seed $random_seed #end if The question is: how to do it? I tried a variety of syntaxes without success. Thanks, Florent ___ The Galaxy User list should be used for the discussion of Galaxy analysis and other features on the public server at usegalaxy.org. For discussion of local Galaxy instances and the Galaxy source code, please use the Galaxy Development list: http://lists.bx.psu.edu/listinfo/galaxy-dev To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/ ___ The Galaxy User list should be used for the discussion of Galaxy analysis and other features on the public server at usegalaxy.org. For discussion of local Galaxy instances and the Galaxy source code, please use the Galaxy Development list: http://lists.bx.psu.edu/listinfo/galaxy-dev To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
Re: [galaxy-user] Optional tool arguments
On Sun, Feb 13, 2011 at 8:13 AM, Florent Angly wrote: > Hi, > > I am wondering how to handle optional arguments in a tool wrapper for > Galaxy. I looked at other wrappers but could not find the way to do the > right thing. > > The section of my tool contains: > help="Seed number to use for the pseudo-random number generator." /> > > The section looks like: > Grinder -random_seed $random_seed > > However, when I run the tool through the webinterface without specifying a > seed value, the jobs starts but fails with the error: > >> Traceback (most recent call last): >> File "/Users/galaxy/galaxy_dist/lib/galaxy/jobs/runners/local.py", line >> 56, in run_job >> job_wrapper.prepare() >> File "/Users/galaxy/galaxy_dist/lib/galaxy/jobs/__init__.py", line 371, >> in prepare >> self.command_line = self.tool.build_command_line( param_dict ) >> File "/Users/galaxy/galaxy_dist/lib/galaxy/tools/__init__.py", line >> 1525, in build_command_line >> command_line = fill_template( self.command, context=param_dict ) >> File "/Users/galaxy/galaxy_dist/lib/galaxy/util/template.py", line 9, in >> fill_template >> return str( Template( source=template_text, searchList=[context] ) ) >> File >> "/Users/galaxy/galaxy_dist/eggs/Cheetah-2.2.2-py2.6-macosx-10.6-universal-ucs2.egg/Cheetah/Template.py", >> line 1004, in __str__ >> return getattr(self, mainMethName)() >> File "DynamicallyCompiledCheetahTemplate.py", line 168, in respond >> NotFound: cannot find 'random_seed' > > I assume that I need to adjust my section so that the > "-random_seed $random_seed" parameter and values are issued only if > $random_seed has been set to a value. Something like: > > Grinder > #if ??? $random_seed ??? > -random_seed $random_seed > #end if > > The question is: how to do it? I tried a variety of syntaxes without > success. > > Thanks, > > Florent I don't think it works, see: https://bitbucket.org/galaxy/galaxy-central/issue/403 My patch may still work - I haven't looked at this recently though. Peter ___ The Galaxy User list should be used for the discussion of Galaxy analysis and other features on the public server at usegalaxy.org. For discussion of local Galaxy instances and the Galaxy source code, please use the Galaxy Development list: http://lists.bx.psu.edu/listinfo/galaxy-dev To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/
[galaxy-user] Optional tool arguments
Hi, I am wondering how to handle optional arguments in a tool wrapper for Galaxy. I looked at other wrappers but could not find the way to do the right thing. The section of my tool contains: The section looks like: Grinder -random_seed $random_seed However, when I run the tool through the webinterface without specifying a seed value, the jobs starts but fails with the error: Traceback (most recent call last): File "/Users/galaxy/galaxy_dist/lib/galaxy/jobs/runners/local.py", line 56, in run_job job_wrapper.prepare() File "/Users/galaxy/galaxy_dist/lib/galaxy/jobs/__init__.py", line 371, in prepare self.command_line = self.tool.build_command_line( param_dict ) File "/Users/galaxy/galaxy_dist/lib/galaxy/tools/__init__.py", line 1525, in build_command_line command_line = fill_template( self.command, context=param_dict ) File "/Users/galaxy/galaxy_dist/lib/galaxy/util/template.py", line 9, in fill_template return str( Template( source=template_text, searchList=[context] ) ) File "/Users/galaxy/galaxy_dist/eggs/Cheetah-2.2.2-py2.6-macosx-10.6-universal-ucs2.egg/Cheetah/Template.py", line 1004, in __str__ return getattr(self, mainMethName)() File "DynamicallyCompiledCheetahTemplate.py", line 168, in respond NotFound: cannot find 'random_seed' I assume that I need to adjust my section so that the "-random_seed $random_seed" parameter and values are issued only if $random_seed has been set to a value. Something like: Grinder #if ??? $random_seed ??? -random_seed $random_seed #end if The question is: how to do it? I tried a variety of syntaxes without success. Thanks, Florent ___ The Galaxy User list should be used for the discussion of Galaxy analysis and other features on the public server at usegalaxy.org. For discussion of local Galaxy instances and the Galaxy source code, please use the Galaxy Development list: http://lists.bx.psu.edu/listinfo/galaxy-dev To manage your subscriptions to this and other Galaxy lists, please use the interface at: http://lists.bx.psu.edu/