view cuffdiff_wrapper.xml @ 17:43221aef70e2 draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/cufflinks/cuffdiff commit 0e1d7660ab8ccb677b4f79207f5bc78097640f04"
author iuc
date Sat, 27 Nov 2021 09:58:11 +0000
parents af3e173cad7f
children
line wrap: on
line source

<tool id="cuffdiff" name="Cuffdiff" version="@VERSION@.6">
    <description>find significant changes in transcript expression, splicing, and promoter use</description>
    <macros>
        <import>cuff_macros.xml</import>
    </macros>
    <expand macro="requirements">
        <requirement type="package" version="2.16.0">bioconductor-cummerbund</requirement>
    </expand>
    <version_command><![CDATA[cuffdiff 2>&1 | head -n 1]]></version_command>
    <command detect_errors="aggressive"><![CDATA[
        cuffdiff
            --no-update-check
            --quiet
            --FDR=$fdr
            --num-threads="\${GALAXY_SLOTS:-4}"
            --min-alignment-count=$min_alignment_count
            --library-norm-method=$library_norm_method
            --dispersion-method=$dispersion_method

            ## Set advanced SE data parameters?
            #if $additional.sAdditional == "Yes":
                -m $additional.frag_mean_len
                -s $additional.frag_len_std_dev
            #end if

            ## Multi-read correct?
            #if $multiread_correct :
                -u
            #end if

            ## Bias correction?
            #if $bias_correction.do_bias_correction == "Yes":
               -b
                #if $bias_correction.seq_source.index_source == "history":
                    ## Custom genome from history.
                    '$bias_correction.seq_source.ref_file'
                #else:
                    ## Built-in genome.
                    '${bias_correction.seq_source.index.fields.path}'
                #end if
            #end if

            @CONDITION_LABELS@

            $length_correction

            ## Set advanced parameters for cufflinks
             #if $advanced_settings.sAdvanced == "Yes":
                #if str($advanced_settings.library_type) != 'auto':
                        --library-type=$advanced_settings.library_type
                #end if
                #if $advanced_settings.mask_file:
                        --mask-file '$advanced_settings.mask_file'
                    #end if
                #if $advanced_settings.time_series:
                        --time-series
                #end if
                --max-mle-iterations=$advanced_settings.max_mle_iterations
                $advanced_settings.hits_norm
                --max-bundle-frags=$advanced_settings.max_bundle_frags
                --num-frag-count-draws=$advanced_settings.num_frag_count_draws
                --num-frag-assign-draws=$advanced_settings.num_frag_assign_draws
                --min-reps-for-js-test=$advanced_settings.min_reps_for_js_test
            #end if
            ## Inputs.
            '$gtf_input'

            @CONDITION_SAMPLES@
            #if $generate_sqlite:
                &&
                Rscript '$__tool_directory__/cummeRbund.R'
            #end if
            ]]>
    </command>
    <inputs>
        <param format="gtf,gff3" name="gtf_input" type="data" label="Transcripts" help="A transcript GFF3 or GTF file produced by cufflinks, cuffcompare, or other source."/>
        <param name="omit_tabular_output" type="boolean" truevalue="yes" falsevalue="no" label="Omit Tabular Datasets" help="Discard the tabular output." />
        <param name="generate_sqlite" type="boolean" truevalue="yes" falsevalue="no" label="Generate SQLite" help="Generate a SQLite database for use with cummeRbund." />
        <expand macro="condition_inputs" />
        <param name="library_norm_method" type="select" label="Library normalization method">
            <option value="geometric" selected="True">geometric</option>
            <option value="classic-fpkm">classic-fpkm</option>
            <option value="quartile">quartile</option>
        </param>

        <param name="dispersion_method" type="select" label="Dispersion estimation method" help="If using only one sample per condition, you must use 'blind.'">
            <option value="pooled" selected="True">pooled</option>
            <option value="per-condition">per-condition</option>
            <option value="blind">blind</option>
            <option value="poisson">poisson</option>
        </param>

        <param name="fdr" type="float" value="0.05" label="False Discovery Rate" help="The allowed false discovery rate."/>
        <param name="min_alignment_count" type="integer" value="10" label="Min Alignment Count"
            help="The minimum number of alignments in a locus for needed to conduct significance testing on changes in that locus observed between samples."/>
        <param name="multiread_correct" type="boolean" label="Use multi-read correct"
            help="Tells Cufflinks to do an initial estimation procedure to more accurately weight reads mapping to multiple locations in the genome." />

        <conditional name="bias_correction">
            <param name="do_bias_correction" type="select" label="Perform Bias Correction"
                help="Bias detection and correction can significantly improve accuracy of transcript abundance estimates.">
                <option value="No">No</option>
                <option value="Yes">Yes</option>
            </param>
            <when value="Yes">
                <conditional name="seq_source">
                    <param name="index_source" type="select" label="Reference sequence data">
                        <option value="cached">Locally cached</option>
                        <option value="history">History</option>
                    </param>
                    <when value="cached">
                        <param name="index" type="select" label="Using reference genome">
                        <options from_data_table="fasta_indexes">
                            <filter type="data_meta" ref="gtf_input" key="dbkey" column="1" />
                            <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset" />
                        </options>
                        </param>
                    </when>
                    <when value="history">
                        <param name="ref_file" type="data" format="fasta" label="Using reference file" />
                    </when>
                </conditional>
            </when>
            <when value="No"></when>
        </conditional>

        <param name="include_read_group_files" type="select" label="Include Read Group Datasets" help="Read group datasets provide information on replicates.">
            <option value="No" selected="true">No</option>
            <option value="Yes">Yes</option>
        </param>

        <param name="include_count_files" type="select" label="Include Count Based output files"
            help="Cuffdiff estimates the number of fragments that originated from each transcript, primary transcript, and gene in each sample. Primary transcript and gene counts are computed by summing the counts of transcripts in each primary transcript group or gene group.">
            <option value="No" selected="true">No</option>
            <option value="Yes">Yes</option>
        </param>

        <param name="length_correction" type="select" label="apply length correction" help="mode of length normalization to transcript fpkm.">
            <option value="" selected="true">cufflinks effective length correction</option>
            <option value="--no-effective-length-correction">standard length correction</option>
            <option value="--no-length-correction">no length correction at all (use raw counts)</option>
        </param>

        <conditional name="additional">
            <param name="sAdditional" type="select" label="Set Additional Parameters for single end reads? (not recommended for paired-end reads)">
                <option value="No" selected="True">No</option>
                <option value="Yes">Yes</option>
            </param>
            <when value="No"></when>
            <when value="Yes">
                <param name="frag_mean_len" type="integer" value="200" label="Average Fragment Length"/>
                <param name="frag_len_std_dev" type="integer" value="80" label="Fragment Length Standard Deviation"/>
            </when>
        </conditional>

        <conditional name="advanced_settings">
            <param name="sAdvanced" type="select" label="Set Advanced Cuffdiff parameters? ">
                <option value="No" selected="True">No</option>
                <option value="Yes">Yes</option>
            </param>
            <when value="No"></when>
            <when value="Yes">
                <param type="select" name="library_type" label="Library prep used for input reads" help="">
                    <option value="auto" selected="True">Auto Detect</option>
                    <option value="ff-firststrand">ff-firststrand</option>
                    <option value="ff-secondstrand">ff-secondstrand</option>
                    <option value="ff-unstranded">ff-unstranded</option>
                    <option value="fr-firststrand">fr-firststrand</option>
                    <option value="fr-secondstrand">fr-secondstrand</option>
                    <option value="fr-unstranded" >fr-unstranded</option>
                    <option value="transfrags">transfrags</option>
                </param>
                <param name="mask_file" type="data" format="gtf,gff3" label="Mask File" help="Ignore all alignment within transcripts in this file" optional="True" />
                <param name="time_series" type="boolean" label="Perform Time Series analysis"
                    help="Instructs Cuffdiff to analyze the provided samples as a time series, rather than testing for differences between all pairs of samples. Samples should be provided in increasing time order at the command line (e.g first time point SAM, second timepoint SAM, etc.)" />
                <param name="max_mle_iterations" value="5000" type="integer" label="Max MLE iterations" help="Maximum iterations allowed for Maximal Likelyhood Estimation calculations" />
                <param name="hits_norm" type="select" label="Hits included in normalization" help="All Hits: With this option, Cufflinks counts all fragments, including those not compatible with any reference transcript, towards the number of mapped fragments used in the FPKM denominator. Compatible Hits: With this option, Cufflinks counts only those fragments compatible with some reference transcript towards the number of mapped fragments used in the FPKM denominator. Using this mode is generally recommended in Cuffdiff to reduce certain types of bias caused by differential amounts of ribosomal reads which can create the impression of falsely differentially expressed genes. It is active by default." >
                    <option value="--compatible-hits-norm" selected="True">Compatible Hits</option>
                    <option value="--total-hits-norm">All Hits</option>
                </param>
                <param name="max_bundle_frags" type="integer" value="500000" label="Maximum number of fragments per locus"
                    help="Sets the maximum number of fragments a locus may have before being skipped. Skipped loci are listed in skipped.gtf. Default: 500,000" />
                <param name="num_frag_count_draws" type="integer" value="100" label="Number of fragment generation samples"
                    help="Cuffdiff will make this many draws from each transcript's predicted negative binomial random numbder generator. Each draw is a number of fragments that will be probabilistically assigned to the transcripts in the transcriptome. Used to estimate the variance-covariance matrix on assigned fragment counts. Default: 100."/>
                <param name="num_frag_assign_draws" type="integer" value="50" label="Number of fragment assignment samples per generation" help="For each fragment drawn from a transcript, Cuffdiff will assign it this many times (probabilistically), thus estimating the assignment uncertainty for each transcript. Used to estimate the variance-covariance matrix on assigned fragment counts. Default: 50."/>
                <param name="min_reps_for_js_test" type="integer" value="3" label="Minimal Replicates for isoform shift testing" help="Cuffdiff won't test genes for differential regulation unless the conditions in question have at least this many replicates. Default: 3." />
            </when>
        </conditional>
    </inputs>
    <outputs>
        <!-- Optional read group datasets. -->
        <data format="tabular" name="isoforms_read_group" label="${tool.name} on ${on_string}: isoforms read group tracking" from_work_dir="isoforms.read_group_tracking" >
            <filter>(include_read_group_files == 'Yes') and not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="genes_read_group" label="${tool.name} on ${on_string}: genes read group tracking" from_work_dir="genes.read_group_tracking" >
            <filter>(include_read_group_files == 'Yes') and not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="cds_read_group" label="${tool.name} on ${on_string}: CDs read group tracking" from_work_dir="cds.read_group_tracking" >
            <filter>(include_read_group_files == 'Yes') and not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="tss_groups_read_group" label="${tool.name} on ${on_string}: TSS groups read group tracking" from_work_dir="tss_groups.read_group_tracking" >
            <filter>(include_read_group_files == 'Yes') and not omit_tabular_output</filter>
        </data>
        <data format="txt" name="read_group_info" label="${tool.name} on ${on_string}: read group info" from_work_dir="read_groups.info" >
            <filter>(include_read_group_files == 'Yes') and not omit_tabular_output</filter>
        </data>
        <data format="txt" name="run_info" label="${tool.name} on ${on_string}: run info" from_work_dir="run.info" >
            <filter>(include_read_group_files == 'Yes') and not omit_tabular_output</filter>
        </data>
        <!-- Standard datasets. -->
        <data format="tabular" name="splicing_diff" label="${tool.name} on ${on_string}: splicing differential expression testing" from_work_dir="splicing.diff">
            <filter>not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="promoters_diff" label="${tool.name} on ${on_string}: promoters differential expression testing" from_work_dir="promoters.diff">
            <filter>not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="cds_diff" label="${tool.name} on ${on_string}: CDS overloading diffential expression testing" from_work_dir="cds.diff">
            <filter>not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="cds_exp_fpkm_tracking" label="${tool.name} on ${on_string}: CDS FPKM differential expression testing" from_work_dir="cds_exp.diff">
            <filter>not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="cds_fpkm_tracking" label="${tool.name} on ${on_string}: CDS FPKM tracking" from_work_dir="cds.fpkm_tracking">
            <filter>not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="cds_count_tracking" label="${tool.name} on ${on_string}: CDS count tracking" from_work_dir="cds.count_tracking" >
            <filter>(include_count_files == 'Yes') and not omit_tabular_output</filter>
        </data>

        <data format="tabular" name="tss_groups_exp" label="${tool.name} on ${on_string}: TSS groups differential expression testing" from_work_dir="tss_group_exp.diff">
            <filter>not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="tss_groups_fpkm_tracking" label="${tool.name} on ${on_string}: TSS groups FPKM tracking" from_work_dir="tss_groups.fpkm_tracking">
            <filter>not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="tss_groups_count_tracking" label="${tool.name} on ${on_string}: TSS count FPKM tracking" from_work_dir="tss_groups.count_tracking" >
            <filter>(include_count_files == 'Yes') and not omit_tabular_output</filter>
        </data>

        <data format="tabular" name="genes_exp" label="${tool.name} on ${on_string}: gene differential expression testing" from_work_dir="gene_exp.diff">
            <filter>not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="genes_fpkm_tracking" label="${tool.name} on ${on_string}: gene FPKM tracking" from_work_dir="genes.fpkm_tracking">
            <filter>not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="genes_count_tracking" label="${tool.name} on ${on_string}: gene count tracking" from_work_dir="genes.count_tracking" >
            <filter>(include_count_files == 'Yes') and not omit_tabular_output</filter>
        </data>

        <data format="tabular" name="isoforms_exp" label="${tool.name} on ${on_string}: transcript differential expression testing" from_work_dir="isoform_exp.diff">
            <filter>not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="isoforms_fpkm_tracking" label="${tool.name} on ${on_string}: transcript FPKM tracking" from_work_dir="isoforms.fpkm_tracking">
            <filter>not omit_tabular_output</filter>
        </data>
        <data format="tabular" name="isoforms_count_tracking" label="${tool.name} on ${on_string}: transcript count tracking" from_work_dir="isoforms.count_tracking">
            <filter>(include_count_files == 'Yes') and not omit_tabular_output</filter>
        </data>
        <data format="sqlite" name="output_cummerbund" label="${tool.name} on ${on_string}: cummeRbund SQLite database" from_work_dir="cummeRbund.sqlite">
            <filter>generate_sqlite</filter>
        </data>
    </outputs>

    <tests>
        <test>
            <!--
                cuffdiff cuffcompare_out5.gtf cuffdiff_in1.sam cuffdiff_in2.sam
            -->
            <param name="gtf_input" value="cuffdiff_in1.gtf" ftype="gtf" />
            <param name="generate_sqlite" value="yes" />
            <param name="omit_tabular_output" value="yes" />
            <conditional name="in_type">
                <param name="set_in_type" value="BAM" />
                <repeat name="conditions">
                    <param name="name" value="q1" />
                    <param name="samples" value="cuffdiff_in1.sam" ftype="sam" />
                </repeat>
                <repeat name="conditions">
                    <param name="name" value="q2" />
                    <param name="samples" value="cuffdiff_in2.sam" ftype="sam" />
                </repeat>
            </conditional>
            <param name="fdr" value="0.05" />
            <param name="min_alignment_count" value="0" />
            <param name="do_bias_correction" value="No" />
            <param name="multiread_correct" value="No"/>
            <param name="sAdditional" value="No"/>
            <output name="output_cummerbund" ftype="sqlite" file="cuffdiff_out.sqlite" compare="sim_size" />
        </test>
        <test>
            <!--
                Use a list collection as conditions input
                cuffdiff cuffcompare_out5.gtf cuffdiff_in1.sam cuffdiff_in2.sam
            -->
            <param name="gtf_input" value="cuffdiff_in1.gtf" ftype="gtf" />
            <param name="generate_sqlite" value="yes" />
            <param name="omit_tabular_output" value="yes" />
            <conditional name="in_type">
                <param name="set_in_type" value="CONDITION_LIST" />
                <param name="conditions">
                    <collection type="list">
                        <element name="q1" value="cuffdiff_in1.sam" />
                        <element name="q2" value="cuffdiff_in2.sam" />
                    </collection>
                </param>
            </conditional>
            <param name="fdr" value="0.05" />
            <param name="min_alignment_count" value="0" />
            <param name="do_bias_correction" value="No" />
            <param name="multiread_correct" value="No"/>
            <param name="sAdditional" value="No"/>
            <output name="output_cummerbund" ftype="sqlite" file="cuffdiff_out.sqlite" compare="sim_size" />
        </test>
        <test>
            <!--
                cuffdiff cuffcompare_out5.gtf cuffdiff_in1.sam cuffdiff_in2.sam
            -->
            <param name="gtf_input" value="cuffdiff_in1.gtf" ftype="gtf" />
            <param name="omit_tabular_output" value="no" />
            <conditional name="in_type">
                <param name="set_in_type" value="BAM" />
                <repeat name="conditions">
                    <param name="name" value="q1" />
                    <param name="samples" value="cuffdiff_in1.sam" ftype="sam" />
                </repeat>
                <repeat name="conditions">
                    <param name="name" value="q2" />
                    <param name="samples" value="cuffdiff_in2.sam" ftype="sam" />
                </repeat>
            </conditional>
            <param name="fdr" value="0.05" />
            <param name="min_alignment_count" value="0" />
            <param name="do_bias_correction" value="No" />
            <param name="multiread_correct" value="No"/>
            <param name="sAdditional" value="No"/>
            <output name="splicing_diff" file="splicing.diff"/>
            <output name="promoters_diff" file="promoters.diff"/>
            <output name="cds_diff" file="cds.diff"/>
            <output name="cds_exp_fpkm_tracking" file="cds.exp_fpkm_tracking"/>
            <output name="cds_fpkm_tracking" file="cds.fpkm_tracking"/>
            <output name="tss_groups_exp" file="tss.groups_exp" lines_diff="200"/>
            <output name="tss_groups_fpkm_tracking" file="tss.groups_fpkm_tracking"/>
            <output name="genes_exp" file="genes.exp" lines_diff="200"/>
            <output name="genes_fpkm_tracking" file="genes.fpkm_tracking" lines_diff="200"/>
            <output name="isoforms_exp" file="isoforms.exp" lines_diff="200"/>
            <output name="isoforms_fpkm_tracking" file="isoforms.fpkm_tracking" lines_diff="200"/>
        </test>
    </tests>
    <help>
