view extract_genomic_dna.xml @ 5:c8467246b57e draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/extract_genomic_dna commit 19ea4feff5ccf3744c549b9a67259947a1cb90ba
author iuc
date Sat, 21 Jan 2017 14:41:27 -0500
parents 4822a36300fd
children 53db9cb721f1
line wrap: on
line source

<tool id="Extract genomic DNA 1" name="Extract Genomic DNA" version="3.0.3">
    <description>using coordinates from assembled/unassembled genomes</description>
    <requirements>
        <requirement type="package" version="0.7.1">bx-python</requirement>
        <requirement type="package" version="324">ucsc-fatotwobit</requirement>
    </requirements>
    <command>
        <![CDATA[
            #set genome = $input.metadata.dbkey
            #set datatype = $input.datatype
            mkdir -p output_dir &&
            python $__tool_directory__/extract_genomic_dna.py
            --input "$input"
            --genome "$genome"
            #if $input.is_of_type("gff"):
                --input_format "gff"
                --columns "1,4,5,7"
                --interpret_features $interpret_features
            #else:
                --input_format "interval"
                --columns "${input.metadata.chromCol},${input.metadata.startCol},${input.metadata.endCol},${input.metadata.strandCol},${input.metadata.nameCol}"
            #end if
            --reference_genome_source $reference_genome_cond.reference_genome_source
            #if str($reference_genome_cond.reference_genome_source) == "cached"
                --reference_genome $reference_genome_cond.reference_genome.fields.path
            #else:
                --reference_genome $reference_genome_cond.reference_genome
            #end if
            --output_format $output_format_cond.output_format
            #if str($output_format_cond.output_format) == "fasta":
                --fasta_header_type $output_format_cond.fasta_header_type_cond.fasta_header_type
                #if str($output_format_cond.fasta_header_type_cond.fasta_header_type) == "char_delimited":
                    --fasta_header_delimiter $output_format_cond.fasta_header_type_cond.fasta_header_delimiter
                #end if
            #end if
            --output $output
        ]]>
    </command>
    <inputs>
        <param name="input" type="data" format="gff,interval" label="Fetch sequences for intervals in">
            <validator type="unspecified_build" />
        </param>
        <param name="interpret_features" type="select" label="Interpret features when possible" help="Applicable only when input dataset format is in the gff family">
            <option value="yes">Yes</option>
            <option value="no">No</option>
        </param>
        <conditional name="reference_genome_cond">
            <param name="reference_genome_source" type="select" label="Choose the source for the reference genome">
                <option value="cached">locally cached</option>
                <option value="history">from history</option>
            </param>
            <when value="cached">
                <param name="reference_genome" type="select" label="Using reference genome">
                    <options from_data_table="twobit">
                        <filter type="data_meta" key="dbkey" ref="input" column="0"/>
                    </options>
                    <validator type="no_options" message="A built-in reference genome is not available for the build associated with the selected input file"/>
                </param>
            </when>
            <when value="history">
                <param name="reference_genome" type="data" format="fasta" label="Using reference genome">
                    <options>
                        <filter type="data_meta" key="dbkey" ref="input"/>
                    </options>
                    <validator type="no_options" message="The current history does not include a fasta dataset with the build associated with the selected input file"/>
                </param>
            </when>
        </conditional>
        <conditional name="output_format_cond">
            <param name="output_format" type="select" label="Select output format">
                <option value="fasta" selected="True">fasta</option>
                <option value="interval">interval</option>
            </param>
            <when value="fasta">
                <conditional name="fasta_header_type_cond">
                    <param name="fasta_header_type" type="select" label="Select fasta header format">
                        <option value="bedtools_getfasta_default" selected="True">bedtools getfasta default</option>
                        <option value="char_delimited">character delimited field values</option>
                    </param>
                    <when value="bedtools_getfasta_default"/>
                    <when value="char_delimited">
                        <param name="fasta_header_delimiter" type="select" label="Select fasta header field delimiter">
                            <option value="underscore" selected="True">underscore (_)</option>
                            <option value="semicolon">semicolon (;)</option>
                            <option value="comma">comma (,)</option>
                            <option value="tilde">tilde (~)</option>
                            <option value="vertical_bar">vertical bar (|)</option>
                        </param>
                    </when>
                </conditional>
            </when>
            <when value="interval"/>
        </conditional>
    </inputs>
    <outputs>
        <data format_source="input" name="output" metadata_source="input">
            <change_format>
                <when input="output_format_cond.output_format" value="fasta" format="fasta" />
            </change_format>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="input" value="mm9_input1.gff" dbkey="mm9" ftype="gff" />
            <param name="interpret_features" value="no"/>
            <param name="reference_genome_source" value="history"/>
            <param name="reference_genome" value="mm9.fasta"/>
            <param name="output_format" value="fasta"/>
            <param name="fasta_header_type" value="char_delimited"/>
            <param name="fasta_header_delimiter" value="tilde"/>
            <output name="output" file="extract_genomic_dna_out1.fasta" compare="contains" />
        </test>
        <test>
            <param name="input" value="mm9_input1.gff" dbkey="mm9" ftype="gff" />
            <param name="interpret_features" value="yes"/>
            <param name="reference_genome_source" value="history"/>
            <param name="reference_genome" value="mm9.fasta"/>
            <param name="output_format" value="fasta"/>
            <param name="fasta_header_type" value="bedtools_getfasta_default"/>
            <output name="output" file="extract_genomic_dna_out2.fasta" compare="contains" />
        </test>
        <test>
            <param name="input" value="mm9_input1.gff" dbkey="mm9" ftype="gff" />
            <param name="interpret_features" value="no"/>
            <param name="reference_genome_source" value="history"/>
            <param name="reference_genome" value="mm9.fasta"/>
            <param name="output_format" value="interval"/>
            <output name="output" file="extract_genomic_dna_out3.gff" compare="contains" />
        </test>
        <test>
            <param name="input" value="mm9_input1.gff" dbkey="mm9" ftype="gff" />
            <param name="interpret_features" value="yes"/>
            <param name="reference_genome_source" value="history"/>
            <param name="reference_genome" value="mm9.fasta"/>
            <param name="output_format" value="interval"/>
            <output name="output" file="extract_genomic_dna_out4.gff" compare="contains" />
        </test>
    </tests>
    <help>

