Indeed a useful option :) 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<mailto:biopython@maubp.freeserve.co.uk>> wrote: On Fri, Nov 12, 2010 at 1:09 PM, Anthony Ferrari <ferraria@gmail.com<mailto: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<http://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.