Repository 'testrepo'
hg clone https://toolshed.g2.bx.psu.edu/repos/saskia-hiltemann/testrepo

Changeset 7:afb09b6aee95 (2015-10-30)
Previous changeset 6:8a6e2b2776d2 (2015-10-29) Next changeset 8:c3cd8bf8f3b5 (2015-10-30)
Commit message:
Uploaded
modified:
xy_plot.xml
added:
test-data/XY_Plot_1_multi_out.bmp
test-data/XY_Plot_1_multi_out.jpeg
test-data/XY_Plot_1_multi_out.pdf
test-data/XY_Plot_1_multi_out.png
test-data/XY_Plot_1_multi_out.tiff
test-data/out_file5
b
diff -r 8a6e2b2776d2 -r afb09b6aee95 test-data/XY_Plot_1_multi_out.bmp
b
Binary file test-data/XY_Plot_1_multi_out.bmp has changed
b
diff -r 8a6e2b2776d2 -r afb09b6aee95 test-data/XY_Plot_1_multi_out.jpeg
b
Binary file test-data/XY_Plot_1_multi_out.jpeg has changed
b
diff -r 8a6e2b2776d2 -r afb09b6aee95 test-data/XY_Plot_1_multi_out.pdf
b
Binary file test-data/XY_Plot_1_multi_out.pdf has changed
b
diff -r 8a6e2b2776d2 -r afb09b6aee95 test-data/XY_Plot_1_multi_out.png
b
Binary file test-data/XY_Plot_1_multi_out.png has changed
b
diff -r 8a6e2b2776d2 -r afb09b6aee95 test-data/XY_Plot_1_multi_out.tiff
b
Binary file test-data/XY_Plot_1_multi_out.tiff has changed
b
diff -r 8a6e2b2776d2 -r afb09b6aee95 test-data/out_file5
b
Binary file test-data/out_file5 has changed
b
diff -r 8a6e2b2776d2 -r afb09b6aee95 xy_plot.xml
--- a/xy_plot.xml Thu Oct 29 12:00:22 2015 -0400
+++ b/xy_plot.xml Fri Oct 30 06:09:30 2015 -0400
b
@@ -1,5 +1,5 @@
-<tool id="XY_Plot_1_multiformat" name="Plotting tool 2" version="1.0.1">
-  <description>for multiple series and graph types</description>
+<tool id="XY_Plot_1_multiformat" name="Plotting tool" version="1.0.1">
+  <description>for multiple series and graph types and multiple output types</description>
   <requirements>
     <requirement type="package" version="3.1.2">R</requirement>
     <requirement type="package" version="2.11.1">fontconfig</requirement>
@@ -10,6 +10,13 @@
     <param name="main" type="text" value="" label="Plot Title"/>
     <param name="xlab" type="text" value="" label="Label for x axis"/>
     <param name="ylab" type="text" value="" label="Label for y axis"/>
+    <param name="ftype" type="select" label="File Type">
+            <option value="pdf">PDF</option>
+            <option value="png">PNG</option>
+            <option value="jpeg">JPEG</option>
+            <option value="bmp">BMP</option>
+            <option value="tiff">TIFF</option>
+          </param>
     <repeat name="series" title="Series">
       <param name="input" type="data" format="tabular" label="Dataset"/>
       <param name="xcol" type="data_column" data_ref="input" label="Column for x axis"/>
@@ -79,7 +86,11 @@
         yrange = range( y${i}, yrange )
       #end for
       ## Open output PDF file
-      png( "${out_file1}" , type="cairo")
+      #if $ftype.value == "pdf"
+        pdf("outfile.pdf")
+      #else
+        "${ftype}"( "outfile.${ftype}" , type="cairo")
+      #end if      
       ## Dummy plot for axis / labels
       plot( NULL, type="n", xlim=xrange, ylim=yrange, main="${main}", xlab="${xlab}", ylab="${ylab}" )
       ## Plot each series
@@ -96,14 +107,43 @@
   </configfiles>
 
   <outputs>
