view dexseq.xml @ 25:abf8b6260cae draft default tip

Uploaded
author pavanvidem
date Wed, 23 Sep 2015 09:31:36 -0400
parents f5cc1f2a6e96
children
line wrap: on
line source

<tool id="dexseq" name="DEXSeq" version="1.0">
    <description>Determines differential exon usage from count tables</description>
    <requirements>
        <requirement type="package" version="3.2.0">R</requirement>
        <requirement type="package" version="1.12.14">cairo</requirement>
        <requirement type="package" version="4.0.3">tiff</requirement>
        <requirement type="package" version="1.14.2">dexseq</requirement>
    </requirements>
    <code file="dexseq_helper.py" />
    <command>
    mkdir ./html_out ;
        #import json
        Rscript $__tool_directory__/dexseq.R
            -o "$dexseq_out"
            -p 6
            #set $temp_factor_names = list()
            #for $factor in $rep_factorName:
                #set $temp_factor = list()
                #for $level in $factor.rep_factorLevel:
                    #set $count_files = list()
                    #for $file in $level.countsFile:
                        $count_files.append(str($file))
                    #end for
                    $temp_factor.append( {str($level.factorLevel): $count_files} )
                #end for
                $temp_factor_names.append([str($factor.factorName), $temp_factor])
            #end for
            -f '#echo json.dumps(temp_factor_names)#'
            -a $gtf
            #if $report:
                -r ./html_out
            #end if
            -c $fdr_cutoff;
        mkdir $htmlreport.extra_files_path;
        cp ./html_out/testForDEU.html $htmlreport ;
        cp -r ./html_out/* $htmlreport.extra_files_path ;
    </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." />
    </stdio>
    <inputs>
        <param name="gtf" type="data" label="GTF file created from DEXSeq-Count tool"/>
        <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>
                <param name="countsFile" type="data" multiple="true" label="Counts file"/>
            </repeat>
        </repeat>
        <param name="report" type="boolean" truevalue="" falsevalue="" checked="true"
            label="Visualise the analysis results?"
            help="output an additional html file" />
        <param name="fdr_cutoff" type="float" min="0" max="1" value="0.05" label="All the genes under this FDR threshold will be shown in the html report."/>
    </inputs>

    <outputs>
        <data format="tabular" name="dexseq_out" label="DEXSeq result file on ${on_string}"/>
        <data format="html" name="htmlreport" label="DEXSeq report on ${on_string}">
            <filter>report == True</filter>
        </data>
    </outputs>
    
    <code file="dexseq_helper.py" />
    <tests>
        <test>
            <param name="gtf" value="dexseq.gtf" ftype="bed"/>
            <repeat name="rep_factorName">
                <param name="factorName" value="condition" ftype="bed"/>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="knockdown"/>
                    <param name="countsFile" ftype="tabular" value="treated1fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="knockdown"/>
                    <param name="countsFile" ftype="tabular" value="treated2fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="knockdown"/>
                    <param name="countsFile" ftype="tabular" value="treated3fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="control"/>
                    <param name="countsFile" ftype="tabular" value="untreated1fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="control"/>
                    <param name="countsFile" ftype="tabular" value="untreated2fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="control"/>
                    <param name="countsFile" ftype="tabular" value="untreated2fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="control"/>
                    <param name="countsFile" ftype="tabular" value="untreated3fb.txt"/>
                </repeat>
            </repeat>
            <repeat name="rep_factorName">
                <param name="factorName" value="libtype" ftype="bed"/>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="singleend"/>
                    <param name="countsFile" ftype="tabular" value="treated1fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="singleend"/>
                    <param name="countsFile" ftype="tabular" value="untreated1fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="singleend"/>
                    <param name="countsFile" ftype="tabular" value="untreated2fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="pairedend"/>
                    <param name="countsFile" ftype="tabular" value="treated2fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="pairedend"/>
                    <param name="countsFile" ftype="tabular" value="treated3fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="pairedend"/>
                    <param name="countsFile" ftype="tabular" value="untreated3fb.txt"/>
                </repeat>
                <repeat name="rep_factorLevel">
                    <param name="factorLevel" type="text" value="pairedend"/>
                    <param name="countsFile" ftype="tabular" value="untreated4fb.txt"/>
                </repeat>
            </repeat>
            <param name="report" type="boolean" value="False"/>
            <param name="fdr_cutoff" value="0.05"/>
            <output name="dexseq_out" file="dexseq_result.tabular" ftype="tabular"/>
        </test>
    </tests>
    <help>

.. class:: infomark

**What it does** 

Estimate variance-mean dependence in count data from high-throughput sequencing assays and test for differential expression based on a model using the negative binomial distribution


**Inputs**

DEXSeq_ takes count tables that generated from the dexseq_count as input. Count tables must be generated for each sample individually. DEXSeq 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. Primary factor should always be named as 'condition'. 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 
--------- -------------- ---------------
condition Knockdown      Wildtype
--------- -------------- ---------------
treatment Treated        Untreated
--------- -------------- ---------------
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 'condition' given in above table, DEXSeq computes fold changes of 'Knockdown' samples against 'Wildtype', i.e. the values correspond to up or down regulations of genes in Knockdown samples.

**Output**

DEXSeq_ generates a tabular file containing the different columns and an optional html report.

====== ==========================================================
Column Description
------ ----------------------------------------------------------
     1 Gene and exon Identifiers
     2 group/gene identifier
     3 feature/exon identifier
     4 mean of the counts across samples in each feature/exon
     5 exon dispersion estimate
     6 LRT statistic
     7 LRT p-value
     8 BH adjusted p-values
     9 exon usage coefficient factorLevel 2
    10 exon usage coefficient factorLevel 1
    11 relative exon usage fold changes
    12 GRanges object of the coordinates of the exon/feature
    13 matrix of integer counts, of each column containing a sample
    14 list of transcripts overlapping with the exon
====== ==========================================================


.. _DEXSeq: http://master.bioconductor.org/packages/release/bioc/html/DEXSeq.html

    </help>
    <citations>
        <citation type="doi">10.1101/gr.133744.111</citation>
    </citations>
</tool>