view batch_plot.xml @ 1:74753a2845b9 default tip

Uploaded
author dsobral
date Fri, 23 Mar 2012 03:22:08 -0400
parents 71c4282199f0
children
line wrap: on
line source

<tool id="batch_plot" name="batch plot" version="0.1">
  <description>Batch plot in R</description>
  <command interpreter="bash">r_wrapper.sh $script_file</command>

  <inputs>
   	<param name="input" type="data" format="tabular" label="Data to plot (tab separated)"/>	
   	<param name="group" type="text" value="Group" label="Name of Column to Group (case-sensitive, avoid spaces)"/>
  </inputs>

  <configfiles>
    <configfile name="script_file">
		## Setup R error handling to go to stderr
		options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
		
		data=read.table("${input}",sep="\t",header=TRUE)
		pdf("${output}"); 
		with(data, { sapply(names(data[,sapply(data, is.numeric)]), function(x) { boxplot(data[[x]] ~ $group); points(data[[x]] ~ $group); title(x);} ); "OK" } ); 
		dev.off();

    </configfile>
  </configfiles>
  
  <outputs>
    <data format="pdf" name="output" />
  </outputs>
  
    <tests>
        <test>
            <param name="input" value="test_counts.tab"/>
            <output name="out_file" file="output.pdf"/>
        </test>
    </tests>
    
<help>

.. class:: infomark

This tool makes a PDF of groups of box plots from a tabulated file.
It creates one plot per column, each one grouped by a user-specific column (by default named Group).
The title of each plot is the name of the column being plotted. 

-----


**Example**

</help>
</tool>