Repository 'rnbeads'
hg clone https://toolshed.g2.bx.psu.edu/repos/pavlo-lutsik/rnbeads

Changeset 0:d1d0d07a8af4 (2013-04-17)
Next changeset 1:d4c4069367d7 (2013-04-17)
Commit message:
First commit
added:
RnBeadsGalaxy.R
install.rnbeads.R
rnbeads.xml
rnbeads_galaxy_wrapper.sh
rnbeads_repos.txt.sample
tool_data_table_conf.xml.sample
tool_dependencies.xml
b
diff -r 000000000000 -r d1d0d07a8af4 RnBeadsGalaxy.R
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/RnBeadsGalaxy.R Wed Apr 17 07:44:04 2013 -0400
[
@@ -0,0 +1,154 @@
+library(RnBeads)
+library(getopt)
+
+
+
+#all.opts<-names(rnb.options())
+opt.class<-RnBeads:::OPTION.TYPES[-28]
+all.opts<-names(opt.class)
+#all.opts<-paste("--", all.opts, sep="")
+#all.opts<-gsub("\\.([a-z])", "\\U\\1", all.opts, perl=TRUE)
+all.opts<-gsub("\\.","-", all.opts)
+#opt.class<-sapply(rnb.options(), class)
+
+rnb.opt.spec<-data.frame(
+ Long=all.opts, 
+ Short=as.character(1:length(all.opts)), 
+ Mask=c(1,2)[as.integer((opt.class=="logical"))+1], 
+ Type=opt.class)
+
+### automated xml file preparation
+#xml.strings<-apply(rnb.opt.spec,1, function(row){
+#
+# opt.lab<-gsub("-", ".", row[1])
+# opt.def.val<-rnb.getOption(opt.lab)
+# opt.name<-gsub("-([0-9a-z])", "\\U\\1", row[1], perl=TRUE)
+# tf.opt<-"\t\t\t<option value=\"True\">True</option>\n\t\t\t<option value=\"False\">False</option>"
+# opt.lab<-paste(opt.lab, gsub("\\."," ", row[4]), sep=", ")
+# if(row[4]=="logical"){
+# opt.type<-'select'
+# if(!is.null(opt.def.val) && opt.def.val)
+# opt.def.val<-"1" else
+# opt.def.val<-"0"
+# string<-sprintf("\t\t<param name=\"%s\" type=\"%s\" label=\"%s\" value=\"%s\">\n%s\n\t\t</param>\n", opt.name, opt.type, opt.lab, opt.def.val, tf.opt)
+# }else{
+# opt.type<-'text'
+# if(!is.null(opt.def.val) && opt.def.val!="")
+# opt.def.val<-paste(opt.def.val, collapse=",") else
+# opt.def.val<-""
+# string<-sprintf("\t\t<param name=\"%s\" type=\"%s\"  label=\"%s\" value=\"%s\"/>\n", opt.name, opt.type, opt.lab, opt.def.val)
+# }
+# string
+# })
+#
+#cat(xml.strings, sep="", file="C:\\Users\\User\\workspace\\RnBeads\\Supplement\\galaxy\\automated.settings.xml.txt")
+#
+#opt.def.strings<-apply(rnb.opt.spec,1, function(row){
+#
+# opt.name<-gsub("-([0-9a-z])", "\\U\\1", row[1], perl=TRUE)
+# opt.long<-row[1]
+# opt.short<-row[2]
+#
+# if(row[4]=="logical"){
+# def.string<-sprintf("#if str( $options.%s ) == \"True\"\n\t--%s\n#end if\n", opt.name, opt.long)
+# }else{
+# def.string<-sprintf("#if str( $options.%s ) != \"\"\n\t--%s = \"$options.%s\" \n#end if\n", opt.name, opt.long, opt.name)
+# }
+# def.string
+#
+# })
+#cat(opt.def.strings, sep="", file="C:\\Users\\User\\workspace\\RnBeads\\Supplement\\galaxy\\automated.option.assignments.txt")
+
+
+rnb.opt.spec$Type<-gsub("\\.vector", "", rnb.opt.spec$Type)
+rnb.opt.spec$Type<-gsub("numeric", "double", rnb.opt.spec$Type)
+rnb.opt.spec<-rbind(data.frame(
+ Long=c("data-type", "pheno", "idat-dir","idat-files","bed-files", "gs-report", "geo-series", "betas", "pvals","report-dir"),
+ Short=c("d","s","a","i","f","g","e","b","p","r"),
+ Mask=c(1,2,2,2,2,2,2,2,2,1),
+ Type=c("character","character","character","character","character","character","character","character","character","character")),
+ rnb.opt.spec)
+
+opts<-getopt(as.matrix(rnb.opt.spec))
+#opts<-getopt(as.matrix(rnb.opt.spec), opt=list("--data-type=idats","--report-dir=dir", "--idats=file1\tfile2"))
+print(opts)
+
+if(opts[["data-type"]]=="idatDir"){
+   
+ data.source<-list()
+ data.type<-"idat.dir"
+ data.source[["idat.dir"]]<-opts[["idat-dir"]]
+ data.source[["sample.sheet"]]<-opts[["pheno"]]
+   
+}else if(opts[["data-type"]]=="idatFiles"){
+
+ data.type<-"idat.dir"
+ files<-strsplit(opts[["idat-files"]], "\t")[[1]]
+ idat.dir<-mkdir(file.path(opts[["report-dir"]], "idats"))
+ file.copy(as.list(files), idat.dir)
+ data.source<-list()
+ data.source[["idat.dir"]]<-idat.dir
+ data.source[["sample.sheet"]]<-opts[["pheno"]]
+
+
+}else if(opts[["data-type"]]=="GS.report"){
+
+ data.type<-"GS.report"
+ data.source<-opts[["gs-report"]]
+
+}else if(opts[["data-type"]]=="GEO"){
+
+ data.type<-"GEO"
+ data.source<-opts[["geo-series"]]
+
+
+}else if(opts[["data-type"]]=="data.files"){
+
+ data.type<-"GEO"
+ data.source<-opts[["geo-series"]]
+
+}else if(opts[["data-type"]]=="data.files"){
+
+ data.type<-"data.files"
+ data.source<-c(opts[["pheno"]], opts[["betas"]])
+ if(!is.null(opts[["pvals"]]))
+ data.source<-c(data.source, opts[["pvals"]])
+
+}else if(opts[["data-type"]]=="beds"){
+
+ data.type<-"idat.dir"
+ files<-strsplit(opts[["bed-files"]], "\t")[[1]]
+ bed.dir<-mkdir(file.path(opts[["report-dir"]], "beds"))
+ file.copy(as.list(files), bed.dir)
+ data.source<-list()
+ data.source[["bed.dir"]]<-bed.dir
+ data.source[["sample.sheet"]]<-opts[["pheno"]]
+
+}
+
+dump<-sapply(names(opt.class), function(on){
+ getopname<-gsub("\\.","-",on)
+ if(getoptname %in% names(opts)){
+ if(opt.class[on]=="logical"){
+ rnb.options(on=TRUE)
+ }else if(opt.class %in% c("character","character.vector")){
+ ov<-opts[[getoptname]]
+ ov<-gsub("\"", "", ov)
+ if(opt.class=="character.vector"){
+ ov<-as.character(strsplit(ov,","))
+ }
+ rnb.options(on=ov)
+ }else if(opt.class %in% c("integer","numeric","integer.vector","numeric.vector")){
+ ov<-opts[[getoptname]]
+ ov<-gsub("\"", "", ov)
+ if(opt.class %in% c("integer.vector","numeric.vector")){
+ ov<-as.character(strsplit(ov,","))
+ }
+ rnb.options(on=ov)
+ }
+ }
+})
+
+
+rnb.run.analysis(data.source=data.source, dir.report=opts[["report-dir"]], data.type=data.type)
+
b
diff -r 000000000000 -r d1d0d07a8af4 install.rnbeads.R
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/install.rnbeads.R Wed Apr 17 07:44:04 2013 -0400
b
@@ -0,0 +1,1 @@
+source("http://rnbeads.mpi-inf.mpg.de/install.R")
\ No newline at end of file
b
diff -r 000000000000 -r d1d0d07a8af4 rnbeads.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rnbeads.xml Wed Apr 17 07:44:04 2013 -0400
b
b'@@ -0,0 +1,495 @@\n+<?xml version="0.9"?>\r\n+<tool id="rnbeads" name="RnBeads" version="0.9">\r\n+  <description>Performs RnBeads analysis for the selected set of </description>\r\n+  <requirements>\r\n+    <requirement type="set_environment" version="0.9">R_SCRIPTS_PATH</requirement>\r\n+    <requirement type="package" version="3.0.0">R</requirement>\r\n+  </requirements>\r\n+  <command interpreter="bash">rnbeads_galaxy_wrapper.sh  \r\n+      #if str( $inputDataSelector.dataType ) == "idat"  \r\n+      \t--data-type="idat.dir"\r\n+      \t--pheno="$inputDataSelector.sampleAnnotations"\r\n+      \t#if str( $idatSelector.idatSelector.idatSource ) == "history"\r\n+      \t--idat-files =="\r\n+      \t\t#for $input_files in $inputDataSelector.input_series:\r\n+    \t\t\t${input_files.input_files}\\t\t\t\t\t\r\n+    \t\t#end for\r\n+    \t"\r\n+      \t#else:\r\n+      \t\t--idat-files == "$idatRepo"\r\n+      \t#end if\r\n+      #end if\r\n+      #if str( $inputDataSelector.dataType ) == "gsreport"\r\n+      \t--data-type="GS.report"\r\n+      \t--gs-report="$inputDataSelector.gsReportFile"\r\n+      #end if\r\n+      #if str( $inputDataSelector.dataType ) == "geo"\r\n+      \t--data-type="GEO"\r\n+      \t--geo-series=$inputDataSelector.geoSeries\r\n+      #end if\r\n+      #if str( $inputDataSelector.dataType ) == "tables"\r\n+        --data-type="data.files"\r\n+        --pheno="$inputDataSelector.sampleAnnotations"\r\n+      #end if\r\n+      #if str( $inputDataSelector.dataType ) == "tables"\r\n+      \t--data-type="data.files"\r\n+      \t--pheno="$inputDataSelector.sampleAnnotations"\r\n+      \t--betas="$inputDataSelector.betaTable"\r\n+      \t--pvals="$inputDataSelector.pvalTable"\r\n+      #end if\r\n+      #if str( $inputDataSelector.dataType ) == "bed"\r\n+        --data-type="bed.dir"\r\n+      \t--pheno="$inputDataSelector.sampleAnnotations"\r\n+        --beds =="\r\n+      \t#for $input_files in $inputDataSelector.input_series:\r\n+    \t\t\t${input_files.input_files}\\t\t\t\t\t\r\n+    \t\t#end for\r\n+      #end if\r\n+      \t--report-dir="$html_file.files_path"\r\n+      #if str( $options.optionSet ) == "full"\r\n+\t\t\t\t#if str( $options.analysisName ) != ""\r\n+\t\t\t\t\t--analysis-name = "$options.analysisName" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.logging ) == "True"\r\n+\t\t\t\t\t--logging\r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.email ) != ""\r\n+\t\t\t\t\t--email = "$options.email" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.assembly ) != ""\r\n+\t\t\t\t\t--assembly = "$options.assembly" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.analyzeSites ) == "True"\r\n+\t\t\t\t\t--analyze-sites\r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.regionTypes ) != ""\r\n+\t\t\t\t\t--region-types = "$options.regionTypes" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.identifiersColumn ) != ""\r\n+\t\t\t\t\t--identifiers-column = "$options.identifiersColumn" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.pointsCategory ) != ""\r\n+\t\t\t\t\t--points-category = "$options.pointsCategory" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.colorsCategory ) != ""\r\n+\t\t\t\t\t--colors-category = "$options.colorsCategory" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.colorsGradient ) != ""\r\n+\t\t\t\t\t--colors-gradient = "$options.colorsGradient" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.minGroupSize ) != ""\r\n+\t\t\t\t\t--min-group-size = "$options.minGroupSize" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.maxGroupCount ) != ""\r\n+\t\t\t\t\t--max-group-count = "$options.maxGroupCount" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.gzLargeFiles ) == "True"\r\n+\t\t\t\t\t--gz-large-files\r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.strandSpecific ) == "True"\r\n+\t\t\t\t\t--strand-specific\r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.replicateIdColumn ) != ""\r\n+\t\t\t\t\t--replicate-id-column = "$options.replicateIdColumn" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.loadingNormalization ) == "True"\r\n+\t\t\t\t\t--loading-normalization\r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.loadingDefaultDataType ) != ""\r\n+\t\t\t\t\t--loading-default-data-type = "$options.loadingDefaultDataType" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.loadingTableSeparator ) != ""\r\n+\t\t\t\t\t--loading-table-separator = "$options.loadingTableSeparator" \r\n+\t\t\t\t#end if\r\n+\t\t\t\t#if str( $options.loadingBedStyle'..b'name="batchCorrelationQc" type="select" label="batch.correlation.qc, logical" value="1">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+\t\t\t\t<param name="profiles" type="select" label="profiles, logical" value="1">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+\t\t\t\t<param name="profilesBetaDistribution" type="select" label="profiles.beta.distribution, logical" value="1">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+\t\t\t\t<param name="profilesIntersample" type="select" label="profiles.intersample, logical" value="1">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+\t\t\t\t<param name="profilesDeviationPlots" type="select" label="profiles.deviation.plots, logical" value="0">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+\t\t\t\t<param name="profilesColumns" type="text"  label="profiles.columns, integer vector" value=""/>\r\n+\t\t\t\t<param name="profilesClustering" type="select" label="profiles.clustering, logical" value="1">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+\t\t\t\t<param name="profilesClusteringTopProbes" type="text"  label="profiles.clustering.top.probes, integer vector" value="1000"/>\r\n+\t\t\t\t<param name="regionProfilesTypes" type="text"  label="region.profiles.types, character vector" value="genes,promoters,cpgislands"/>\r\n+\t\t\t\t<param name="differential" type="select" label="differential, logical" value="1">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+\t\t\t\t<param name="differentialPermutations" type="text"  label="differential.permutations, integer" value="0"/>\r\n+\t\t\t\t<param name="differentialComparisonColumns" type="text"  label="differential.comparison.columns, integer vector" value=""/>\r\n+\t\t\t\t<param name="differentialEnrichment" type="select" label="differential.enrichment, logical" value="0">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+\t\t\t\t<param name="exportToUcsc" type="text"  label="export.to.ucsc, character vector" value="bigBed,bigWig"/>\r\n+\t\t\t\t<param name="exportToBed" type="select" label="export.to.bed, logical" value="1">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+\t\t\t\t<param name="exportToCsv" type="select" label="export.to.csv, logical" value="0">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+\t\t\t\t<param name="exportTypes" type="text"  label="export.types, character vector" value=""/>\r\n+\t\t\t\t<param name="colors3Gradient" type="text"  label="colors.3.gradient, character vector" value="#832424,#FFFFFF,#3A3A98"/>\r\n+\t\t\t\t<param name="loggingMemory" type="select" label="logging.memory, logical" value="0">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+\t\t\t\t<param name="usePstoimg" type="select" label="use.pstoimg, logical" value="0">\r\n+\t\t\t\t\t<option value="True">True</option>\r\n+\t\t\t\t\t<option value="False">False</option>\r\n+\t\t\t\t</param>\r\n+    \t</when>\r\n+    </conditional>\r\n+  </inputs>\r\n+  \r\n+  <outputs>\r\n+\t<data format="html" name="html_file" label="index.html" />\r\n+  </outputs>\r\n+\r\n+  <!--\r\n+  <tests>\r\n+    <test>\r\n+      <param name="input" value="fa_gc_content_input.fa"/>\r\n+      <output name="out_file1" file="fa_gc_content_output.txt"/>\r\n+    </test>\r\n+  </tests>  -->\r\n+\r\n+  <help>\r\n+\tRnBeads is an R-package for comprehensive analysis of Illumina Infinium HumanMethylation450 BeadChip data. It extends previous approaches for this type of data analysis by high throughput capabilities, as well as presenting results in a comprehensive, highly interpretable fashion.\r\n+  </help>\r\n+\r\n+</tool>\n\\ No newline at end of file\n'
b
diff -r 000000000000 -r d1d0d07a8af4 rnbeads_galaxy_wrapper.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rnbeads_galaxy_wrapper.sh Wed Apr 17 07:44:04 2013 -0400
b
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+#Rscript  --slave $(dirname $(readlink -f $0))/RnBeadsGalaxy.R $*
+Rscript  --slave \$R_SCRIPTS_PATH/RnBeadsGalaxy.R $*
\ No newline at end of file
b
diff -r 000000000000 -r d1d0d07a8af4 rnbeads_repos.txt.sample
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rnbeads_repos.txt.sample Wed Apr 17 07:44:04 2013 -0400
b
@@ -0,0 +1,1 @@
+repo1 Repository1 /data/iscan/idats
\ No newline at end of file
b
diff -r 000000000000 -r d1d0d07a8af4 tool_data_table_conf.xml.sample
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.sample Wed Apr 17 07:44:04 2013 -0400
b
@@ -0,0 +1,6 @@
+<tables>
+ <table name="rnbeads_repos" comment_char="#">
+        <columns>id, name, value</columns>
+         <file path="tool-data/rnbeads_repos.txt" />
+ </table>
+</tables>
\ No newline at end of file
b
diff -r 000000000000 -r d1d0d07a8af4 tool_dependencies.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml Wed Apr 17 07:44:04 2013 -0400
b
@@ -0,0 +1,22 @@
+<?xml version="1.0"?>
+<tool_dependency>
+    <set_environment version="0.9">
+        <environment_variable name="R_SCRIPTS_PATH" action="set_to">$REPOSITORY_INSTALL_DIR</environment_variable>
+    </set_environment>
+    <package name="R" version="3.0.0">
+        <install version="0.9">
+            <actions>
+                <action type="download_by_url">http://CRAN.R-project.org/src/base/R-3/R-3.0.0.tar.gz</action>
+                <action type="shell_command">./configure --prefix=$INSTALL_DIR --with-x=no</action>
+                <action type="shell_command">make</action>
+                <action type="set_environment">
+                    <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/bin</environment_variable>
+                </action>
+                <action type="shell_command">R --no-save &lt;&lt;&lt; "source('http://rnbeads.mpi-inf.mpg.de')"</action>
+            </actions>
+        </install>
+        <readme>
+ You need a FORTRAN compiler or perhaps f2c in addition to a C compiler to build R.
+        </readme>
+    </package>
+</tool_dependency>
\ No newline at end of file