diff deseq2.xml @ 17:a05999fd6e26 draft

Uploaded
author bgruening
date Mon, 30 Sep 2013 10:51:41 -0400
parents 1d2a02bc2208
children 72613128bd65
line wrap: on
line diff
--- a/deseq2.xml	Mon Sep 09 07:09:38 2013 -0400
+++ b/deseq2.xml	Mon Sep 30 10:51:41 2013 -0400
@@ -1,5 +1,5 @@
 <tool id="deseq2" name="DESeq2" version="2.0.1">
-  <description>Determines differentially expressed transcripts from read alignments</description>
+    <description>Determines differentially expressed features from count data</description>
     <requirements>
         <requirement type="binary">Rscript</requirement>
         <requirement type="R-module">DESeq2</requirement>
@@ -7,33 +7,33 @@
         <requirement type="set_environment">DESEQ2_SCRIPT_PATH</requirement>
     </requirements>
     <command interpreter="Rscript">
+        #import simplejson
         deseq2.R
             -o "$deseq_out"
+            --outfilefiltered "$deseq_out_filtered"
 
             #if $pdf:
-                -p "$plots"
+                -p "$plots" 
             #end if
-
+            
             -i "$input_matrix"
 
-        #if $filter_sel.filter_sel_opts == 'all_vs_all':
-            -s 'all_vs_all'
-        #else:
-            -s ## build a string like '1,2 5,6'
-            "${filter_sel.control_cols} ${filter_sel.experiement_cols}"
+            #set $temp_factor_name = list()
+            #for $factor in $rep_factorName:
+                #set $temp_factor = dict()                
+                #for $level in $factor.rep_factorLevel:
+                    ##$temp_factor_list.append( '%s::%s:%s' % ($factor.factorName.replace(' ','_'), $level.factorLevel, $level.factorIndex) )
+                    $temp_factor.update({str($level.factorLevel): map(int, str($level.factorIndex).split(','))})
+                #end for
+                $temp_factor_name.append([str($factor.factorName), $temp_factor])
 
-            #set $temp_factor_list = list()
-            #set $is_multi_factor_analysis = False
-            #for $factor in $filter_sel.factor:
-                #set $is_multi_factor_analysis = True
-                $temp_factor_list.append( '%s:%s' % ($factor.factor_name.replace(' ','_'), $factor.factor_index) )
             #end for
 
-            #if $is_multi_factor_analysis:
-                -f "#echo ' '.join( $temp_factor_list )#"
-            #end if
-        #end if
-				-t $fittype
+                ##-m "#echo ' '.join( $temp_factor_list )#"
+                -m '#echo simplejson.dumps(temp_factor_name)#'
+            ##--organism "$organism"
+            ##-t "$fittype"
+            -c $countthreshold
     </command>
     <stdio>
         <regex match="Execution halted" 
@@ -51,56 +51,64 @@
     </stdio>
     <inputs>
         <param format="tabular" name="input_matrix" type="data" label="Countmatrix" help="You can create a count matrix with the tool 
-			'Count reads in features with htseq-count'"/>
+            'Count reads in features with htseq-count'"/>
+        
+        <repeat name="rep_factorName" title="Factor/Condition" min="1">
+            <param name="factorName" type="text" value="FactorName" label="Specify a factor name" help=""/>
+            <repeat name="rep_factorLevel" title="Factor level" min="1">
+                <param name="factorLevel" type="text" value="FactorLevel" label="Specify a factor level" help=""/>
 
-         <conditional name="filter_sel">
-            <param name="filter_sel_opts" type="select" label="Select mode of analysis" help="All against all: analyses all possible pairs of conditions,
-				&lt;br&gt; Specific: select your samples of interest">
-              <option value="all_vs_all">All against all</option>
-              <option value="specific">specific</option>
-            </param>
-            <when value="specific">
-
-                <param name="control_cols" label="Select columns containing first condition" type="data_column" data_ref="input_matrix"
-                    numerical="True" multiple="true" use_header_names="true" size="120" display="checkboxes">
-                    <validator type="no_options" message="Please select at least one column."/>
-                </param>
-
-                <param name="experiement_cols" label="Select columns containing second condition" type="data_column" data_ref="input_matrix"
+                <param name="factorIndex" label="Select columns that are associated with this factor level" type="data_column" data_ref="input_matrix"
                     numerical="True" multiple="true" use_header_names="true" size="120" display="checkboxes">
                     <validator type="no_options" message="Please select at least one column."/>
                 </param>