-    <data format="png" name="out_file1" />
+    <data format="pdf" name="out_file1" from_work_dir="outfile.pdf" >
+        <filter>(ftype == 'pdf') </filter>
+    </data>
+    <data format="png" name="out_file2" from_work_dir="outfile.png">
+        <filter>(ftype == 'png') </filter>
+    </data>    
+    <data format="jpg" name="out_file3" from_work_dir="outfile.jpeg">
+        <filter>(ftype == 'jpeg') </filter>
+    </data>
+    <data format="bmp" name="out_file4" from_work_dir="outfile.bmp">
+        <filter>(ftype == 'bmp') </filter>
+    </data>
+    <data format="tiff" name="out_file5" from_work_dir="outfile.tiff">
+        <filter>(ftype == 'tiff') </filter>
+    </data>
   </outputs>
 
     <tests>
         <test>
-            <param name="main" value="Example XY Plot"/>
+            <param name="main" value="Example XY Plot PDF"/>
             <param name="xlab" value="Column 1"/>
             <param name="ylab" value="Column 2"/>
+            <param name="ftype" value="pdf"/>
+            <param name="input" value="2.tabular" ftype="tabular"/>
+            <param name="xcol" value="1"/>
+            <param name="ycol" value="2"/>
+            <param name="type" value="line"/>
+            <param name="lty" value="2"/>
+            <param name="col" value="2"/>
+            <param name="lwd" value="1.0"/>
+            <output name="out_file1" file="XY_Plot_1_multi_out.pdf" md5="83f82e036bdd7fcd51f29e3b7a05c19b"/>
+        </test>
+        <test>
+            <param name="main" value="Example XY Plot PNG"/>
+            <param name="xlab" value="Column 1"/>
+            <param name="ylab" value="Column 2"/>
+            <param name="ftype" value="png"/>
             <param name="input" value="2.tabular" ftype="tabular"/>
             <param name="xcol" value="1"/>
             <param name="ycol" value="2"/>
@@ -111,7 +151,49 @@
             <param name="lty" value="2"/>
             <param name="col" value="2"/>
             <param name="lwd" value="1.0"/>
-            <output name="out_file1" file="XY_Plot_1_out.pdf"/>
+            <output name="out_file2" file="XY_Plot_1_multi_out.png" md5="777f98fc9a29c3a02ce4da2fa61437c9"/>
+        </test>
+        <test>
+            <param name="main" value="Example XY Plot JPEG"/>
+            <param name="xlab" value="Column 1"/>
+            <param name="ylab" value="Column 2"/>
+            <param name="ftype" value="jpeg"/>
+            <param name="input" value="2.tabular" ftype="tabular"/>
+            <param name="xcol" value="1"/>
+            <param name="ycol" value="2"/>
+            <param name="type" value="line"/>
+            <param name="lty" value="2"/>
+            <param name="col" value="2"/>
+            <param name="lwd" value="1.0"/>
+            <output name="out_file3" file="XY_Plot_1_multi_out.jpeg" md5="609f009b8cd92c0662cb39d6e2eb8cc7"/>
+        </test>
+        <test>
+            <param name="main" value="Example XY Plot BMP"/>
+            <param name="xlab" value="Column 1"/>
+            <param name="ylab" value="Column 2"/>
+            <param name="ftype" value="bmp"/>
+            <param name="input" value="2.tabular" ftype="tabular"/>
+            <param name="xcol" value="1"/>
+            <param name="ycol" value="2"/>
+            <param name="type" value="line"/>
+            <param name="lty" value="2"/>
+            <param name="col" value="2"/>
+            <param name="lwd" value="1.0"/>
+            <output name="out_file4" file="XY_Plot_1_multi_out.bmp" md5="a036aa3d0bbc0ff58664077cb5c8e04a"/>
+        </test>
+        <test>
+            <param name="main" value="Example XY Plot TIFF"/>
+            <param name="xlab" value="Column 1"/>
+            <param name="ylab" value="Column 2"/>
+            <param name="ftype" value="tiff"/>
+            <param name="input" value="2.tabular" ftype="tabular"/>
+            <param name="xcol" value="1"/>
+            <param name="ycol" value="2"/>
+            <param name="type" value="line"/>
+            <param name="lty" value="2"/>
+            <param name="col" value="2"/>
+            <param name="lwd" value="1.0"/>
+            <output name="out_file5" file="XY_Plot_1_multi_out.tiff" md5="e6ba5639144b23480c556e2185bb5d9a"/>
         </test>
     </tests>
 <help>