Description Usage Arguments Details Value See Also Examples
An example function that can be made into a Galaxy tool. Reads matrices from two tab-delimited files, adds them, and writes the result to a comma-separated file and a PDF plot.
1 2 3 4 5 6 7 | functionToGalaxify(inputfile1=GalaxyInputFile(),
inputfile2=GalaxyInputFile(),
plotTitle=GalaxyCharacterParam(testValues="test plot title"),
plotSubTitle=GalaxyCharacterParam("My subtitle",
testValues="test plot subtitle"),
outputfile1=GalaxyOutput("mydata", "csv"),
outputfile2=GalaxyOutput("myplot", "png"))
|
inputfile1 |
The filename of the |
inputfile2 |
The filename of the second tab-separated matrix. |
plotTitle |
The title of the plot to create. |
plotSubTitle |
The subtitle of the plot to create. |
outputfile1 |
The filename of the comma-separated output file to generate. |
outputfile2 |
The filename of the PNG plot file to create. |
This trivial method illustrates some best practices to use when writing
functions to be adapted as Galaxy tools. For example, any error conditions
should be handled with stop
with a useful/informative error
message. The Galaxy user will see these messages if an error occurs.
Functions which take datasets as input should accept as arguments the filenames pointing to those datasets. The Galaxy user interface will allow the user to chose the dataset graphically.
Return values of functions are ignored. Function output should be written to one or more files, and the names of these files should be passed into the function as arguments.
Functions should be documented with a manual page. RGalaxy
will use this manual page to fill in relevant sections of the
Galaxy XML file.
invisible(NULL)
galaxy
,
GalaxyConfig
, GalaxyOutput
1 2 3 4 5 | functionToGalaxify(system.file("extdata", "a.tsv", package="RGalaxy"),
system.file("extdata", "b.tsv", package="RGalaxy"),
"My Plot Title", "My Plot Subtitle",
"output.csv", "output.pdf")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.