.. class:: warningmark

This tool requires interval or gff (special tabular formatted data).  If your data is not TAB delimited, first use *Text Manipulation-&gt;Convert*.

.. class:: warningmark

Make sure that the genome build is specified for the dataset from which you are extracting sequences (click the pencil icon in the history item if it is not specified). 

.. class:: warningmark

All of the following will cause a line from the input dataset to be skipped and a warning generated.  The number of warnings and skipped lines is documented in the resulting history item.
 - Any lines that do not contain at least 3 columns, a chromosome and numerical start and end coordinates.
 - Sequences that fall outside of the range of a line's start and end coordinates. 
 - Chromosome, start or end coordinates that are invalid for the specified build.
 - Any lines whose data columns are not separated by a **TAB** character ( other white-space characters are invalid ).

-----

**What it does**

This tool uses coordinate, strand, and build information to fetch genomic DNAs in FASTA or interval format.

If the output format is FASTA, the header format can be specified.  Selecting the **bedtools getfasta default**
option produces a FASTA header formatted like the default header produced the the bedtools getfasta tool, and
the "force strandedness" option is assumed.  If the input data includes a strand column and the strand is '+'
or '-', it is included in the header.  If the input data includes a strand column and the value is anything but
'+' or '-', a '.' is included in the header.  If the input data does not include a strand column, a '.' is included
in the header.

An example FASTA header produced by selecting this option is:

    &gt;chr7:127475281-127475310(+)

Selecing the **character delimited field values** option allows selection of a character delimiter that is used
when generating the FASTA header with fields genome, chrom, start, end, strand (name) delimited by the
selected character.  For example, selecting an underscore will produce a FASTA header like this:

    &gt;mm9_53_550_+ test_chromosome

while selecting a vertical bar will produce a FASTA header like this:

    &gt;mm9|53|550|+ test_chromosome

If strand is not defined, the default value is "+".

-----

**Example**

If the input dataset is::

    chr7  127475281  127475310  NM_000230  0  +
    chr7  127485994  127486166  NM_000230  0  +
    chr7  127486011  127486166  D49487     0  +

Extracting sequences with **FASTA** output data type, **character delimited field values** as header format and **header field delimiter** set to the underscore character returns::

    &gt;hg17_chr7_127475281_127475310_+ NM_000230
    GTAGGAATCGCAGCGCCAGCGGTTGCAAG
    &gt;hg17_chr7_127485994_127486166_+ NM_000230
    GCCCAAGAAGCCCATCCTGGGAAGGAAAATGCATTGGGGAACCCTGTGCG
    GATTCTTGTGGCTTTGGCCCTATCTTTTCTATGTCCAAGCTGTGCCCATC
    CAAAAAGTCCAAGATGACACCAAAACCCTCATCAAGACAATTGTCACCAG
    GATCAATGACATTTCACACACG
    &gt;hg17_chr7_127486011_127486166_+ D49487
    TGGGAAGGAAAATGCATTGGGGAACCCTGTGCGGATTCTTGTGGCTTTGG
    CCCTATCTTTTCTATGTCCAAGCTGTGCCCATCCAAAAAGTCCAAGATGA
    CACCAAAACCCTCATCAAGACAATTGTCACCAGGATCAATGACATTTCAC
    ACACG

Extracting sequences with **Interval** output data type returns::

    chr7    127475281       127475310       NM_000230       0       +       GTAGGAATCGCAGCGCCAGCGGTTGCAAG
    chr7    127485994       127486166       NM_000230       0       +       GCCCAAGAAGCCCATCCTGGGAAGGAAAATGCATTGGGGAACCCTGTGCGGATTCTTGTGGCTTTGGCCCTATCTTTTCTATGTCCAAGCTGTGCCCATCCAAAAAGTCCAAGATGACACCAAAACCCTCATCAAGACAATTGTCACCAGGATCAATGACATTTCACACACG
    chr7    127486011       127486166       D49487  0       +       TGGGAAGGAAAATGCATTGGGGAACCCTGTGCGGATTCTTGTGGCTTTGGCCCTATCTTTTCTATGTCCAAGCTGTGCCCATCCAAAAAGTCCAAGATGACACCAAAACCCTCATCAAGACAATTGTCACCAGGATCAATGACATTTCACACACG

    </help>
    <citations>
        <citation type="bibtex">
            @unpublished{None,
            author = {Guru Ananda,Greg Von Kuster},
            title = {None},
            year = {None},
            eprint = {None},
            url = {http://www.bx.psu.edu/~anton/labSite/}
        }</citation>
    </citations>
</tool>