changeset 9:328f4031e5d3 draft

planemo upload commit f882a5ba78afeb368605beb3986936e86c485cbb-dirty
author sblanck
date Wed, 10 May 2017 08:12:48 -0400
parents 7f74250a083d
children 56267e3293b2
files AffyQCnormalization.xml Analyse.xml GEOQuery.xml ImportDataFromMatrix.xml MetaMA.R MetaMA.xml MetaRNAseq.xml repository_dependencies.xml
diffstat 8 files changed, 249 insertions(+), 235 deletions(-) [+]
line wrap: on
line diff
--- a/AffyQCnormalization.xml	Wed May 10 04:12:26 2017 -0400
+++ b/AffyQCnormalization.xml	Wed May 10 08:12:48 2017 -0400
@@ -1,51 +1,45 @@
 <tool id="QCnormalization" name="QCnormalization" version="0.1.0">
-	<description>Quality control and normalization of affymetrix expression data</description>
-	<stdio>
-        <exit_code range="1:" />
-        
-		<regex match="Warning"
-           source="both"
-           level="warning"
-		/>
-     </stdio>
+
+    <description>Quality control and normalization of affymetrix expression data</description>
+
     <requirements>
-	  <!--container type="docker">sblanck/smat</container-->
-	  <requirement type="package" version="0.1.0">r-smagexp</requirement>
-	</requirements>
-	<command>
-		<![CDATA[
-		Rscript 
-		${__tool_directory__}/AffyQCnormalization.R
-	    	--input "#for $input in $inputs# $input;$input.name, #end for#"
+        <requirement type="package" version="0.1.0">r-smagexp</requirement>
+    </requirements>
+
+    <stdio>
+        <exit_code range="1:" />
+        <regex match="Warning" source="both" level="warning"/>
+    </stdio>
+
+    <command>
+        <![CDATA[
+        Rscript 
+        ${__tool_directory__}/AffyQCnormalization.R
+            --input "#for $input in $inputs# $input;$input.name, #end for#"
             --normalization ${normalization}
-			--rdataoutput $result_export_eset
-       		--htmloutput $result_html
-			--htmloutputpath $result_html.files_path
-		    --htmltemplate ${__tool_directory__}/AffyQCnormalization_tpl.html
-		]]>
-		</command>
-	
-		<inputs>
-	
-		<param name="inputs" type="data" format="cel" multiple="true" label=".CEL files" help=".CEL files to be used"/>
+            --rdataoutput $result_export_eset
+            --htmloutput $result_html
+            --htmloutputpath $result_html.files_path
+            --htmltemplate ${__tool_directory__}/AffyQCnormalization_tpl.html
+        ]]>
+     </command>
 
-		<param name="normalization" type="select" label="Preprocessing/normalization">
-		
-    		<option value="rma">rma (backgroung correction + quantile normalization + log2)</option>
+    <inputs>
+        <param name="inputs" type="data" format="cel" multiple="true" label=".CEL files" help=".CEL files to be used"/>
+        <param name="normalization" type="select" label="Preprocessing/normalization">
+            <option value="rma">rma (backgroung correction + quantile normalization + log2)</option>
             <option value="quantile">quantile normalization + log2</option>
             <option value="background">background correction + log2</option>
             <option value="log2">log2 only</option>
-           
-		
-		</param>
-		
-	</inputs>
-	<outputs>
-		<data format="rdata" name="result_export_eset" label="export normalized expressionSet"/>		
-		<data format="html" name="result_html" label="QC result"/>
-	</outputs>
+        </param>
+    </inputs>
 
-	<help>
+    <outputs>
+        <data format="rdata" name="result_export_eset" label="export normalized expressionSet"/>		
+        <data format="html" name="result_html" label="QC result"/>
+    </outputs>
+
+    <help>
 <![CDATA[
 		**What it does** 
 		    	
@@ -62,6 +56,6 @@
 - Rdata object containing the normalized data for further analysis
   		
 ]]>
-</help>
+    </help>
 
 </tool>
