view macros.xml @ 9:f921014aba5a draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/diamond commit 828c844036743151594e57cc19811f4c8d9179b3"
author iuc
date Sat, 27 Nov 2021 09:48:10 +0000
parents 54f751e413f4
children 1e3323a44643
line wrap: on
line source

<macros>
    <token name="@TOOL_VERSION@">2.0.8</token>

    <xml name="requirements">
        <requirements>
          <requirement type="package" version="@TOOL_VERSION@">diamond</requirement>
        </requirements>
    </xml>

    <xml name="stdio">
        <stdio>
            <regex match="Failed to allocate" source="stderr" level="fatal_oom" />
        </stdio>
    </xml>

    <xml name="version_command">
        <version_command>diamond version | cut -d" " -f 3</version_command>
    </xml>

    <xml name="output_type_macro">
        <conditional name="output">
            <param argument="--outfmt" type="select" label="Format of output file " help="">
                <option value="0">BLAST pairwise</option>
                <option value="5">BLAST XML</option>
                <option value="6">BLAST tabular</option>
                <option value="100">DAA</option>
                <option value="101">SAM</option>
                <option value="102">Taxonomic classification</option>
            </param>
            <when value="0"/>
            <when value="5"/>
            <when value="6">
                <param name="fields" type="select" label="Tabular fields" help="" multiple="true">
                    <option value="qseqid" selected="true">Query Seq - id</option>
                    <option value="sseqid" selected="true">Subject Seq - id</option>
                    <option value="sallseqid">All subject Seq - id(s)</option>
                    <option value="qlen">Query sequence length</option>
                    <option value="slen">Subject sequence length</option>
                    <option value="pident" selected="true">Percentage of identical matches</option>
                    <option value="length" selected="true">Alignment length</option>
                    <option value="nident">Number of identical matches</option>
                    <option value="mismatch" selected="true">Number of mismatches</option>
                    <option value="positive">Number of positive - scoring matches</option>
                    <option value="gapopen" selected="true">Number of gap openings</option>
                    <option value="gaps">Total number of gaps</option>
                    <option value="ppos">Percentage of positive - scoring matches</option>
                    <option value="qstart" selected="true">Start of alignment in query</option>
                    <option value="qend" selected="true">End of alignment in query</option>
                    <option value="sstart" selected="true">Start of alignment in subject</option>
                    <option value="send" selected="true">End of alignment in subject</option>
                    <option value="qseq">Aligned part of query sequence</option>
                    <option value="sseq">Aligned part of subject sequence</option>
                    <option value="qseq_translated">Translation of the aligned part of query sequence</option>
                    <option value="evalue" selected="true">Expect value</option>
                    <option value="bitscore" selected="true">Bit score</option>
                    <option value="score">Raw score</option>
                    <option value="qframe">Query frame</option>
                    <option value="btop">Blast traceback operations(BTOP)</option>
                    <option value="scovhsp">Subject coverage per HSP</option>
                    <option value="stitle">Subject Title</option>
                    <option value="salltitles">All Subject Title(s)</option>
                    <option value="qcovhsp">Query Coverage Per HSP</option>
                    <option value="qtitle">Query title</option>
                    <option value="full_qseq">Query sequence</option>
                    <option value="full_sseq">Subject sequence</option>
                    <option value="qqual">Query quality values for the aligned part of the query</option>
                    <option value="full_qqual">Query quality values</option>
                    <option value="qstrand">Query strand</option>
                    <option value="cigar">Cigar</option>
                    <yield/>
                </param>
                <param argument="--unal" type="boolean" label="Report unaligned queries" truevalue="1" falsevalue="0" checked="false"/>
            </when>
            <when value="100">
                <param argument="--salltitles" type="boolean" truevalue="--salltitles" falsevalue="" checked="true" label="Include full subject titles in DAA file?" help=""/>
                <param argument="--sallseqid" type="boolean" truevalue="--sallseqid" falsevalue="" checked="true" label="Include all subject ids in DAA file?" help=""/>
            </when>
            <when value="101">
                <param argument="--salltitles" type="boolean" truevalue="--salltitles" falsevalue="" checked="true" label="Include full subject titles in DAA file?" help=""/>
                <param argument="--sallseqid" type="boolean" truevalue="--sallseqid" falsevalue="" checked="true" label="Include all subject ids in DAA file?" help=""/>
            </when>
            <when value="102"/>
        </conditional>
    </xml>

    <xml name="hit_filter_macro">
        <conditional name="hit_filter">
            <param name="hit_filter_select" type="select" label="Method to restrict the number of hits?">
                <option value="max">Maximum number of target sequences</option>
                <option value="top">Percentage of top alignment score</option>
            </param>
            <when value="max">
                <param name="max_target_seqs" argument="--max-target-seqs" type="integer" value="25" label="The maximum number of target sequences per query to report alignments for" help="Setting this to 0 will report all alignments that were found." />
            </when>
            <when value="top">
                <param argument="--top" type="integer" value="0" label="Keep alignments within the given percentage range of the top alignment score for a query" help="For example, setting this to 10 will report all align-
