# HG changeset patch # User sblanck # Date 1529656231 14400 # Node ID 22e1325aaa88b41a463555f24de5e8acc1b533f4 # Parent a99bbda3cf1f60199d6e675b15139b80fde4fb52 planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 0d3497e4f84869670647f7a6ffceca64469a4c00 diff -r a99bbda3cf1f -r 22e1325aaa88 MetaMA.R --- a/MetaMA.R Thu Jun 21 11:20:56 2018 -0400 +++ b/MetaMA.R Fri Jun 22 04:30:31 2018 -0400 @@ -35,6 +35,7 @@ suppressPackageStartupMessages(require(annaffy)) suppressPackageStartupMessages(require(VennDiagram)) suppressPackageStartupMessages(require(GEOquery)) +suppressPackageStartupMessages(require(UpSetR)) listInput <- trimws( unlist( strsplit(trimws(opt$input), ",") ) ) species=opt$species @@ -56,23 +57,23 @@ result.path<-opt$htmloutputpath result.template<-opt$htmltemplate -showVenn<-function(res,file) -{ - venn.plot<-venn.diagram(x = c(res[c(1:(length(res)-3))],meta=list(res$Meta)), - filename = NULL, col = "black", - fill = c(1:(length(res)-2)), - margin=0.05, alpha = 0.6) - jpeg(file) - grid.draw(venn.plot) - dev.off() -} +#showVenn<-function(res,file) +#{ +# venn.plot<-venn.diagram(x = c(res[c(1:(length(res)-3))],meta=list(res$Meta)), +# filename = NULL, col = "black", +# fill = c(1:(length(res)-2)), +# margin=0.05, alpha = 0.6) +# jpeg(file) +# grid.draw(venn.plot) +# dev.off() +#} if(!species %in% installed.packages()[,"Package"]) { source("https://bioconductor.org/biocLite.R") biocLite(species) } -library("org.Hs.eg.db") +library(species,character.only = TRUE) x <- org.Hs.egUNIGENE mapped_genes <- mappedkeys(x) link <- as.list(x[mapped_genes]) @@ -159,7 +160,7 @@ #write(file="~/galaxy-modal/classes.txt",length(classes)) res=pvalcombination(esets=esets,classes=classes,moderated="limma") resIDDIRR=IDDIRR(res$Meta,res$AllIndStudies) -length(res$Meta) +#length(res$Meta) Hs.Meta=rownames(esets[[1]])[res$Meta] origId.Meta=lapply(conv_unigene,FUN=function(vec) as.vector(unlist(vec[Hs.Meta]))) @@ -182,12 +183,6 @@ vennFilename="venn.png" vennFile=file.path(result.path,vennFilename) -htmlfile=readChar(result.template, file.info(result.template)$size) -htmlfile=gsub(x=htmlfile,pattern = "###DATAJSON###",replacement = datajson, fixed = TRUE) -htmlfile=gsub(x=htmlfile,pattern = "###SUMMARYJSON###",replacement = summaryjson, fixed = TRUE) -htmlfile=gsub(x=htmlfile,pattern = "###VENN###",replacement = vennFilename, fixed = TRUE) -write(htmlfile,result.html) - library(VennDiagram) flog.threshold(ERROR) @@ -212,8 +207,28 @@ l[[paste("study",i,sep="")]]<-res[[i]] } l[["Meta"]]=res[[length(res)-1]] -showVenn(l,vennFile) + +if (length(l)<5) { + title="Venn diagram" + width=500 + showVenn(l,vennFile) +} else { + title="Upsetr diagram" + width=1000 + png(vennFile,width=width,height=500) + upset(fromList(as.list(l)), order.by = "freq") + dev.off() +} + file.copy(vennFilename,result.path) + +htmlfile=readChar(result.template, file.info(result.template)$size) +htmlfile=gsub(x=htmlfile,pattern = "###DATAJSON###",replacement = datajson, fixed = TRUE) +htmlfile=gsub(x=htmlfile,pattern = "###SUMMARYJSON###",replacement = summaryjson, fixed = TRUE) +htmlfile=gsub(x=htmlfile,pattern = "###VENN###",replacement = vennFilename, fixed = TRUE) +tmlfile=gsub(x=htmlfile,pattern = "###WIDTH###",replacement = as.character(width), fixed = TRUE) +htmlfile=gsub(x=htmlfile,pattern = "###TITLE###",replacement = title, fixed = TRUE) +write(htmlfile,result.html) #l=list() #for(i in 1:length(esets)) #{ @@ -224,4 +239,4 @@ #writeLines(c("

Venn diagram

"),file.conn) #writeLines(c("

"),file.conn) #writeLines(c(""),file.conn) -#close(file.conn) \ No newline at end of file +#close(file.conn) diff -r a99bbda3cf1f -r 22e1325aaa88 MetaMA.xml --- a/MetaMA.xml Thu Jun 21 11:20:56 2018 -0400 +++ b/MetaMA.xml Fri Jun 22 04:30:31 2018 -0400 @@ -10,6 +10,7 @@ r-venndiagram r-metama r-optparse + r-upsetr @@ -57,7 +58,7 @@ **Results** -- Venn Diagram summarizing the results of the meta-analysis +- Venn Diagram or upsetR diagram (when the number of studies is greater than 2) summarizing the results of the meta-analysis - A list of indicators to evaluate the quality of the performance of the meta-analysis - DE : Number of differentially expressed genes diff -r a99bbda3cf1f -r 22e1325aaa88 MetaMa_tpl.html --- a/MetaMa_tpl.html Thu Jun 21 11:20:56 2018 -0400 +++ b/MetaMa_tpl.html Fri Jun 22 04:30:31 2018 -0400 @@ -167,8 +167,8 @@
-

Venn diagram

-
+

###TITLE###

+
diff -r a99bbda3cf1f -r 22e1325aaa88 MetaRNAseq.xml --- a/MetaRNAseq.xml Thu Jun 21 11:20:56 2018 -0400 +++ b/MetaRNAseq.xml Fri Jun 22 04:30:31 2018 -0400 @@ -64,7 +64,29 @@ - +