changeset 15:b7e9bf50295c draft

Uploaded
author pavanvidem
date Tue, 01 Sep 2015 08:19:08 -0400
parents a6949dd64d9c
children 33c17175e3d6
files dexseq.R dexseq.xml tool_dependencies.xml
diffstat 3 files changed, 30 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/dexseq.R	Mon Aug 31 09:51:13 2015 -0400
+++ b/dexseq.R	Tue Sep 01 08:19:08 2015 -0400
@@ -18,14 +18,20 @@
     'help', 'h', 0, "logical",
     'gtf', 'a', 1, "character",
     'outfile', 'o', 1, "character",
-    'report', 'r', 1, "character",
+    'reportdir', 'r', 1, "character",
+    'htmlfile', 'x', 1, "character",
     'factors', 'f', 1, "character",
     'threads', 'p', 1, "integer",
-    'fdr', 'c', 1, "double",
+    'fdr', 'c', 1, "double"
 ), byrow=TRUE, ncol=4);
 opt = getopt(spec);
 
-setwd(opt$report)
+
+#reportdir <- gsub(".dat", "_files", opt$outfile)
+
+dir.create(file.path(opt$reportdir))
+setwd(opt$reportdir)
+getwd()
 
 # if help was asked for print a friendly message
 # and exit with a non-zero error code
@@ -79,8 +85,9 @@
 formulaReducedModel
 primaryFactor
 countFiles
-opt$report
-file.path(opt$report,"DEXSeq_analysis.RData")
+opt$reportdir
+opt$htmlfile
+opt$threads
 getwd()
 
 dxd = DEXSeqDataSetFromHTSeq(countFiles, sampleData=sampleTable, design= formulaFullModel, flattenedfile=opt$gtf)
@@ -97,12 +104,14 @@
 resSorted <- res[order(res$padj),]
 head(resSorted)
 
-write.csv(as.data.frame(resSorted), file=opt$outfile)
+write.table(as.data.frame(resSorted), file = opt$outfile, sep="\t", quote = FALSE, col.names = FALSE)
 
-if ( !is.null(opt$report) ) {
-    save(dxd, resSorted, file = file.path(opt$report,"DEXSeq_analysis.RData"))
+if ( !is.null(opt$reportdir) ) {
+    save(dxd, resSorted, file = file.path(opt$reportdir,"DEXSeq_analysis.RData"))
     save.image()
-    DEXSeqHTML(res, FDR=opt$fdr, color=c("#C3EEE7","#B7FEA0","#F1E7A1","#CEAEFF","#FF8F43","#EDC3C5","#AAA8AA","#FF0000","#637EE9","#FBFBFB"), BPPARAM=BPPARAM)
-    unlink(file.path(opt$report,"DEXSeq_analysis.RData"))
+    DEXSeqHTML(res, path=opt$reportdir, FDR=opt$fdr, color=c("#C3EEE7","#B7FEA0","#F1E7A1","#CEAEFF","#FF8F43","#EDC3C5","#AAA8AA","#FF0000","#637EE9","#FBFBFB"))
+    unlink(file.path(opt$reportdir,"DEXSeq_analysis.RData"))
 }
+file.remove(opt$htmlfile)
+file.symlink(file.path(opt$reportdir,"testForDEU.html"), opt$htmlfile)
 sessionInfo()
--- a/dexseq.xml	Mon Aug 31 09:51:13 2015 -0400
+++ b/dexseq.xml	Tue Sep 01 08:19:08 2015 -0400
@@ -1,5 +1,5 @@
 <tool id="dexseq" name="DEXSeq" version="1.0">
-    <description>Determines differentially expressed features from count tables</description>
+    <description>Determines differential exon usage from count tables</description>
     <requirements>
         <requirement type="package" version="3.2.0">R</requirement>
         <requirement type="binary">Rscript</requirement>
@@ -9,7 +9,7 @@
     <command>
         #import json
         Rscript /usr/local/galaxy/shed_tools/testtoolshed.g2.bx.psu.edu/repos/pavanvidem/dexseq/cbd118202fd1/dexseq/dexseq.R
-            #set $reportdir = $dexseq_out.files_path
+            #set $reportdir = str($dexseq_out).replace('.dat','_files')
             -o "$dexseq_out"
             -p 12
             #set $temp_factor_names = list()
@@ -27,9 +27,12 @@
             -f '#echo json.dumps(temp_factor_names)#'
             -a $gtf
             #if $report:
-                -p "$reportdir"
+                -x "$htmlreport"
+                -r "$reportdir"
             #end if
-            -c $fdr_cutoff
+            -c $fdr_cutoff;
+            
+##            cp #echo os.path.join($reportdir, 'testForDEU.html')# $htmlreport;
     </command>
     <stdio>
         <regex match="Execution halted" 
@@ -71,9 +74,9 @@
     </inputs>
 
     <outputs>
-        <data format="tabular" name="dexseq_out" label="DESeq2 result file on ${on_string}"/>
-        <data format="pdf" name="plots" label="DESeq2 plots on ${on_string}">
-            <filter>pdf == True</filter>
+        <data format="tabular" name="dexseq_out" label="DEXSeq result file on ${on_string}"/>
+        <data format="html" name="htmlreport" label="DEXSeq report on ${on_string}">
+            <filter>report == True</filter>
         </data>
     </outputs>
     <code file="dexseq_helper.py" />
--- a/tool_dependencies.xml	Mon Aug 31 09:51:13 2015 -0400
+++ b/tool_dependencies.xml	Tue Sep 01 08:19:08 2015 -0400
@@ -10,6 +10,7 @@
                     <repository changeset_revision="d973c8e9b29e" name="package_r_3_2_0" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu">
                         <package name="R" version="3.2.0" />
                     </repository>
+                    <package>https://github.com/bgruening/download_store/raw/master/DEXSeq_1.14.2/Cairo_1.5-8.tar.gz</package>
                     <package>https://github.com/bgruening/download_store/raw/master/DEXSeq_1.14.2/rjson_0.2.15.tar.gz</package>
                     <package>https://github.com/bgruening/download_store/raw/master/DEXSeq_1.14.2/getopt_1.20.0.tar.gz</package>
                     <package>https://github.com/bgruening/download_store/raw/master/DEXSeq_1.14.2/lambda.r_1.1.7.tar.gz</package>