--- a/Analyse.xml	Wed May 10 04:12:26 2017 -0400
+++ b/Analyse.xml	Wed May 10 08:12:48 2017 -0400
@@ -1,69 +1,60 @@
 <tool id="LimmaAnalyse" name="Limma analysis" version="0.3.0">
-	<description>Perform gene expression analysis thanks to limma</description>
-	<stdio>
+
+    <description>Perform gene expression analysis thanks to limma</description>
+
+    <requirements>
+        <requirement type="package" version="0.1.0">r-smagexp</requirement>
+    </requirements>
+
+    <stdio>
         <exit_code range="1:" />
+        <regex match="Warning" source="both" level="warning"/>
     </stdio>
-	<requirements>
-	  	<!--container type="docker">sblanck/smagexp</container-->
-                <requirement type="package" version="0.1.0">r-smagexp</requirement>
-	</requirements>
-	<command>
-		<![CDATA[ 
-		Rscript
-		${__tool_directory__}/Analyse.R
-		   	--rdatainput ${rdataset}
-			--conditions ${conditions}
-		 	--selectcondition1 "${selectCondition1}"
-		    --selectcondition2 "${selectCondition2}"
-			--nbresult ${nbresult}
-       		--rdataoutput ${result_export_eset}
-       		--htmloutput $result_html 
-			--htmloutputpath $result_html.files_path
-			--tabularoutput $result_tabular
-			--htmltemplate ${__tool_directory__}/Analyse_tpl.html
-		]]>
-	</command>
-	
-	<inputs>
-		<param name="rdataset" type="data" format="rdata" label="RData" help="RData to be used"/>
-		<param name="conditions" type="data" format="cond" label="Conditions" help="conditions associated with the rData file"/>
-		<param name="selectCondition1" type="select" label="condition 1">
-			<options from_dataset="conditions">
-    		<column name="name" index="1"/>
-    		<column name="value" index="1"/>
-    		<filter type="unique_value" column="1"/>
-		</options>
-		</param>
-		<!--param name="condition1" type="select" display="checkboxes" label="Condition 1" multiple="true">
-			<options from_dataset="conditions">
-    		<column name="name" index="2"/>
-    		<column name="value" index="0"/>
-			<filter  type="param_value" ref="selectCondition1" column="1"/>
-		</options>
-		</param-->	
-		<param name="selectCondition2" type="select" label="condition 2">
-			<options from_dataset="conditions">
-    		<column name="name" index="1"/>
-    		<column name="value" index="1"/>
-			<filter type="unique_value" column="1"/>    		
-		</options>
-		</param>	
-		<!--param name="condition2" type="select" display="checkboxes" label="Condition 2" multiple="true">
-			<options from_dataset="conditions">
-    		<column name="name" index="2"/>
-    		<column name="value" index="0"/>
-			<filter  type="param_value" ref="selectCondition2" column="1"/>
-		</options>
-		</param-->	
-		<param name="nbresult" type="integer" value="1000" min="1" label="number of top genes" help="Number of genes to be displayed in result datatable"/>
-	</inputs>
-	<outputs>
-		<data format="html" name="result_html" label="Results of analysis of ${rdataset.name}"/>
-		<data format="rdata" name="result_export_eset" label="Export of expression set of ${rdataset.name}"/>
-		<data format="tabular" name="result_tabular" label="Text Results of analysis of ${rdataset.name}"/>
-		
-	</outputs>
-	<help>
+
+    <command>
+        <![CDATA[ 
+        Rscript
+        ${__tool_directory__}/Analyse.R
+            --rdatainput ${rdataset}
+            --conditions ${conditions}
+            --selectcondition1 "${selectCondition1}"
+            --selectcondition2 "${selectCondition2}"
+            --nbresult ${nbresult}
+            --rdataoutput ${result_export_eset}
+            --htmloutput $result_html 
+            --htmloutputpath $result_html.files_path
+            --tabularoutput $result_tabular
+            --htmltemplate ${__tool_directory__}/Analyse_tpl.html
+        ]]>
+    </command>
+
+    <inputs>
+        <param name="rdataset" type="data" format="rdata" label="RData" help="RData to be used"/>
+        <param name="conditions" type="data" format="cond" label="Conditions" help="conditions associated with the rData file"/>
+        <param name="selectCondition1" type="select" label="condition 1">
+            <options from_dataset="conditions">
+                <column name="name" index="1"/>
+                <column name="value" index="1"/>
+                <filter type="unique_value" column="1"/>
+            </options>
+        </param>
+        <param name="selectCondition2" type="select" label="condition 2">
+            <options from_dataset="conditions">
+                <column name="name" index="1"/>
+                <column name="value" index="1"/>
+                <filter type="unique_value" column="1"/>
+            </options>
+        </param>	
+        <param name="nbresult" type="integer" value="1000" min="1" label="number of top genes" help="Number of genes to be displayed in result datatable"/>
+    </inputs>
+
+    <outputs>
+        <data format="html" name="result_html" label="Results of analysis of ${rdataset.name}"/>
+        <data format="rdata" name="result_export_eset" label="Export of expression set of ${rdataset.name}"/>
+        <data format="tabular" name="result_tabular" label="Text Results of analysis of ${rdataset.name}"/>
+    </outputs>
+
+    <help>
 <![CDATA[ 
 **What it does**
 		
@@ -89,6 +80,6 @@
 - Table summarizing the differentially expressed genes and their annotations. This table is sortable and requestable.
 - Rdata object to perform further meta-analysis. 
 ]]>
