Commit message:
Uploaded |
added:
r_wrapper.sh test-data/2.tabular test-data/XY_Plot_1_multi_out.pdf tool_dependencies.xml xy_example.jpg xy_plot.xml |
b |
diff -r 000000000000 -r d43075b3e107 r_wrapper.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/r_wrapper.sh Fri Oct 30 10:46:49 2015 -0400 |
b |
@@ -0,0 +1,23 @@ +#!/bin/sh + +### Run R providing the R script in $1 as standard input and passing +### the remaining arguments on the command line + +# Function that writes a message to stderr and exits +function fail +{ + echo "$@" >&2 + exit 1 +} + +# Ensure R executable is found +which R > /dev/null || fail "'R' is required by this tool but was not found on path" + +# Extract first argument +infile=$1; shift + +# Ensure the file exists +test -f $infile || fail "R input file '$infile' does not exist" + +# Invoke R passing file named by first argument to stdin +R --vanilla --slave $* < $infile |
b |
diff -r 000000000000 -r d43075b3e107 test-data/2.tabular --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/2.tabular Fri Oct 30 10:46:49 2015 -0400 |
b |
@@ -0,0 +1,10 @@ +1 68 4.1 +2 71 4.6 +3 62 3.8 +4 75 4.4 +5 58 3.2 +6 60 3.1 +7 67 3.8 +8 68 4.1 +9 71 4.3 +10 69 3.7 |
b |
diff -r 000000000000 -r d43075b3e107 test-data/XY_Plot_1_multi_out.pdf |
b |
Binary file test-data/XY_Plot_1_multi_out.pdf has changed |
b |
diff -r 000000000000 -r d43075b3e107 tool_dependencies.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_dependencies.xml Fri Oct 30 10:46:49 2015 -0400 |
b |
@@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<tool_dependency> + <package name="R" version="3.2.1"> + <repository changeset_revision="e46a7803f17b" name="package_r_3_2_1" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" /> + </package> + <package name="fontconfig" version="2.11.1"> + <repository changeset_revision="b20e4c53891e" name="package_fontconfig_2_11_1" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" /> + </package> +</tool_dependency> + |
b |
diff -r 000000000000 -r d43075b3e107 xy_example.jpg |
b |
Binary file xy_example.jpg has changed |
b |
diff -r 000000000000 -r d43075b3e107 xy_plot.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xy_plot.xml Fri Oct 30 10:46:49 2015 -0400 |
[ |
b'@@ -0,0 +1,234 @@\n+<tool id="XY_Plot_1_multiformat" name="Plotting tool" version="1.0.1">\r\n+ <description>for multiple series and graph types and multiple output types</description>\r\n+ <requirements>\r\n+ <requirement type="package" version="3.2.1">R</requirement>\r\n+ <requirement type="package" version="2.11.1">fontconfig</requirement>\r\n+ </requirements>\r\n+ <command interpreter="bash">r_wrapper.sh $script_file</command>\r\n+\r\n+ <inputs>\r\n+ <param name="main" type="text" value="" label="Plot Title"/>\r\n+ <param name="xlab" type="text" value="" label="Label for x axis"/>\r\n+ <param name="ylab" type="text" value="" label="Label for y axis"/>\r\n+ <param name="ftype" type="select" label="File Type">\r\n+ <option value="pdf">PDF</option>\r\n+ <option value="png">PNG</option>\r\n+ <option value="jpeg">JPEG</option>\r\n+ <option value="bmp">BMP</option>\r\n+ <option value="tiff">TIFF</option>\r\n+ </param>\r\n+ <repeat name="series" title="Series">\r\n+ <param name="input" type="data" format="tabular" label="Dataset"/>\r\n+ <param name="xcol" type="data_column" data_ref="input" label="Column for x axis"/>\r\n+ <param name="ycol" type="data_column" data_ref="input" label="Column for y axis"/>\r\n+ <conditional name="series_type">\r\n+ <param name="type" type="select" label="Series Type">\r\n+ <option value="line" selected="true">Line</option>\r\n+ <option value="points">Points</option>\r\n+ </param>\r\n+ <when value="line">\r\n+ <param name="lty" type="select" label="Line Type">\r\n+ <option value="1">Solid</option>\r\n+ <option value="2">Dashed</option>\r\n+ <option value="3">Dotted</option>\r\n+ </param>\r\n+ <param name="col" type="select" label="Line Color">\r\n+ <option value="1">Black</option>\r\n+ <option value="2">Red</option>\r\n+ <option value="3">Green</option>\r\n+ <option value="4">Blue</option>\r\n+ <option value="5">Cyan</option>\r\n+ <option value="6">Magenta</option>\r\n+ <option value="7">Yellow</option>\r\n+ <option value="8">Gray</option>\r\n+ </param>\r\n+ <param name="lwd" type="float" label="Line Width" value="1.0"/>\r\n+ </when>\r\n+ <when value="points">\r\n+ <param name="pch" type="select" label="Point Type">\r\n+ <option value="1">Circle (hollow)</option>\r\n+ <option value="2">Triangle (hollow)</option>\r\n+ <option value="3">Cross</option>\r\n+ <option value="4">Diamond (hollow)</option>\r\n+ <option value="15">Square (filled)</option>\r\n+ <option value="16">Circle (filled)</option>\r\n+ <option value="17">Triangle (filled)</option> \r\n+ </param>\r\n+ <param name="col" type="select" label="Point Color">\r\n+ <option value="1">Black</option>\r\n+ <option value="2">Red</option>\r\n+ <option value="3">Green</option>\r\n+ <option value="4">Blue</option>\r\n+ <option value="5">Cyan</option>\r\n+ <option value="6">Magenta</option>\r\n+ <option value="7">Yellow</option>\r\n+ <option value="8">Gray</option>\r\n+ </param>\r\n+ <param name="cex" type="float" label="Point Scale" value="1.0"/>\r\n+ </when>\r\n+ </conditional>\r\n+ </repeat> \r\n+ </inputs>\r\n+\r\n+ <configfiles>\r\n+ <configfile name="script_file">\r\n+ ## Setup R error handling to go to stderr\r\n+ options( show.error.messages=F, \r\n+ error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )\r\n+ ## Determine range of all series in the plot\r\n+ xrange = c( NULL, NULL )\r\n+ yrange = c( NULL, NULL )\r\n+ #for $i, $s in enumerate( $series )\r\n+ s${i} = read.table( "${s.input.file_name}" )\r\n+ x${i} = s${i}[,${s.xcol}]\r\n+ y${i} = s${i}[,${s.ycol}]\r'..b'alue="2.tabular" ftype="tabular"/>\r\n+ <param name="xcol" value="1"/>\r\n+ <param name="ycol" value="2"/>\r\n+ <param name="type" value="line"/>\r\n+ <param name="lty" value="2"/>\r\n+ <param name="col" value="2"/>\r\n+ <param name="lwd" value="1.0"/>\r\n+ <output name="out_file1" file="XY_Plot_1_multi_out.pdf" format="pdf" />\r\n+ </test>\r\n+ <test>\r\n+ <param name="main" value="Example XY Plot PNG"/>\r\n+ <param name="xlab" value="Column 1"/>\r\n+ <param name="ylab" value="Column 2"/>\r\n+ <param name="ftype" value="png"/>\r\n+ <param name="input" value="2.tabular" ftype="tabular"/>\r\n+ <param name="xcol" value="1"/>\r\n+ <param name="ycol" value="2"/>\r\n+ <param name="type" value="line"/>\r\n+ <param name="lty" value="2"/>\r\n+ <param name="col" value="2"/>\r\n+ <param name="lwd" value="1.0"/>\r\n+ <output name="out_file2" md5="c2762c725f80fe4419e35768cac5d11b" />\r\n+ </test>\r\n+ <test>\r\n+ <param name="main" value="Example XY Plot JPEG"/>\r\n+ <param name="xlab" value="Column 1"/>\r\n+ <param name="ylab" value="Column 2"/>\r\n+ <param name="ftype" value="jpeg"/>\r\n+ <param name="input" value="2.tabular" ftype="tabular"/>\r\n+ <param name="xcol" value="1"/>\r\n+ <param name="ycol" value="2"/>\r\n+ <param name="type" value="line"/>\r\n+ <param name="lty" value="2"/>\r\n+ <param name="col" value="2"/>\r\n+ <param name="lwd" value="1.0"/>\r\n+ <output name="out_file3" md5="5c89f4e87bb5f2a809877b471f9c2d69" />\r\n+ </test>\r\n+ <test>\r\n+ <param name="main" value="Example XY Plot BMP"/>\r\n+ <param name="xlab" value="Column 1"/>\r\n+ <param name="ylab" value="Column 2"/>\r\n+ <param name="ftype" value="bmp"/>\r\n+ <param name="input" value="2.tabular" ftype="tabular"/>\r\n+ <param name="xcol" value="1"/>\r\n+ <param name="ycol" value="2"/>\r\n+ <param name="type" value="line"/>\r\n+ <param name="lty" value="2"/>\r\n+ <param name="col" value="2"/>\r\n+ <param name="lwd" value="1.0"/>\r\n+ <output name="out_file4" md5="74ea4b29bd7de44c1b6377c6c26671e7"/>\r\n+ </test>\r\n+ <test>\r\n+ <param name="main" value="Example XY Plot TIFF"/>\r\n+ <param name="xlab" value="Column 1"/>\r\n+ <param name="ylab" value="Column 2"/>\r\n+ <param name="ftype" value="tiff"/>\r\n+ <param name="input" value="2.tabular" ftype="tabular"/>\r\n+ <param name="xcol" value="1"/>\r\n+ <param name="ycol" value="2"/>\r\n+ <param name="type" value="line"/>\r\n+ <param name="lty" value="2"/>\r\n+ <param name="col" value="2"/>\r\n+ <param name="lwd" value="1.0"/>\r\n+ <output name="out_file5" md5="7ebf7d201ad9cdf0fc6995639749ae7d"/>\r\n+ </test>\r\n+ </tests>\r\n+<help>\r\n+.. class:: infomark\r\n+\r\n+This tool allows you to plot values contained in columns of a dataset against each other and also allows you to have different series corresponding to the same or different datasets in one plot.\r\n+\r\n+-----\r\n+\r\n+.. class:: warningmark\r\n+\r\n+This tool throws an error if the columns selected for plotting are absent or are not numeric and also if the lengths of these columns differ.\r\n+\r\n+-----\r\n+\r\n+**Example**\r\n+\r\n+Input file::\r\n+\r\n+ 1 68 4.1\r\n+ 2 71 4.6\r\n+ 3 62 3.8\r\n+ 4 75 4.4\r\n+ 5 58 3.2\r\n+ 6 60 3.1\r\n+ 7 67 3.8\r\n+ 8 68 4.1\r\n+ 9 71 4.3\r\n+ 10 69 3.7 \r\n+\r\n+Create a two series XY plot on the above data:\r\n+\r\n+- Series 1: Red Dashed-Line plot between columns 1 and 2\r\n+- Series 2: Blue Circular-Point plot between columns 3 and 2 \r\n+\r\n+.. image:: xy_example.jpg\r\n+</help>\r\n+</tool>\r\n' |