Question: Error unavailable variable in Galaxy
gravatar for sharma.ram.h
9 weeks ago by
sharma.ram.h0 wrote:

I have very simple Galaxy wrapper for simple R function. The following mergefun.xml file.

<tool id="mergefun" name="mergefun" version="1.0.0">
  <description>merge two datasets </description>

        Rscript ~/Documents/galaxy_development/galaxy/tools/mergefun/mergefun.R --input1 $input1 --input2 $input2 --output $output

    <param name="input1" type="data"
          label="encoded data" help="encoded must be a rda file" 

    <param name="input2" type="data" 
              label="encoded data" help=" must be  rda file" 


    <data format="tabular" name = "output" label="output" />

        merge two datasets 

Here is simple R script with the function.

mergefun <- function(input1, input2){
  in1 <- input1
  in2 <- input2
  output <- merge(in1, in2)
output <- mergefun(input1=input1, input2=input2)
write.csv(output, file="merged_data.csv")

When I run I am getting the following error.

An error occurred with this dataset:
Error in mergefun(input1 = input1, input2 = input2) : 
  object 'input1' not found
Execution halted

It may be simple error as I am new to galaxy. Help appreciated.

galaxy R • 79 views
ADD COMMENTlink modified 9 weeks ago by Hotz, Hans-Rudolf1.6k • written 9 weeks ago by sharma.ram.h0
gravatar for Hotz, Hans-Rudolf
9 weeks ago by
Hotz, Hans-Rudolf1.6k wrote:


I don't think it is a Galaxy issue. The problem more likely lies in the R script: you don't pass the command line arguments to the script. Have a look at this simple example:

Also, the end of your script will probably fail as well, since the data will not be stored as"merged_data.csv" in galaxy. Try:

output.var <- mergefun(input1=input1, input2=input2)

write.csv(output.var, file=output)

I hope this helps, Regards, Hans-Rudolf

ADD COMMENTlink written 9 weeks ago by Hotz, Hans-Rudolf1.6k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 123 users visited in the last hour