Yes, but I suppose that  R executable is in your PATH, but my wrapper "r_script_wrapper.sh" is not in mine as it is in a subdirectory of 'tools' directory. That should explain why it works on your side. 
And as you provide the path to $GALAXY_ROOT_DIR for your R script, it is also OK.


Anthony

On 12 November 2010 17:00, Bossers, Alex <Alex.Bossers@wur.nl> wrote:

Indeed a useful option J

 

I don’t agree with the naked command tag. It works in our hands;

 

<command>

       R --slave --vanilla --file=$GALAXY_ROOT_DIR/tools/somedir/somescript.R --args $input1 $options $output1

</command>

 

Alex (only posted to dev)

 

 

Van: galaxy-dev-bounces@lists.bx.psu.edu [mailto:galaxy-dev-bounces@lists.bx.psu.edu] Namens Anthony Ferrari
Verzonden: vrijdag 12 november 2010 15:01
Aan: Peter
CC: galaxy-dev@lists.bx.psu.edu; galaxy-user@lists.bx.psu.edu; Bree, Freddy de
Onderwerp: Re: [galaxy-dev] [galaxy-user] plugging R into galaxy

 

 

On 12 November 2010 14:45, Peter <biopython@maubp.freeserve.co.uk> wrote:

On Fri, Nov 12, 2010 at 1:09 PM, Anthony Ferrari <ferraria@gmail.com> wrote:
> OK. I have made some tests this morning to figure this all out.
> Indeed, the problem with ">" is that it catches every single message R sends
> to STDOUT and not only object of your interest, so this is definitely not a
> reliable solution. Solution suggests by Alex worked perfectly well.
> I would suggest also to use the 'trailingOnly=TRUE' option within the
> commandArgs() call in the R script. That allows you to only care about the
> args given after the '--args' option. You can then forget how many previous
> options you have in your command line (--vanilla, --slave, -f or others...).
> First parameter useful to your R script would then be
> commandArgs(trailingOnly=T)[1] and so on.

That is a very handy tip, commandArgs(trailingOnly=T), thanks!


> There is just another little point that I would like to clarify. At the
> beginning my tests didn't work at all and I realize that I have to give the
> full path to the R script (in the command tag) to make it work.

What happens if you do <command> rather than <command interpreter="bash">?

 

This is worse. Here's what I got :

An error occurred running this job: /var/spool/torque/mom_priv/jobs/77.node054.cluster.SC: line 11: ./r_script_wrapper.sh: No such file or directory

 

This time even the wrapper is not found. And I have to specify both paths to make it work. (To r_script_wrapper.sh and rcode.R)

 

Anthony 

 

 

Peter

P.S. Cross posted to Galaxy-dev, could we continue this there?

sure.