diff diffbind.R @ 10:d7725c5596ab draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/diffbind commit f970dcbe9d0e4c3714b1db74c404ea34223cf8ed
author iuc
date Tue, 20 Mar 2018 04:51:25 -0400
parents 6171163112de
children 4c7ab9995f9e
line wrap: on
line diff
--- a/diffbind.R	Sun Jan 28 05:10:25 2018 -0500
+++ b/diffbind.R	Tue Mar 20 04:51:25 2018 -0400
@@ -21,7 +21,8 @@
     'infile' , 'i', 1, "character",
     'format', 'f', 1, "character",
     'th', 't', 1, "double",
-    'bmatrix', 'b', 0, "logical"
+    'bmatrix', 'b', 0, "logical",
+    "rdaOpt", "r", 0, "logical"
 ), byrow=TRUE, ncol=4);
 
 opt = getopt(spec);
@@ -43,6 +44,7 @@
 sample_analyze = dba.analyze(sample_contrast)
 diff_bind = dba.report(sample_analyze)
 orvals = dba.plotHeatmap(sample_analyze, contrast=1, correlations=FALSE)
+dev.off()
 
 resSorted <- diff_bind[order(diff_bind$FDR),]
 write.table(as.data.frame(resSorted), file = opt$outfile, sep="\t", quote = FALSE, append=TRUE, row.names = FALSE, col.names = FALSE)
@@ -53,5 +55,10 @@
     write.table(as.data.frame(bmat), file="bmatrix.tab", sep="\t", quote=FALSE, row.names=FALSE, col.names=FALSE)
 }
 
-dev.off()
+## Output RData file
+
+if (!is.null(opt$rdaOpt)) {
+    save.image(file = "DiffBind_analysis.RData")
+}
+
 sessionInfo()