On Sun, Feb 13, 2011 at 8:13 AM, Florent Angly <florent.an...@gmail.com> 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 <inputs> section of my tool contains:
> <param name="random_seed" type="integer" optional="true" label="Random seed"
> help="Seed number to use for the pseudo-random number generator." />
>
> The <command> 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 <commands> 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/

Reply via email to