ments whose score is at most 10% lower than the best alignment score for a query." />
            </when>
        </conditional>
    </xml>

    <xml name="block_size_low_sens">
        <param argument="--block-size" type="float" value="2" label="Block size in billions of sequence letters to be processed at a time" help="" />
    </xml>

    <xml name="block_size_hi_sens">
        <param argument="--block-size" type="float" value="0.4" label="Block size in billions of sequence letters to be processed at a time" help="" />
    </xml>

    <xml name="citations">
        <citations>
            <citation type="doi">10.1038/nmeth.3176</citation>
        </citations>
    </xml>


    <xml name="output_macro">
        <data format="txt" name="blast_pairw" label="${tool.name} on ${on_string}">
            <filter>output["outfmt"] == "0"</filter>
        </data>
        <data format="xml" name="blast_xml" label="${tool.name} on ${on_string}">
            <filter>output["outfmt"] == "5"</filter>
        </data>
        <data format="tabular" name="blast_tabular" label="${tool.name} on ${on_string}">
            <filter>output["outfmt"] == "6"</filter>
        </data>
        <!-- for daa diamond appends the .daa extension -> hence from_work_dir -->
        <data format="daa" name="daa_output" label="${tool.name} on ${on_string}" from_work_dir="output.daa">
            <filter>output["outfmt"] == "100"</filter>
        </data>
        <data format="sam" name="sam_output" label="${tool.name} on ${on_string}">
            <filter>output["outfmt"] == "101"</filter>
        </data>
        <data format="tabular" name="tax_output" label="${tool.name} on ${on_string}">
            <filter>output["outfmt"] == "102"</filter>
        </data>
    </xml>

    <token name="@OUTPUT_ARGS@">
        #if $output.outfmt == "0"
            --outfmt '0'
            --out '$blast_pairw'
        #else if $output.outfmt == "5"
            --outfmt '5'
            --out '$blast_xml'
        #else if $output.outfmt == "6"
            --outfmt '6' #echo ' '.join(str($output.fields).split(','))
            --out '$blast_tabular'
            --unal $output.unal
        #else if $output.outfmt == "100"
            --outfmt '100'
            $output.salltitles
            $output.sallseqid
            --out output.daa
        #else if $output.outfmt == "101"
            --outfmt '101'
            $output.salltitles
            $output.sallseqid
            --out '$sam_output'
        #else if $output.outfmt == "102"
            --outfmt '102'
            --out '$tax_output'
        #end if
    </token>

    <token name="@HITFILTER_ARGS@">
        #if str($hit_filter.hit_filter_select) == 'max':
            --max-target-seqs '$hit_filter.max_target_seqs'
        #else:
            --top '$hit_filter.top'
        #end if
    </token>
</macros>