changeset 29:102e4ef8fed2 draft

planemo upload for repository https://github.com/sblanck/smagexp/tree/master/smagexp_tools commit 808ffb34e11a74cd2396e32868ea56f7ce8d83ff
author sblanck
date Thu, 21 Jun 2018 07:57:16 -0400
parents 49ce6fbe11de
children 4048dae6ace8
files MetaRNASeq.R MetaRNASeq_tpl.html MetaRNAseq.xml
diffstat 3 files changed, 24 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/MetaRNASeq.R	Thu Jun 21 04:28:19 2018 -0400
+++ b/MetaRNASeq.R	Thu Jun 21 07:57:16 2018 -0400
@@ -10,6 +10,7 @@
 ##### Read options
 option_list=list(
 		make_option("--input",type="character",default="NULL",help="list of rdata objects containing eset objects"),
+		make_option("--fdr",type="character",default=NULL,help="Adjusted p-value threshold to be declared differentially expressed"),
 		make_option("--result",type="character",default=NULL,help="text file containing result of the meta-analysis"),
 		make_option("--htmloutput",type="character",default=NULL,help="Output html report"),
 		make_option("--htmloutputpath",type="character",default="NULL",help="Path of output html report"),
@@ -35,20 +36,23 @@
 
 listfiles=vector()
 listfilenames=vector()
+nbreplicates=vector()
 
 for (i in 1:length(listInput))
 {
 	inputFileInfo <- unlist( strsplit( listInput[i], ';' ) )
 	listfiles=c(listfiles,inputFileInfo[1])
 	listfilenames=c(listfilenames,inputFileInfo[2])
+	nbreplicates[i]=inputFileInfo[3]
 }
 
+
 outputfile <- opt$result
 result.html = opt$htmloutput
 html.files.path=opt$htmloutputpath
 result.template=opt$htmltemplate
 
-alpha=0.05
+alpha=opt$fdr
 
 #print(comparison)
 
@@ -160,7 +164,7 @@
 #nrep=c(length(listFiles))
 
 
-invnormcomb<-invnorm(rawpval, nrep=c(8,8), BHth=alpha)
+invnormcomb<-invnorm(rawpval, nrep=nbreplicates, BHth=alpha)
 #DE[["fishercomb"]]<-ifelse(fishcomb$adjpval<=alpha,1,0)
 #DE[["invnormcomb"]]<-ifelse(invnormcomb$adjpval<=alpha,1,0)
 
@@ -229,7 +233,7 @@
 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)
+htmlfile=gsub(x=htmlfile,pattern = "###TITLE##",replacement = title, fixed = TRUE)
 write(htmlfile,result.html)
 
 #library(VennDiagram)
--- a/MetaRNASeq_tpl.html	Thu Jun 21 04:28:19 2018 -0400
+++ b/MetaRNASeq_tpl.html	Thu Jun 21 07:57:16 2018 -0400
@@ -139,8 +139,8 @@
 <body>
 
 <table><tr><td>
-<h2>###TITLE##</h2>
-<img src='###VENN###'  height="500" width=###WIDTH##><br/>
+<h2>###TITLE###</h2>
+<img src='###VENN###'  height="500" width=###WIDTH###><br/>
 </td><td>
 
 </td></tr></table>
--- a/MetaRNAseq.xml	Thu Jun 21 04:28:19 2018 -0400
+++ b/MetaRNAseq.xml	Thu Jun 21 07:57:16 2018 -0400
@@ -20,21 +20,31 @@
 
     <command>
 
-    <![CDATA[ 	
+<![CDATA[   
         Rscript 
         ${__tool_directory__}/MetaRNASeq.R 
-            --input "#for $input in $inputs# $input;$input.name, #end for#"
+            --input "#for $s in $studies: 
+                        ${s.input};${s.input.name};${s.nbreplicates}, 
+                    #end for
+"
+            --fdr $fdr
             --result $top_table
             --htmloutput $result_html 
             --htmloutputpath $result_html.extra_files_path
-            --htmltemplate ${__tool_directory__}/MetaRNASeq_tpl.html	
-    ]]>	
+            --htmltemplate ${__tool_directory__}/MetaRNASeq_tpl.html    
+    ]]>
+
     </command>
 
     <inputs>
-        <param format="tabular" name="inputs" multiple="true" type="data" optional="false" label="Counts file" help="Must have the same number of row in each study. The experimental conditions must be specified in the header of each file"/>
+         <repeat name="studies" title="Study results" min="2" default="2" help="DESeq2 Result file and number of replicate of the study">
+             <param format="tabular" name="input" multiple="false" type="data" optional="false" label="DESeq2 result file" help="Must have the same number of row in each study"/>
+             <param name="nbreplicates" type="integer" value="10"  label="Number of replicates" help="Number of replicates of the study"/>
+         </repeat>
+         <param name="fdr" type="float" value="0.05" label="FDR" min="0" max="1" help="adjusted p-value threshold to be declared differentially expressed"/>
     </inputs>
 
+
     <outputs>
         <data format="tabular" name="top_table" label="Summary of meta-analysis and single studie analysis from ${tool.name} on ${on_string}"/>
         <data format="html" name="result_html" label="Charts for ${tool.name} on ${on_string}"/>