On Thu, Oct 14, 2010 at 6:44 AM, Bossers, Alex <Alex.Bossers@wur.nl> wrote:
If I understand you correctly what you want to do you should be able to just do that by a tool.xml config calling an R script and providing a data file. The R script can open that file and process it into some output file known by galaxy.... But maybe I oversee something.
In your tool_config grab an R-file and some datafile:
<command> R --slave -f $in_r --args $in_data $out_data </command> <inputs> <param name="in_data" type="data" format="tabular" label="Test data file" /> <param name="in_r" type="data" format="text" label="R script to load and execute" /> </inputs> <outputs> <data name="out_data" type="data" format="tabular" label="R script output" /> </outputs>
The R script provided will grab the args from the cmd line as you indiciated earlier:
# R script file to grab input and output filenames from cmdline and just copy args <- commandArgs() output <- read.table(args[6], header=T) write.table(output,sep="\t",file=args[7],row.names=F) #end script
Hope this helped,
Alex
Wow - very similar to the version I wrote (off list discussion yesterday). You can also try something like this if the script writes to stdout: <command> R --slave -f $in_r --args $in_data > $out_data </command> Peter