functionToGalaxify: Add two matrices

Description Usage Arguments Details Value See Also Examples

Description

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.

Usage

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"))

Arguments

inputfile1

The filename of the first tab-separated matrix.

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.

Details

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.

Value

invisible(NULL)

See Also

galaxy, GalaxyConfig, GalaxyOutput

Examples

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")
    

dtenenba/RGalaxy_refactor documentation built on May 15, 2019, 4:55 p.m.