-	</help>
+    </help>
 
 </tool>
--- a/GEOQuery.xml	Wed May 10 04:12:26 2017 -0400
+++ b/GEOQuery.xml	Wed May 10 08:12:48 2017 -0400
@@ -1,41 +1,45 @@
-<tool id="GEOQuery" name="GEOQuery">
-	<description>GEOQuery wrapper</description>
-	<stdio>
+<tool id="GEOQuery" name="GEOQuery" version="0.1.0">
+
+    <description>GEOQuery wrapper</description>
+
+    <requirements>
+        <requirement type="package" version="0.1.0">r-smagexp</requirement>
+    </requirements>
+
+    <stdio>
         <exit_code range="1:" />
+        <regex match="Warning" source="both" level="warning"/>
     </stdio>
-	<!--requirements>
-	  	<!container type="docker">sblanck/smagexp</container>
-		<requirement type="package" version="0.1.0">r-smagexp</requirement>
-	</requirements-->
-	<command>
-		<![CDATA[ 
-			Rscript --vanilla
-			${__tool_directory__}/GEOQuery.R 
-			--id ${GEOQueryID} 
-			--transformation ${transformation}
-			--data ${GEOQueryData} 
-			--rdata ${GEOQueryRData} 
-			--conditions ${conditions}
-		]]>
-	</command>
 
-	<inputs>
-		<param name="GEOQueryID" type="text" size="12" optional="false" label="GEOQuery ID" help="">
-			<validator type="empty_field"/>
-		</param>
-	<param name="transformation" type="select" label="log2 transformation">
-			<option value="auto">auto</option>
+    <command>
+        <![CDATA[ 
+        Rscript --vanilla
+        ${__tool_directory__}/GEOQuery.R 
+            --id ${GEOQueryID} 
+            --transformation ${transformation}
+            --data ${GEOQueryData} 
+            --rdata ${GEOQueryRData} 
+            --conditions ${conditions}
+        ]]>
+    </command>
+
+    <inputs>
+        <param name="GEOQueryID" type="text" size="12" optional="false" label="GEOQuery ID" help="">
+            <validator type="empty_field"/>
+        </param>
+        <param name="transformation" type="select" label="log2 transformation">
+            <option value="auto">auto</option>
             <option value="yes">yes</option>
             <option value="no">no</option>
         </param>
-	</inputs>
+    </inputs>
 
