changeset 28:49ce6fbe11de draft

planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit cb90fdea2a64908e301355aef89de403e107764d
author sblanck
date Thu, 21 Jun 2018 04:28:19 -0400
parents 75612b9d44cf
children 102e4ef8fed2
files MetaRNASeq.R MetaRNASeq_tpl.html MetaRNAseq.xml
diffstat 3 files changed, 30 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/MetaRNASeq.R	Thu Mar 22 10:48:15 2018 -0400
+++ b/MetaRNASeq.R	Thu Jun 21 04:28:19 2018 -0400
@@ -153,8 +153,13 @@
 
 # combinations
 library(metaRNASeq)
+library(UpSetR)
 fishcomb<-fishercomb(rawpval, BHth=alpha)
 warning(length(rawpval))
+
+#nrep=c(length(listFiles))
+
+
 invnormcomb<-invnorm(rawpval, nrep=c(8,8), BHth=alpha)
 #DE[["fishercomb"]]<-ifelse(fishcomb$adjpval<=alpha,1,0)
 #DE[["invnormcomb"]]<-ifelse(invnormcomb$adjpval<=alpha,1,0)
@@ -185,12 +190,25 @@
 #write DE outputfile
 write.table(conflits, outputfile,sep="\t",,row.names=FALSE)
 library(VennDiagram)
-DE_num=apply(DEresults, 2, FUN=function(x) which(x==1))
-venn.plot<-venn.diagram(x=as.list(DE_num),filename=NULL, col="black", fill=1:length(DE_num)+1,alpha=0.6)
-temp.venn.plot = file.path( html.files.path, paste("venn.png"))
-png(temp.venn.plot,width=500,height=500)
-grid.draw(venn.plot)
-dev.off()
+DE_num=apply(keepDE[,1:(length(listfiles)+2)], 2, FUN=function(x) which(x==1))
+#DE_num=apply(DEresults, 2, FUN=function(x) which(x==1))
+if (length(listfiles<=2)) {
+	title="VENN DIAGRAM"
+	width=500
+	venn.plot<-venn.diagram(x=as.list(DE_num),filename=NULL, col="black", fill=1:length(DE_num)+1,alpha=0.6)
+	temp.venn.plot = file.path( html.files.path, paste("venn.png"))
+	png(temp.venn.plot,width=width,height=500)
+	grid.draw(venn.plot)
+	dev.off()
+} else {
+	title="UPSETR DIAGRAM"
+	width=1000
+	png(temp.venn.plot,width=width,height=500)
+	upset(fromList(as.list(DE_num)), order.by = "freq")
+	dev.off()
+	
+}
+
 
 library(jsonlite)
 matrixConflits=as.matrix(conflits)
@@ -210,6 +228,8 @@
 htmlfile=gsub(x=htmlfile,pattern = "###FISHSUMMARYJSON###",replacement = summaryFishcombjson, fixed = TRUE)
 htmlfile=gsub(x=htmlfile,pattern = "###INVSUMMARYJSON###",replacement = summaryinvnormjson, fixed = TRUE)
 htmlfile=gsub(x=htmlfile,pattern = "###VENN###",replacement = vennFilename, fixed = TRUE)
+htmlfile=gsub(x=htmlfile,pattern = "###WIDTH##",replacement = as.character(width), fixed = TRUE)
+htmlfile=gsub(x=htmlfile,pattern = "###TITLE##",replacement = as.character(width), fixed = TRUE)
 write(htmlfile,result.html)
 
 #library(VennDiagram)
--- a/MetaRNASeq_tpl.html	Thu Mar 22 10:48:15 2018 -0400
+++ b/MetaRNASeq_tpl.html	Thu Jun 21 04:28:19 2018 -0400
@@ -139,8 +139,8 @@
 <body>
 
 <table><tr><td>
-<h2>Venn diagram</h2>
-<img src='###VENN###'  height="400" width="400"><br/>
+<h2>###TITLE##</h2>
+<img src='###VENN###'  height="500" width=###WIDTH##><br/>
 </td><td>
 
 </td></tr></table>
--- a/MetaRNAseq.xml	Thu Mar 22 10:48:15 2018 -0400
+++ b/MetaRNAseq.xml	Thu Jun 21 04:28:19 2018 -0400
@@ -1,4 +1,4 @@
-<tool id="metarnaseq" name="RNA-seq data meta-analysis" version="1.0.0">
+<tool id="metarnaseq" name="RNA-seq data meta-analysis" version="1.1.0">
 
     <description>Performs meta-analysis thanks to metaRNAseq</description>
 
@@ -10,6 +10,7 @@
         <requirement type="package">r-jsonlite</requirement> 
         <requirement type="package">r-metarnaseq</requirement>
         <requirement type="package">r-optparse</requirement>
+        <requirement type="package" version="1.3.3">r-upsetr</requirement>
     </requirements>	
 
     <stdio>