| Previous changeset 2:23657fcaaa5c (2015-10-09) Next changeset 4:ecb437f1d298 (2017-12-17) |
|
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/xy_plot commit facdb350072c8492654c90040fea3109dc9b51cd |
|
modified:
r_wrapper.sh xy_plot.xml |
|
added:
test-data/testinput2.tsv test-data/testoutput.png |
| b |
| diff -r 23657fcaaa5c -r 319fa5a9fc1b r_wrapper.sh --- a/r_wrapper.sh Fri Oct 09 15:50:24 2015 -0400 +++ b/r_wrapper.sh Wed Dec 07 18:29:23 2016 -0500 |
| b |
| @@ -1,6 +1,6 @@ #!/bin/sh -### Run R providing the R script in $1 as standard input and passing +### 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 @@ -11,7 +11,7 @@ } # Ensure R executable is found -which R > /dev/null || fail "'R' is required by this tool but was not found on path" +which R > /dev/null || fail "'R' is required by this tool but was not found on path" # Extract first argument infile=$1; shift |
| b |
| diff -r 23657fcaaa5c -r 319fa5a9fc1b test-data/testinput2.tsv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/testinput2.tsv Wed Dec 07 18:29:23 2016 -0500 |
| b |
| @@ -0,0 +1,82 @@ +numsampled 0.03-F3D0 0.03-F3D1 +1 1 1 +100 41.656 45.056 +200 59.033 61.574 +300 70.564 71.47 +400 78.832 78.473 +500 85.365 83.999 +600 90.809 88.67 +700 95.37 92.661 +800 99.424 96.192 +900 102.93 99.322 +1000 106.109 102.104 +1100 109.093 104.719 +1200 111.779 107.177 +1300 114.358 109.452 +1400 116.659 111.602 +1500 118.767 113.489 +1600 120.752 115.256 +1700 122.691 116.981 +1800 124.511 118.561 +1900 126.265 120.041 +2000 127.967 121.466 +2100 129.51 122.863 +2200 130.973 124.201 +2300 132.418 125.504 +2400 133.783 126.659 +2440 134.324 127.108 +2450 134.432 127.22 +2500 135.037 127.781 +2600 136.268 128.837 +2700 137.479 129.829 +2800 138.638 130.799 +2900 139.759 131.741 +3000 140.851 132.618 +3100 141.941 133.494 +3200 142.993 134.339 +3300 144.002 135.161 +3400 144.999 135.897 +3482 145.788 136.509 +3497 145.931 136.616 +3500 145.967 136.635 +3600 146.838 137.341 +3700 147.726 137.99 +3800 148.541 138.637 +3877 149.223 139.149 +3900 149.396 139.3 +4000 150.177 139.985 +4082 150.853 140.463 +4100 150.991 140.575 +4169 151.478 141.019 +4200 151.704 141.206 +4287 152.323 141.704 +4300 152.429 141.784 +4400 153.157 142.358 +4500 153.884 142.945 +4600 154.56 143.523 +4690 155.146 144 +4698 155.195 NA +4700 155.207 NA +4800 155.864 NA +4900 156.501 NA +5000 157.099 NA +5100 157.699 NA +5200 158.304 NA +5300 158.887 NA +5315 158.968 NA +5400 159.501 NA +5500 160.099 NA +5582 160.613 NA +5600 160.709 NA +5700 161.263 NA +5773 161.67 NA +5800 161.81 NA +5900 162.337 NA +6000 162.853 NA +6100 163.362 NA +6200 163.873 NA +6223 164 NA +6300 NA NA +6400 NA NA +6437 NA NA +6500 NA NA |
| b |
| diff -r 23657fcaaa5c -r 319fa5a9fc1b test-data/testoutput.png |
| b |
| Binary file test-data/testoutput.png has changed |
| b |
| diff -r 23657fcaaa5c -r 319fa5a9fc1b xy_plot.xml --- a/xy_plot.xml Fri Oct 09 15:50:24 2015 -0400 +++ b/xy_plot.xml Wed Dec 07 18:29:23 2016 -0500 |
| [ |
| b'@@ -1,151 +1,187 @@\n-<tool id="XY_Plot_1" name="Plotting tool" version="1.0.1">\r\n- <description>for multiple series and graph types</description>\r\n- <requirements>\r\n- <requirement type="package" version="2.11.0">R</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- <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\n- xrange = range( x${i}, xrange )\r\n- yrange = range( y${i}, yrange )\r\n- #end for\r\n- ## Open output PDF file\r\n- pdf( "${out_file1}" )\r\n- ## Dummy plot for axis / labels\r\n- plot( NULL, type="n", xlim=xrange, ylim=yrange, main="${main}", xlab="${xlab}", ylab="${ylab}" )\r\n- ## Plot each series\r\n- #for $i, $s in enumerate( $series )\r\n- #if $s.series_type[\'type\'] == "line"\r\n- '..b'low</option>\n+ <option value="8">Gray</option>\n+ </param>\n+ <param name="lwd" type="float" label="Line Width" value="1.0"/>\n+ </when>\n+ <when value="points">\n+ <param name="pch" type="select" label="Point Type">\n+ <option value="1">Circle (hollow)</option>\n+ <option value="2">Triangle (hollow)</option>\n+ <option value="3">Cross</option>\n+ <option value="4">Diamond (hollow)</option>\n+ <option value="15">Square (filled)</option>\n+ <option value="16">Circle (filled)</option>\n+ <option value="17">Triangle (filled)</option>\n+ </param>\n+ <param name="col" type="select" label="Point Color">\n+ <option value="1">Black</option>\n+ <option value="2">Red</option>\n+ <option value="3">Green</option>\n+ <option value="4">Blue</option>\n+ <option value="5">Cyan</option>\n+ <option value="6">Magenta</option>\n+ <option value="7">Yellow</option>\n+ <option value="8">Gray</option>\n+ </param>\n+ <param name="cex" type="float" label="Point Scale" value="1.0"/>\n+ </when>\n+ </conditional>\n+ </repeat>\n+ </inputs>\n+ <outputs>\n+ <data format="pdf" name="out_file_pdf" from_work_dir="outfile.pdf" >\n+ <filter>(outftype == \'pdf\')</filter>\n+ </data>\n+ <data format="png" name="out_file_png" from_work_dir="outfile.png">\n+ <filter>(outftype == \'png\')</filter>\n+ </data>\n+ </outputs>\n+ <tests>\n+ <test>\n+ <param name="main" value="Example XY Plot"/>\n+ <param name="xlab" value="Column 1"/>\n+ <param name="ylab" value="Column 2"/>\n+ <param name="outftype" value="pdf"/>\n+ <param name="input" value="2.tabular" ftype="tabular"/>\n+ <param name="xcol" value="1"/>\n+ <param name="ycol" value="2"/>\n+ <param name="type" value="line"/>\n+ <param name="lty" value="2"/>\n+ <param name="col" value="2"/>\n+ <param name="lwd" value="1.0"/>\n+ <output name="out_file_pdf" file="XY_Plot_1_out.pdf" ftype="pdf" compare="sim_size" />\n+ </test>\n+ <test><!-- test with file with header line, NA values, multiple ycols and PNG output -->\n+ <param name="main" value="Example XY Plot PNG"/>\n+ <param name="xlab" value="xlab"/>\n+ <param name="ylab" value="ylab"/>\n+ <param name="outftype" value="png"/>\n+ <param name="series_0|input" value="testinput2.tsv" ftype="tabular"/>\n+ <param name="series_0|header" value="TRUE"/>\n+ <param name="series_0|xcol" value="1"/>\n+ <param name="series_0|ycol" value="2,3"/>\n+ <param name="series_0|type" value="points"/>\n+ <param name="series_0|pch" value="1"/>\n+ <param name="series_0|col" value="2"/>\n+ <param name="series_0|cex" value="1.0"/>\n+ <output name="out_file_png" ftype="png" file="testoutput.png" compare="sim_size" />\n+ </test>\n+ </tests>\n+<help>\n+.. class:: infomark\n+\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.\n+\n+-----\n+\n+.. class:: warningmark\n+\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.\n+\n+-----\n+\n+**Example**\n+\n+Input file::\n+\n+ 1 68 4.1\n+ 2 71 4.6\n+ 3 62 3.8\n+ 4 75 4.4\n+ 5 58 3.2\n+ 6 60 3.1\n+ 7 67 3.8\n+ 8 68 4.1\n+ 9 71 4.3\n+ 10 69 3.7\n+\n+Create a two series XY plot on the above data:\n+\n+- Series 1: Red Dashed-Line plot between columns 1 and 2\n+- Series 2: Blue Circular-Point plot between columns 3 and 2\n+\n+.. image:: xy_example.jpg\n+</help>\n+<citations/>\n+</tool>\n' |