-		<outputs>
-		<data format="tabular" name="GEOQueryData" label="GEOQuery Data of ${GEOQueryID}"/>
-		<data format="cond" name="conditions" label="conditions of ${GEOQueryID}"/>
-        <data format="rdata" name="GEOQueryRData" label="GEOQuery RData of ${GEOQueryID}"/>		
+    <outputs>
+        <data format="tabular" name="GEOQueryData" label="GEOQuery Data of ${GEOQueryID}"/>
+        <data format="cond" name="conditions" label="conditions of ${GEOQueryID}"/>
+        <data format="rdata" name="GEOQueryRData" label="GEOQuery RData of ${GEOQueryID}"/>
 	</outputs>
-	<help>
+    <help>
 <![CDATA[ 
 **What it does**     	
 
@@ -61,8 +65,6 @@
 - Condition (.cond) file summarizing conditions of the experiment
 - Tabular (.txt) file containing expression data for each sample
 ]]> 		
-
-	</help>
-
+    </help>
 
 </tool>
--- a/ImportDataFromMatrix.xml	Wed May 10 04:12:26 2017 -0400
+++ b/ImportDataFromMatrix.xml	Wed May 10 08:12:48 2017 -0400
@@ -1,42 +1,48 @@
-<tool id="importMatrixData" name="Import custom data">
-	<description>Quality control and normalization of a custom matrix expression data</description>
-	<requirements>
-	  	<!--container type="docker">sblanck/smagexp</container-->
-		<requirement type="package" version="0.1.0">r-smagexp</requirement>		
-	</requirements>
-	<command>
-		<![CDATA[ 
-		Rscript --vanilla 
-		${__tool_directory__}/ImportDataFromMatrix.R
-		    --input $input
-			--normalization $normalization
-			--conditions $conditions
-			--annotations $annotations
-			--rdataoutput $result_export_eset
-       		--htmloutput $result_html
-			--htmloutputpath $result_html.files_path
-			--htmltemplate ${__tool_directory__}/ImportDataFromMatrix_tpl.html
-		]]>		
-		</command>
-		
-	
-	<inputs>
-		<param name="input" type="data" format="tabular" label="Input data" help="Input data"/>
-		<param name="normalization" type="select" label="Preprocessing/normalization">
-    		<option value="quantile">quantile normalization + log2</option>
+<tool id="importMatrixData" name="Import custom data" version="0.1.0">
+
+    <description>Quality control and normalization of a custom matrix expression data</description>
+
+    <requirements>
+        <requirement type="package" version="0.1.0">r-smagexp</requirement>		
+    </requirements>
+
+    <stdio>
+        <exit_code range="1:" />
+        <regex match="Warning" source="both" level="warning"/>
+    </stdio>
+
+    <command>
+        <![CDATA[ 
+        Rscript --vanilla 
+        ${__tool_directory__}/ImportDataFromMatrix.R
+            --input $input
+            --normalization $normalization
+            --conditions $conditions
+            --annotations $annotations
+            --rdataoutput $result_export_eset
+            --htmloutput $result_html
+            --htmloutputpath $result_html.files_path
+            --htmltemplate ${__tool_directory__}/ImportDataFromMatrix_tpl.html
+        ]]>
+        </command>
+
+    <inputs>
+        <param name="input" type="data" format="tabular" label="Input data" help="Input data"/>
+        <param name="normalization" type="select" label="Preprocessing/normalization">
+            <option value="quantile">quantile normalization + log2</option>
             <option value="log2">log2 only</option>
             <option value="none">none</option>
-		</param>
-		<param name="conditions" type="data" format="cond" label="Conditions" help="conditions associated with the input file"/>
-		<param name="annotations" type="text" label="Annotation GPL code" help="GPL code for annotations"/>		
-	</inputs>
+        </param>
+        <param name="conditions" type="data" format="cond" label="Conditions" help="conditions associated with the input file"/>
+        <param name="annotations" type="text" label="Annotation GPL code" help="GPL code for annotations"/>		
+    </inputs>
 
