diff deseq2.xml @ 22:aad8927093ac draft

Uploaded
author bgruening
date Sat, 15 Nov 2014 05:42:24 -0500
parents d32de046ba31
children f8a59b35c397
line wrap: on
line diff
--- a/deseq2.xml	Wed Feb 19 12:43:03 2014 -0500
+++ b/deseq2.xml	Sat Nov 15 05:42:24 2014 -0500
@@ -1,12 +1,11 @@
-<tool id="deseq2" name="DESeq2" version="2.0.1">
-    <description>Determines differentially expressed features from count data</description>
+<tool id="iuc_deseq2" name="DESeq2" version="2.1.6.0">
+    <description>Determines differentially expressed features from count tables</description>
     <requirements>
         <requirement type="binary">Rscript</requirement>
         <requirement type="R-module">DESeq2</requirement>
-        <requirement type="package" version="3.0.2">R_3_0_2</requirement>
-        <requirement type="package" version="1.2.10">deseq2</requirement>
-        <!--<requirement type="set_environment">DESEQ2_SCRIPT_PATH</requirement>-->
+        <requirement type="package" version="1.6.1">deseq2</requirement>
     </requirements>
+    <code file="helper.py" />
     <command interpreter="Rscript">
         #import json
         deseq2.R
@@ -16,99 +15,79 @@
             #if $pdf:
                 -p "$plots" 
             #end if
-
-            -i "$input_matrix"
-
-            #set $temp_factor_name = list()
+            
+            #set $temp_factor_names = list()
             #for $factor in $rep_factorName:
-                #set $temp_factor = dict()
+
+                #set $temp_factor = list()
                 #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(','))})
+                    #set $count_files = list()
+                    #for $file in $level.rep_countsFile:
+                        $count_files.append(str($file.countsFile))
+                    #end for
+                    $temp_factor.append( {str($level.factorLevel): $count_files} )
                 #end for
-                $temp_factor_name.append([str($factor.factorName), $temp_factor])
+                $temp_factor_names.append([str($factor.factorName), $temp_factor])
 
             #end for
 
-                ##-m "#echo ' '.join( $temp_factor_list )#"
-                -m '#echo json.dumps(temp_factor_name)#'
-            ##--organism "$organism"
-            ##-t "$fittype"
-            -c $countthreshold
+            -m '#echo json.dumps(temp_factor_names)#'
+            #if str($filtermode.mode) == "absolute":
+                -c $filtermode.count_abs
+            #elif str($filtermode.mode) == "quantile":
+                -c $filtermode.count_quant
+            #end if
+            --filtermode $filtermode.mode
     </command>
     <stdio>
-        <regex match="Execution halted" 
-           source="both" 
-           level="fatal" 
-           description="Execution halted." />
-        <regex match="Input-Error 01" 
-           source="both" 
-           level="fatal" 
-           description="Error in your input parameters: Make sure you only apply factors to selected samples." />
-        <regex match="Error in" 
-           source="both" 
-           level="fatal" 
-           description="An undefined error occured, please check your intput carefully and contact your administrator." />
+        <exit_code range="1:" />
+        <exit_code range=":-1" />
+        <regex match="Error:" />
+        <regex match="Exception:" />
     </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'"/>
-
-        <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="" />
-
-                <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." />
+        <repeat name="rep_factorName" title="Factor" min="1">
+            <param name="factorName" type="text" value="FactorName" label="Specify a factor name" 
+                help="Only letters, numbers and underscores will be retained in this field">
+                <sanitizer>
+                    <valid initial="string.letters,string.digits"><add value="_" /></valid>
+                </sanitizer>
+            </param>
+            <repeat name="rep_factorLevel" title="Factor level" min="2" max="2" default="2">
+                <param name="factorLevel" type="text" value="FactorLevel" label="Specify a factor level"
+                    help="Only letters, numbers and underscores will be retained in this field">
+                    <sanitizer>
+                        <valid initial="string.letters,string.digits"><add value="_" /></valid>
+                    </sanitizer>
                 </param>
+                <repeat name="rep_countsFile" title="Biological replicate" min="1">
+                    <param name="countsFile" type="data" label="Counts file"/>
+                </repeat>
             </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."/>
+        <conditional name="filtermode">
+            <param name="mode" type="select" label="Filter out features with following criteria">
+                <option value="absolute">Filter based on absolute normalized mean counts</option>
+                <option value="quantile">Filter based on quantiles</option>
             </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.0" 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"
+            <when value="absolute">
+                <param name="count_abs" size="10" type="float" value="10.0" label="Filter out features with mean normalized counts lower than this value"/>
+            </when>
+            <when value="quantile">
+                <param name="count_quant" size="10" type="float" value="10.0" min="0" max="100" label="Filter out features with mean normalized counts lower than this % of values" />
+            </when>
+        </conditional>
+        <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="tabular" name="deseq_out_filtered" label="Independent filtering result file on ${on_string}" />
+        <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="deseq_helper.py" />
 
     <help>
 
@@ -121,9 +100,25 @@
 
 **Inputs**
 
-DESeq2_ requires one count matrix as input file. You can use the tool
+DESeq2_ takes count tables that generated from the htseq-count as input. Count tables must be generated for each sample individually. DESeq2 is capable of handling multiple factors that effect your experiment. The first factor you input is considered as the primary factor that affects gene expressions. You also input several secondary factors that might influence your experiment. But the final output will be changes in genes due to primary factor in presence of secondary factors. Each factor has two levels/states. You need to select appropriate count table from your history for each factor level.
+
+The following table gives some examples of factors and their levels:
 
+========= ============== ===============
+Factor    Factor level 1 Factor level 2 
+--------- -------------- ---------------
+Treatment Treated        Untreated
+--------- -------------- ---------------
+Condition Knockdown      Wildtype
+--------- -------------- ---------------
+TimePoint Day4           Day1
+--------- -------------- ---------------
+SeqType   SingleEnd      PairedEnd
+--------- -------------- ---------------
+Gender    Female         Male
+========= ============== ===============
 
+*Note*: Output log2 fold changes are based on primary factor level 1 vs. factor level2. Here the order of factor levels is important. For example, for the factor 'Treatment' given in above table, DESeq2 computes fold changes of 'Treated' samples against 'Untreated', i.e. the values correspond to up or down regulations of genes in Treated samples.
 
 **Output**
 
@@ -134,7 +129,7 @@
 ------ ----------------------------------------------------------
      1 Gene Identifiers
      2 mean normalised counts, averaged over all samples from both conditions
-     3 the logarithm (to basis 2) of the fold change
+     3 the logarithm (to basis 2) of the fold change (See the note in inputs section)
      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
@@ -142,22 +137,10 @@
 ====== ==========================================================
 
 
-------
-
-**References** 
-
-DESeq2_ Authors: Michael Love (MPIMG Berlin), Simon Anders, Wolfgang Huber (EMBL Heidelberg)
-
-If DESeq2_ is used to obtain results for scientific publications it
-should be cited as [1]_. A paper describing DESeq2_ is in preparation.
-
-
-
-.. [1] Anders, S and Huber, W (2010): `Differential expression analysis for sequence count data`_. 
-
-.. _Differential expression analysis for sequence count data: http://dx.doi.org/10.1186/gb-2010-11-10-r106
 .. _DESeq2: http://master.bioconductor.org/packages/release/bioc/html/DESeq2.html
 
-
     </help>
+    <citations>
+        <citation type="doi">10.1101/002832</citation>
+    </citations>
 </tool>