changeset 7:596a7b43a95b draft

changed R version
author kuyt002
date Tue, 24 Jun 2014 12:48:40 +0200
parents 357a3a950661 (current diff) 47b212acef77 (diff)
children ea2c4509a07f
files vennerable/tool_dependencies.xml
diffstat 7 files changed, 390 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.directory	Tue Jun 24 12:48:40 2014 +0200
@@ -0,0 +1,5 @@
+[Dolphin]
+Timestamp=2014,6,17,13,13,59
+
+[Settings]
+HiddenFilesShown=true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.project	Tue Jun 24 12:48:40 2014 +0200
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>vennerable</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vennerable/Vennerable.R	Tue Jun 24 12:48:40 2014 +0200
@@ -0,0 +1,58 @@
+#!/usr/bin/R
+
+# R script to call Vennerable package from galaxy
+# info: alex.bossers@wur.nl
+
+# R --slave --vanilla --file=PlotBar.R --args inputFile x_data weighting outputFile plottype resolution
+# 1     2       3             4           5       6        7       8         9        10        11
+
+#get cmd line args
+args <- commandArgs()
+	in.file	<- args[6]
+	xData		<- args[7]   # data labels xData of format "a, b, c" and can include spaces
+	weighting	<- args[8] 
+	out.file	<- args[9]
+	plottype	<- args[10]
+	resolution	<- args[11]	#in dpi
+	
+#open lib
+library(Vennerable)
+
+# for labels of bars or bar groups presume column names from data
+if (xData != "default") {
+	# read without header input file (must be tabular)
+	annot_data <- read.table(in.file, header=F, sep="\t")
+	colnames (annot_data) <- strsplit(xData,",")[[1]]
+	Vannot <- Venn(annot_data)
+} else {
+	# read without header input file (must be tabular)
+	annot_data <- read.table(in.file, header=T, sep="\t")
+	Vannot <- Venn(annot_data)
+}
+
+#png(out.file,width = 1600, height = 1600, res = resolution)
+#due to png x11 combination errors its now temporarily a pdf. If not use this line to get a high quality png
+#png(out.file, res = resolution)
+pdf(out.file)
+#svg(out.file)
+# plot it
+if (plottype == "ChowRuskey") {
+	plot(Vannot, type = plottype)
+
+} else if (plottype == "AWFE") {
+	plot(Vannot, doWeights = weighting, type = plottype)
+
+} else if (plottype == "circles") {
+	plot(Vannot)
+
+} else if (plottype == "ellipses"){
+	plot(Vannot, type = "ellipses")
+
+} else if (plottype == "squares"){
+	plot(Vannot, type = "squares")
+
+}
+
+cat ("version 1.0, info: alex.bossers@wur.nl\n")
+dev.off()
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vennerable/Vennerable.xml	Tue Jun 24 12:48:40 2014 +0200
@@ -0,0 +1,116 @@
+<tool id="Vennerable" name="Vennerable" version="0.9" >
+	<description>: Plot data in Venn or Venn-like diagrams</description>
+	<command>
+	#if $opt.userSpecified == "Yes" 
+		R --slave --vanilla --file=\$VENNERABLE_SCRIPT_PATH/Vennerable.R 
+			--args $inputFile
+			default
+			$weighting
+			$outputFile
+			$plottype
+			$resolution
+			2&gt;$Vennerable_log
+			1&gt;&gt;$Vennerable_log
+	#else
+		R --slave --vanilla --file=\$VENERABLE_SCRIPT_PATH/Vennerable.R
+			--args $inputFile
+			"$opt.xNames" 
+			$weighting
+			$outputFile
+			$plottype
+			$resolution
+			2&gt;$Vennerable_log
+			1&gt;&gt;$Vennerable_log
+	#end if
+	</command>	
+	<inputs>
+		<param name="inputFile" format="tabular" type="data" label="Data set" />
+		<conditional name="opt">
+			<param name="userSpecified" type="select" label="Use column headers as dataset names?">
+				<option value="Yes">Yes</option>
+				<option value="No">No</option>
+			</param>
+			<when value="Yes">
+			</when>
+			<when value="No">
+				<param name="xNames" type="text" label="Alternative data names" value="A,B,C,D" help="(comma-separated)"/>
+			</when>
+		</conditional>
+		<param name="plottype" type="select" label="Plot type to use" help="some other options might get disabled for certain plottypes" >
+			<option value="AWFE" selected="True">AWFE: Edwards-Venn (Non-weighted)</option>
+			<option value="ChowRuskey">Chow-Ruskey (always weigthed)</option>
+			<option value="ellipses">Ellipses (4 datasets only and always non-weighted)</option>
+			<option value="circles">Circles (max 3 datasets)</option>
+			<option value="squares">Squares (max 4 datasets non-weighted)</option>
+		</param>
+		<param name="weighting" type="select" label="Use weighting for data in plot" >
+			<option value="FALSE" selected="True">Non-weighted</option>
+			<option value="TRUE">Weighted</option>
+		</param>
+		<param name="resolution" type="integer" label="Resolution to use (dpi)" value="150" help="Plot features can be sized with this setting. Lower (50) is larger text.&lt;br /&gt;&lt;i&gt;Temporarily it generates a pdf not supporting these functions!&lt;/i&gt;" />
+	</inputs>
+	<outputs>
+<!--		<data name="outputFile" format="png" label="Venn diagram of ${inputFile.name}"/>
+-->
+		<data name="outputFile" format="pdf" label="Venn diagram of ${inputFile.name}"/>
+		<data name="Vennerable_log" format="tabular" label="Vennerable output and error log file" />
+	</outputs>
+	<tests>
+		<test>
+		</test>
+	</tests>
+	<requirements>
+		<requirement type="package" version="3.0.3">R_3_0_3</requirement>
+		<requirement type="package" version="3.0">venerable</requirement>
+		<requirement type="set_environment">VENNERABLE_SCRIPT_PATH</requirement>
+	</requirements>
+	<help>
+| 
+
+
+**What it does**
+
+Vennerable V2.0 (09-10-2009)
+
+This tool will use the Vennerable R package to plot data as weighted or un-weighted diagrams such as Venn, Edwards-Venn and Chow-Rusky. 
+
+The tool can take 2 to 7 collumns of data but more are adviced not to be used (for speed and clarity).
+
+-----
+
+**Input**
+
+It takes a tabular file containing identifiers. Matches will be calculated automatically.
+
+Be sure to specify headers if you haven't any in your dataset! Otherwise the top row of data will be excluded.
+
+::
+ 
+ DataA	DataB	DataC	DataD
+ HUM1	AGK2	AGK2	RTT3
+ AGK2	ZZE3	ERT3	ZPD3
+ ZPD3	AAW3	RTT3	WER2
+ WER2	HUM1	RRW4	DUM1
+
+-----
+
+**Example**
+
+.. image:: ../static/images/WURtools/VennerablePlot.png 
+
+-----
+
+**References**
+
+- alex.bossers@wur.nl
+- Vennerable R package: http://r-forge.r-project.org/projects/vennerable/ 
+
+-----
+
+.. class:: infomark
+
+**TIP:** If your data is not TAB delimited, use *Text Manipulation-&gt;Convert*
+
+
+  </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vennerable/static/images/Vennerable.R_backup.png	Tue Jun 24 12:48:40 2014 +0200
@@ -0,0 +1,56 @@
+#!/usr/bin/R
+
+# R script to call Vennerable package from galaxy
+# info: alex.bossers@wur.nl
+
+# R --slave --vanilla --file=PlotBar.R --args inputFile x_data weighting outputFile plottype resolution
+# 1     2       3             4           5       6        7       8         9        10        11
+
+#get cmd line args
+args <- commandArgs()
+	in.file	<- args[6]
+	xData		<- args[7]   # data labels xData of format "a, b, c" and can include spaces
+	weighting	<- args[8] 
+	out.file	<- args[9]
+	plottype	<- args[10]
+	resolution	<- args[11]	#in dpi
+	
+#open lib
+library(Vennerable)
+
+# for labels of bars or bar groups presume column names from data
+if (xData != "default") {
+	# read without header input file (must be tabular)
+	annot_data <- read.table(in.file, header=F, sep="\t")
+	colnames (annot_data) <- strsplit(xData,",")[[1]]
+	Vannot <- Venn(annot_data)
+} else {
+	# read without header input file (must be tabular)
+	annot_data <- read.table(in.file, header=T, sep="\t")
+	Vannot <- Venn(annot_data)
+}
+
+#png(out.file,width = 1600, height = 1600, res = resolution)
+png(out.file, res = resolution)
+
+# plot it
+if (plottype == "ChowRuskey") {
+	plot(Vannot, type = plottype)
+
+} else if (plottype == "AWFE") {
+	plot(Vannot, doWeights = weighting, type = plottype)
+
+} else if (plottype == "circles") {
+	plot(Vannot)
+
+} else if (plottype == "ellipses"){
+	plot(Vannot, type = "ellipses")
+
+} else if (plottype == "squares"){
+	plot(Vannot, type = "squares")
+
+}
+
+cat ("version 1.0, info: alex.bossers@wur.nl\n")
+dev.off()
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vennerable/static/images/Vennerable.xml_backup.png	Tue Jun 24 12:48:40 2014 +0200
@@ -0,0 +1,112 @@
+<tool id="Vennerable" name="Vennerable" version="0.9" >
+	<description>: Plot data in Venn or Venn-like diagrams</description>
+	<command>
+	#if $opt.userSpecified == "Yes" 
+		R --slave --vanilla --file=$GALAXY_ROOT_DIR/tools/WURtools/R_tools/Vennerable.R 
+			--args $inputFile
+			default
+			$weighting
+			$outputFile
+			$plottype
+			$resolution
+			2&gt;$Vennerable_log
+			1&gt;&gt;$Vennerable_log
+	#else
+		R --slave --vanilla --file=$GALAXY_ROOT_DIR/tools/WURtools/R_tools/Vennerable.R
+			--args $inputFile
+			"$opt.xNames" 
+			$weighting
+			$outputFile
+			$plottype
+			$resolution
+			2&gt;$Vennerable_log
+			1&gt;&gt;$Vennerable_log
+	#end if
+	</command>	
+	<inputs>
+		<param name="inputFile" format="tabular" type="data" label="Data set" />
+		<conditional name="opt">
+			<param name="userSpecified" type="select" label="Use column headers as dataset names?">
+				<option value="Yes">Yes</option>
+				<option value="No">No</option>
+			</param>
+			<when value="Yes">
+			</when>
+			<when value="No">
+				<param name="xNames" type="text" label="Alternative data names" value="A,B,C,D" help="(comma-separated)"/>
+			</when>
+		</conditional>
+		<param name="plottype" type="select" label="Plot type to use" help="some other options might get disabled for certain plottypes" >
+			<option value="AWFE" selected="True">AWFE: Edwards-Venn (Non-weighted)</option>
+			<option value="ChowRuskey">Chow-Ruskey (always weigthed)</option>
+			<option value="ellipses">Ellipses (4 datasets only and always non-weighted)</option>
+			<option value="circles">Circles (max 3 datasets)</option>
+			<option value="squares">Squares (max 4 datasets non-weighted)</option>
+		</param>
+		<param name="weighting" type="select" label="Use weighting for data in plot" >
+			<option value="FALSE" selected="True">Non-weighted</option>
+			<option value="TRUE">Weighted</option>
+		</param>
+		<param name="resolution" type="integer" label="Resolution to use (dpi)" value="150" help="Plot features can be sized with this setting. Lower (50) is larger text." />
+	</inputs>
+	<outputs>
+		<data name="outputFile" format="png" label="Venn diagram of ${inputFile.name}"/>
+		<data name="Vennerable_log" format="tabular" label="Vennerable output and error log file" />
+	</outputs>
+	<tests>
+		<test>
+		</test>
+	</tests>
+	<requirements>
+		<requirement type="binary">R</requirement>
+	</requirements>
+	<help>
+| 
+
+
+**What it does**
+
+Vennerable V2.0 (09-10-2009)
+
+This tool will use the Vennerable R package to plot data as weighted or un-weighted diagrams such as Venn, Edwards-Venn and Chow-Rusky. 
+
+The tool can take 2 to 7 collumns of data but more are adviced not to be used (for speed and clarity).
+
+-----
+
+**Input**
+
+It takes a tabular file containing identifiers. Matches will be calculated automatically.
+
+Be sure to specify headers if you haven't any in your dataset! Otherwise the top row of data will be excluded.
+
+::
+ 
+ DataA	DataB	DataC	DataD
+ HUM1	AGK2	AGK2	RTT3
+ AGK2	ZZE3	ERT3	ZPD3
+ ZPD3	AAW3	RTT3	WER2
+ WER2	HUM1	RRW4	DUM1
+
+-----
+
+**Example**
+
+.. image:: ../static/images/WURtools/VennerablePlot.png 
+
+-----
+
+**References**
+
+- alex.bossers@wur.nl
+- Vennerable R package: http://r-forge.r-project.org/projects/vennerable/ 
+
+-----
+
+.. class:: infomark
+
+**TIP:** If your data is not TAB delimited, use *Text Manipulation-&gt;Convert*
+
+
+  </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/vennerable/tool_dependencies.xml	Tue Jun 24 12:48:40 2014 +0200
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<tool_dependency>
+	<set_environment version="1.0">
+		<environment_variable name="VENNERABLE_SCRIPT_PATH" action="set_to">$REPOSITORY_INSTALL_DIR/vennerable/</environment_variable>
+	</set_environment>
+	<package name="R_3_0_2" version="3.0.2">
+        <repository changeset_revision="956709746799" name="package_r_3_0_2" owner="devteam" toolshed="http://testtoolshed.g2.bx.psu.edu" />
+                  
+    </package>
+	
+	<package name="venerable" version="3.0">
+         <install version="1.0">
+            <actions>
+                <action type="setup_r_environment">
+                    <repository changeset_revision="956709746799" name="package_r_3_0_2" owner="devteam" toolshed="http://testtoolshed.g2.bx.psu.edu">
+                        <package name="R_3_0_3" version="3.0.3" />
+                    </repository>
+                    <package>http://www.bioconductor.org/packages/devel/bioc/src/contrib/BiocGenerics_0.11.2.tar.gz</package>
+                    <package>http://www.bioconductor.org/packages/release/bioc/src/contrib/graph_1.42.0.tar.gz</package>
+                    <package>http://www.bioconductor.org/packages/release/bioc/src/contrib/RBGL_1.40.0.tar.gz</package>
+                    <package>http://cran.r-project.org/src/contrib/RColorBrewer_1.0-5.tar.gz</package>
+                    <package>http://cran.r-project.org/src/contrib/Rcpp_0.11.2.tar.gz</package>
+                    <package>http://cran.r-project.org/src/contrib/plyr_1.8.1.tar.gz</package>
+                    <package>http://cran.r-project.org/src/contrib/reshape_0.8.5.tar.gz</package>
+                    <package>http://cran.r-project.org/src/contrib/gtools_3.4.1.tar.gz</package>                   
+					<package>http://download.r-forge.r-project.org/src/contrib/Vennerable_3.0.tar.gz</package>
+                </action>
+            </actions>
+        </install>
+	</package>
+</tool_dependency>
+