view kraken.xml @ 10:766d5f63b0f4 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/blob/master/tool_collections/kraken/ commit 3a94fbf6a188ea81441ef2f654ba5a74bff56f22
author iuc
date Tue, 12 Mar 2024 16:10:22 +0000
parents aec58624706f
children
line wrap: on
line source

<?xml version="1.0"?>
<tool id="kraken" name="Kraken" version="@WRAPPER_VERSION@">
    <description>
        assign taxonomic labels to sequencing reads
    </description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <expand macro="xrefs"/>
    <expand macro="requirements" />
    <expand macro="version_command" />
    <command detect_errors="exit_code">
        <![CDATA[
        @SET_DATABASE_PATH@ &&

        kraken
            --threads \${GALAXY_SLOTS:-1}
            @INPUT_DATABASE@
            ${only_classified_output}

            #if str( $quick_operation.quick ) == "yes":
                --quick
                --min-hits ${quick_operation.min_hits}

            #end if

            #if $single_paired.single_paired_selector == 'yes'
                #if $forward_input.is_of_type( 'fastq' ):
                    --fastq-input
                #else:
                    --fasta-input
                #end if
                '${single_paired.forward_input}' '${single_paired.reverse_input}'
                ${single_paired.check_names}
            #elif $single_paired.single_paired_selector == "collection":
                #if $single_paired.input_pair.forward.is_of_type( 'fastq' ):
                    --fastq-input
                #else:
                    --fasta-input
                #end if
                '${single_paired.input_pair.forward}' '${single_paired.input_pair.reverse}'
                ${single_paired.check_names}
            #else:
                #if $single_paired.input_sequences.is_of_type('fastq')
                    --fastq-input
                #else:
                    --fasta-input
                #end if
                '${single_paired.input_sequences}'
            #end if

            #if $split_reads:
                --classified-out '${classified_out}' --unclassified-out '${unclassified_out}'
            #end if

            ## The --output option was changed to redirect as it does not work properly is some situations. For example, on test database the tool classifies 4 reads but does not write them into a file if --output is specified. It does however print correct output into STDOUT. This behavior can be re-created with test database provided in test-data/test_db/ folder. This is the reason for incrementing version number from 1.1.2 to 1.1.3

            > '${output}'
            ##kraken-translate --db '${kraken_database.fields.name}' '${output}' > '${translated}'
    ]]></command>
    <inputs>
        <conditional name="single_paired">
            <param name="single_paired_selector" type="select" label="Single or paired reads" help="--paired">
                <option value="collection">Collection</option>
                <option value="yes">Paired</option>
                <option selected="True" value="no">Single</option>
            </param>
            <when value="collection">
                <param format="fasta,fastq" name="input_pair" type="data_collection" collection_type="paired" label="Collection of paired reads" help="FASTA or FASTQ datasets" />
                <param argument="--check-names" type="boolean" checked="False" truevalue="--paired --check-names" falsevalue="--paired" label="Verify read names match"/>
            </when>
            <when value="yes">
                <param format="fasta,fastq" name="forward_input" type="data" label="Forward strand" help="FASTA or FASTQ dataset"/>
                <param format="fasta,fastq" name="reverse_input" type="data" label="Reverse strand" help="FASTA or FASTQ dataset"/>
                <param name="check_names" type="boolean" checked="False" truevalue="--paired --check-names" falsevalue="--paired" label="Verify read names match" help="--check-names" />
            </when>
            <when value="no">
                <param format="fasta,fastq" label="Input sequences" name="input_sequences" type="data" help="FASTA or FASTQ datasets"/>
            </when>

        </conditional>
        <param name="split_reads" type="boolean" label="Output classified and unclassified reads?" help="Sets --unclassified-out and --classified-out"/>

        <conditional name="quick_operation">
            <param argument="--quick" type="select" label="Enable quick operation"
                   help="Quick mode: rather than searching all k-mers in a sequence, stop classification after a specified number of database hit">
                <option value="yes">Yes</option>
                <option selected="True" value="no">No</option>
            </param>
            <when value="yes">
                <param argument="--min-hits" type="integer" value="1" label="Number of hits required for classification"
                       help="min-hits will allow you to require multiple hits before declaring a sequence classified, which can be especially useful with custom databases when testing to see if sequences either do or do not belong to a particular genome; default=1"/>
            </when>
            <when value="no"/><!-- Do absolutely nothing -->
        </conditional>

        <param argument="--only-classified-output" type="boolean" checked="False" truevalue="--only-classified-output" falsevalue=""
               label="Print no Kraken output for unclassified sequences"/>

        <expand macro="input_database" />
    </inputs>
    <outputs>
        <data name="classified_out" format_source="input_sequences" label="${tool.name} on ${on_string}: Classified reads">
            <filter>(split_reads)</filter>
        </data>
        <data name="unclassified_out" format_source="input_sequences" label="${tool.name} on ${on_string}: Unclassified reads">
            <filter>(split_reads)</filter>
        </data>
        <data name="output" format="tabular" label="${tool.name} on ${on_string}: Classification"/>
        <!--<data format="tabular" label="${tool.name} on ${on_string}: Translated classification" name="translated" />-->
    </outputs>

    <tests>
        <test expect_num_outputs="1">
            <param name="single_paired_selector" value="no"/>
            <param name="input_sequences" value="kraken/kraken_test1.fa" ftype="fasta"/>
            <param name="split_reads" value="false"/>
            <param name="quick" value="no"/>
            <param name="only-classified-output" value="false"/>
            <param name="kraken_database" value="old_style_test_entry"/>
            <output name="output" file="kraken/kraken_test1_output.tab" ftype="tabular"/>
        </test>
        <test expect_num_outputs="1">
            <param name="single_paired_selector" value="no"/>
            <param name="input_sequences" value="kraken/kraken_test1.fa" ftype="fasta"/>
            <param name="split_reads" value="false"/>
            <param name="quick" value="no"/>
            <param name="only-classified-output" value="false"/>
            <param name="kraken_database" value="new_style_test_entry"/>
            <output name="output" file="kraken/kraken_test1_output.tab" ftype="tabular"/>
        </test>
    </tests>
    <help>
        <![CDATA[
**What it does**

Kraken is a taxonomic sequence classifier that assigns taxonomic labels to short DNA reads. It does this by examining the k-mers within a read and querying a database with those k-mers. This database contains a mapping of every k-mer in Kraken's genomic library to the lowest common ancestor (LCA) in a taxonomic tree of all genomes that contain that k-mer. The set of LCA taxa that correspond to the k-mers in a read are then analyzed to create a single taxonomic label for the read; this label can be any of the nodes in the taxonomic tree. Kraken is designed to be rapid, sensitive, and highly precise.

-----

**Output Format**

Each sequence classified by Kraken results in a single line of output. Output lines contain five tab-delimited fields; from left to right, they are::

    1. "C"/"U": one letter code indicating that the sequence was either classified or unclassified.
    2. The sequence ID, obtained from the FASTA/FASTQ header.
    3. The taxonomy ID Kraken used to label the sequence; this is 0 if the sequence is unclassified.
    4. The length of the sequence in bp.
    5. A space-delimited list indicating the LCA mapping of each k-mer in the sequence. For example, "562:13 561:4 A:31 0:1 562:3" would indicate that:
            a) the first 13 k-mers mapped to taxonomy ID #562
            b) the next 4 k-mers mapped to taxonomy ID #561
            c) the next 31 k-mers contained an ambiguous nucleotide
            d) the next k-mer was not in the database
            e) the last 3 k-mers mapped to taxonomy ID #562
        ]]>
    </help>
    <expand macro="citations" />
</tool>