-
-                <repeat name="factor" title="Include factor">
-                    <param name="factor_name" type="text" value="Factor Name" label="Specify a factor name" help=""/>
-
-                    <param name="factor_index" label="Select columns that are associated with a factor." type="data_column" data_ref="input_matrix"
-                        numerical="True" multiple="true" use_header_names="true" size="120" display="checkboxes">
-                        <validator type="no_options" message="Please select at least one column."/>
-                    </param>
-                </repeat>
-
-            </when>
-            <when value="all_vs_all" />
-        </conditional>
-
+            </repeat>
+        </repeat>
+        <!--
+        <param name="control_cols" type="select" display="checkboxes" multiple="true" optional="True" label="Select columns containing first condition" 
+            dynamic_options="get_matrix_header( input_dataset=input_matrix )" help="insert useful info here">
+            <validator type="no_options" message="Please select at least one column."/>
+        </param>            
+        <param name="experiement_cols" type="select" display="checkboxes" multiple="true" optional="True" label="Select columns containing second condition" 
+            dynamic_options="get_matrix_header( input_dataset=input_matrix )" help="insert useful info here">
+            <validator type="no_options" message="Please select at least one column."/>
+        </param>             
+                 
+        <repeat name="factor" title="factor">
+            <param name="factor_name" type="text" value="Factor Name" label="Specify a factor name" 
+                help="Order of factors you add effects the design formual and hence effects whole analysis. Design formual will be created as follows: ~factor1+factor2+factor3+...+factorN+condition"/>
+            <param name="factor_index" type="select" display="checkboxes" multiple="true" optional="True" label="Choose sample to compare with" 
+                    dynamic_options="get_matrix_header( input_dataset=input_matrix )" help="Select columns that are associated with a factor">
+                <validator type="no_options" message="Please select at least one column."/>
+            </param>
+        </repeat>
+        -->
+        <!--param name="organism" size="10" type="select">
+            <option value="human">human</option>
+            <option value="mouse">mouse</option>
+            <option value="fly">fly</option>
+            <option value="other">other</option>
+        </param-->
+        <param name="countthreshold" size="10" type="float" value="10" label="Filter out features with mean normalized counts lower than this value"/>
         <param name="fittype" type="select" label="Type of fitting of dispersions to the mean intensity">
-			<option value="parametric">parametric</option>
-			<option value="local">local</option>
-			<option value="mean">mean</option>
-		</param>	
-		<param name="pdf" type="boolean" truevalue="" falsevalue="" checked="true" label="Visualising the analysis results"
-            help="output an additional PDF file" />
+            <option value="parametric">parametric</option>
+            <option value="local">local</option>
+            <option value="mean">mean</option>
+        </param> 
+        <param name="pdf" type="boolean" truevalue="" falsevalue="" checked="true" label="Visualising the analysis results"
+            help="output an additional PDF files" />            
     </inputs>
 
-  <outputs>
-    <data format="tabular" name="deseq_out" label="DESeq2 result file on ${on_string}"/>
-    <data format="pdf" name="plots" label="DESeq2 plots on ${on_string}">
-        <filter>pdf == True</filter>
-    </data>
-  </outputs>
+    <outputs>
+        <data format="tabular" name="deseq_out" label="DESeq2 result file on ${on_string}"/>
+        <data format="tabular" name="deseq_out_filtered" label="Independent filtering result file on ${on_string}"/>
+        <data format="pdf" name="plots" label="DESeq2 plots on ${on_string}">
+            <filter>pdf == True</filter>
+        </data>
+    </outputs>
+    <code file="matrix_helper.py" />
 
-  <help>
+    <help>
 
 .. class:: infomark
 
@@ -122,13 +130,12 @@
 ====== ==========================================================
 Column Description
 ------ ----------------------------------------------------------
-     1 Condition tested (corresponds to the conitions from the first line of your count matrix)
-     2 Gene Identifiers
-     3 mean normalised counts, averaged over all samples from both conditions
-     4 the logarithm (to basis 2) of the fold change
-     5 standard error estimate for the log2 fold change estimate
-     6 p value for the statistical significance of this change
-     7 p value adjusted for multiple testing with the Benjamini-Hochberg procedure
+     1 Gene Identifiers
+     2 mean normalised counts, averaged over all samples from both conditions
+     3 the logarithm (to basis 2) of the fold change
+     4 standard error estimate for the log2 fold change estimate
+     5 p value for the statistical significance of this change
+     6 p value adjusted for multiple testing with the Benjamini-Hochberg procedure
        which controls false discovery rate (FDR)
 ====== ==========================================================
 
@@ -150,5 +157,5 @@
 .. _DESeq2: http://master.bioconductor.org/packages/release/bioc/html/DESeq2.html
 
 
-  </help>
+    </help>
 </tool>