**Cuffdiff Overview**

Cuffdiff is part of Cufflinks_. Cuffdiff find significant changes in transcript expression, splicing, and promoter use. Please cite: Trapnell C, Williams BA, Pertea G, Mortazavi AM, Kwan G, van Baren MJ, Salzberg SL, Wold B, Pachter L. Transcript assembly and abundance estimation from RNA-Seq reveals thousands of new transcripts and switching among isoforms. Nature Biotechnology doi:10.1038/nbt.1621

.. _Cufflinks: http://cole-trapnell-lab.github.io/cufflinks/

------

**Know what you are doing**

.. class:: warningmark

There is no such thing (yet) as an automated gearshift in expression analysis. It is all like stick-shift driving in San Francisco. In other words, running this tool with default parameters will probably not give you meaningful results. A way to deal with this is to **understand** the parameters by carefully reading the `documentation`__ and experimenting. Fortunately, Galaxy makes experimenting easy.

.. __: http://cole-trapnell-lab.github.io/cufflinks/cuffdiff/

------

**Input format**

Cuffdiff takes Cufflinks or Cuffcompare GTF files as input along with two SAM files containing the fragment alignments for two or more samples.

------

**Outputs**

Cuffdiff produces many output files:

1. Transcript FPKM (+count) expression tracking.
2. Gene FPKM (+count) expression tracking; tracks the summed FPKM of transcripts sharing each gene_id
3. Primary transcript FPKM (+count) tracking; tracks the summed FPKM of transcripts sharing each tss_id
4. Coding sequence FPKM (+count) tracking; tracks the summed FPKM of transcripts sharing each p_id, independent of tss_id
5. Transcript differential FPKM.
6. Gene differential FPKM. Tests difference sin the summed FPKM of transcripts sharing each gene_id
7. Primary transcript differential FPKM. Tests difference sin the summed FPKM of transcripts sharing each tss_id
8. Coding sequence differential FPKM. Tests difference sin the summed FPKM of transcripts sharing each p_id independent of tss_id
9. Differential splicing tests: this tab delimited file lists, for each primary transcript, the amount of overloading detected among its isoforms, i.e. how much differential splicing exists between isoforms processed from a single primary transcript. Only primary transcripts from which two or more isoforms are spliced are listed in this file.
10. Differential promoter tests: this tab delimited file lists, for each gene, the amount of overloading detected among its primary transcripts, i.e. how much differential promoter use exists between samples. Only genes producing two or more distinct primary transcripts (i.e. multi-promoter genes) are listed here.
11. Differential CDS tests: this tab delimited file lists, for each gene, the amount of overloading detected among its coding sequences, i.e. how much differential CDS output exists between samples. Only genes producing two or more distinct CDS (i.e. multi-protein genes) are listed here.