-	<outputs>
-		<data format="rdata" name="result_export_eset" label="export normalized expressionSet"/>		
-		<data format="html" name="result_html" label="QC result"/>
-	</outputs>
+    <outputs>
+        <data format="rdata" name="result_export_eset" label="export normalized expressionSet"/>		
+        <data format="html" name="result_html" label="QC result"/>
+    </outputs>
 
-	<help>
+    <help>
 <![CDATA[ 
 **What it does**
 		     	
@@ -74,6 +80,6 @@
 	- Bboxplots and MA plots 
 	- Rdata object containing the data for further analysis.
 ]]>
-	</help>
+    </help>
 
 </tool>
--- a/MetaMA.R	Wed May 10 04:12:26 2017 -0400
+++ b/MetaMA.R	Wed May 10 08:12:48 2017 -0400
@@ -1,44 +1,54 @@
-library(metaMA)
-library(affy)
-library(annaffy)
-library(VennDiagram)
-library(GEOquery)
+#!/usr/bin/env Rscript
+# setup R error handling to go to stderr
+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
+
+# we need that to not crash galaxy with an UTF8 error on German LC settings.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+library("optparse")
+
+##### Read options
+option_list=list(
+		make_option("--input",type="character",default="NULL",help="list of rdata objects containing eset objects"),
+		make_option("--htmloutput",type="character",default=NULL,help="Output html report"),
+		make_option("--htmloutputpath",type="character",default="NULL",help="Path of output html report"),
+		make_option("--htmltemplate",type="character",default=NULL,help="html template)")
+);
 
-cargs<-commandArgs()
-cargs<-cargs[(which(cargs=="--args")+1):length(cargs)]
+opt_parser = OptionParser(option_list=option_list);
+opt = parse_args(opt_parser);
+
+if(is.null(opt$input)){
+	print_help(opt_parser)
+	stop("input required.", call.=FALSE)
+}
 
-nbargs=length(cargs)
+#loading libraries
+
+suppressPackageStartupMessages(require(metaMA))
+suppressPackageStartupMessages(require(affy))
+suppressPackageStartupMessages(require(annaffy))
+suppressPackageStartupMessages(require(VennDiagram))
+suppressPackageStartupMessages(require(GEOquery))
+
+listInput <- trimws( unlist( strsplit(trimws(opt$input), ",") ) )
+
 rdataList=list()
 condition1List=list()
 condition2List=list()
-
-for (i in 1:(nbargs-5))
+for (input in listInput)
 {
-	Rdata=cargs[[i]]	
-	#condition1=cargs[[i+1]]
-	#condition2=cargs[[i+2]]
-	load(Rdata)
+	load(input)
 	
 	rdataList=c(rdataList,(eset))
-	#condition1List=c(condition1List,condition1)
-	#condition2List=c(condition2List,condition2)
 	condition1List=c(condition1List,saveConditions[1])
 	condition2List=c(condition2List,saveConditions[2])
 	
 }
 
-#tables<-cargs[[1]]
-#tech<-cargs[[2]]
-result.html<-cargs[[nbargs-4]]
-result.path<-cargs[[nbargs-3]]
-#result.venn<-cargs[[nbargs-3]]
-result.template<-cargs[[nbargs-2]]
-
-#sink("/dev/null")
-#dir.create(temp.files.path,recursive=TRUE)
-#file.conn=file(diag.html,open="w")
-
-#writeLines(c("<html><body bgcolor='lightgray'>"),file.conn)
+result.html<-htmloutput
+result.path<-htmloutputpath
+result.template<-htmltemplate
 
 showVenn<-function(res,file)
 {
@@ -51,7 +61,6 @@
 	dev.off()
 }
 
-
 library("org.Hs.eg.db")
 x <- org.Hs.egUNIGENE
 mapped_genes <- mappedkeys(x)
@@ -107,8 +116,6 @@
 }
 
 