-------

**Settings**

All of the options have a default value. You can change any of them. Most of the options in Cuffdiff have been implemented here.

------

**Cuffdiff parameter list**

This is a list of implemented Cuffdiff options::

  -m INT                         Average fragment length (SE reads); default 200
  -s INT                         Fragment legnth standard deviation (SE reads); default 80
  -c INT                         The minimum number of alignments in a locus for needed to conduct significance testing on changes in that locus observed between samples. If no testing is performed, changes in the locus are deemed not significant, and the locus' observed changes don't contribute to correction for multiple testing. The default is 1,000 fragment alignments (up to 2,000 paired reads).
  --FDR FLOAT                    The allowed false discovery rate. The default is 0.05.
  --max-mle-iterations INT       Sets the number of iterations allowed during maximum likelihood estimation of abundances. Default: 5000
  --library-norm-method          Library Normalization method : Geometric (default), classic-fpkm, quartile
  --dispersion-method            Dispersion estimation method : Pooled (default), per-condition, blind, poisson
  -u                             Multi read correction tells Cufflinks to do an initial estimation procedure to more accurately weight reads mapping to multiple locations in the genome.
  -b ref.fasta                         bias correction. Bias detection and correction can significantly improve accuracy of transcript abundance estimates.
  --no-effective-length-correction  Use standard length correction
  --no-length-correction         Disable all length correction.
  --library-type                 ff-firststrand,ff-secondstrand,ff-unstranded,fr-firstrand,fr-secondstrand,fr-unstranded,transfrags
  --mask-file (gff3/gtf)         Ignore all alignment within transcripts in this file
  --time-series                  Treat provided sam files as time series
  --compatible-hits-norm         With this option, Cufflinks counts only those fragments compatible with some reference transcript towards the number of mapped fragments used in the FPKM denominator. Using this mode is generally recommended in Cuffdiff to reduce certain types of bias caused by differential amounts of ribosomal reads which can create the impression of falsely differentially expressed genes.
  --total-hits-norm              With this option, Cufflinks counts all fragments, including those not compatible with any reference transcript, towards the number of mapped fragments used in the FPKM denominator
  --max-bundle-frags             Sets the maximum number of fragments a locus may have before being skipped. Skipped loci are listed in skipped.gtf.
  --num-frag-count-draws         Cuffdiff will make this many draws from each transcript's predicted negative binomial random numbder generator. Each draw is a number of fragments that will be probabilistically assigned to the transcripts in the transcriptome. Used to estimate the variance-covariance matrix on assigned fragment counts.
  --num-frag-assign-draws        For each fragment drawn from a transcript, Cuffdiff will assign it this many times (probabilistically), thus estimating the assignment uncertainty for each transcript. Used to estimate the variance-covariance matrix on assigned fragment counts.
  --min-reps-for-js-test         Cuffdiff won't test genes for differential regulation unless the conditions in question have at least this many replicates.
    </help>
    <expand macro="citations"/>
</tool>