-
-
 filterCondition<-function(gset,condition1, condition2){
 	selected=c(which((tolower(as.character(pData(gset)["source_name_ch1"][,1]))==condition1)), 
 			which(tolower(as.character(pData(gset)["source_name_ch1"][,1]))==condition2))
--- a/MetaMA.xml	Wed May 10 04:12:26 2017 -0400
+++ b/MetaMA.xml	Wed May 10 08:12:48 2017 -0400
@@ -1,29 +1,36 @@
 <tool id="metaMA" name="Microarray data meta-analysis" version="0.1.0">
-	<description>Perform meta-analysis thanks to metaMA.</description>
-	<requirements>
-	  <!--container type="docker">sblanck/smat</container-->
-	  <requirement type="package" version="0.1.0">r-smagexp</requirement>
-	</requirements>
-	<command>
-		<![CDATA[ 
-		Rscript 
-		${__tool_directory__}/MetaMA.R
-		--input $input
-       	--htmloutput $result_html 
-		--htmloutputpath $result_html.extra_files_path
-		--htmltemplate ${__tool_directory__}/MetaMa_tpl.html
-		]]>
+
+    <description>Perform meta-analysis thanks to metaMA.</description>
+
+    <requirements>
+        <requirement type="package" version="0.1.0">r-smagexp</requirement>
+    </requirements>
+
+    <stdio>
+        <exit_code range="1:" />
+        <regex match="Warning" source="both" level="warning"/>
+    </stdio>
+
+    <command>
+        <![CDATA[ 
+        Rscript 
+        ${__tool_directory__}/MetaMA.R
+            --input $input
+            --htmloutput $result_html 
+            --htmloutputpath $result_html.extra_files_path
+            --htmltemplate ${__tool_directory__}/MetaMa_tpl.html
+        ]]>
 	</command>
-	
-	<inputs>
-		<param format="rdata" name="input" multiple="true" type="data" optional="false" label="rdata files" help="rdata files containing the results of the analysis to be used in the meta-analysis"/>
-	</inputs>
-		
-	<outputs>
-		<data format="html" name="result_html" label="Meta-analysis results"/>
-	</outputs>
+
+    <inputs>
+        <param format="rdata" name="input" multiple="true" type="data" optional="false" label="rdata files" help="rdata files containing the results of the analysis to be used in the meta-analysis"/>
+    </inputs>
 
-	<help>
+    <outputs>
+        <data format="html" name="result_html" label="Meta-analysis results"/>
+    </outputs>
+
+    <help>
 <![CDATA[ 
 **What it does**
 		
@@ -42,6 +49,6 @@
 		
 - Fully sortable and requestable table, with gene annotations and hypertext links to NCBI gene database.
 ]]>
-	</help>
+    </help>
 
 </tool>
--- a/MetaRNAseq.xml	Wed May 10 04:12:26 2017 -0400
+++ b/MetaRNAseq.xml	Wed May 10 08:12:48 2017 -0400
@@ -1,9 +1,16 @@
 <tool id="metarnaseq" name="RNA-seq data meta-analysis">
-	<description>perform meta-analysis thanks to metaRNAseq</description>
-	<!--requirements>
-	  <container type="docker">sblanck/smat</container>
-	  <requirement type="package" version="0.1.0">r-smagexp</requirement>
-	</requirements-->
+
+    <description>perform meta-analysis thanks to metaRNAseq</description>
+
+    <requirements>
+        <requirement type="package" version="0.1.0">r-smagexp</requirement>
+    </requirements>	
+
+    <stdio>
+        <exit_code range="1:" />
+        <regex match="Warning" source="both" level="warning"/>
+    </stdio>
+
 	<command interpreter="python">
 		<![CDATA[ 	
 		stderr_wrapper.py Rscript 
--- a/repository_dependencies.xml	Wed May 10 04:12:26 2017 -0400
+++ b/repository_dependencies.xml	Wed May 10 08:12:48 2017 -0400
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
 <repositories description="smagexp datatypes">
-  <repository changeset_revision="f66f8566fd75" name="smagexp_datatypes" owner="sblanck" toolshed="https://testtoolshed.g2.bx.psu.edu" />
+  <repository changeset_revision="ab9730c06075" name="smagexp_datatypes" owner="sblanck" toolshed="https://testtoolshed.g2.bx.psu.edu" />
 </repositories>