view macros.xml @ 6:64be1ac21109 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/diamond commit 2f6d48e1d2161d03411d9fbb4fc3d16f0fa3d2e1
author bgruening
date Thu, 27 Sep 2018 06:30:30 -0400
parents df7738595640
children 62c9df8382c2
line wrap: on
line source

<macros>
    <token name="@VERSION@">0.9.21</token>

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

    <xml name="stdio">
        <stdio>
            <!-- disabled error detection by exit code to be able to detect oom errors by 
                 regex, can be reenabled when https://github.com/galaxyproject/galaxy/pull/6338 is merged
            <exit_code range=":-1" level="fatal"  description="Error occurred. Please check Tool Standard Error" />
            <exit_code range="1:" level="fatal"  description="Error occurred. Please check Tool Standard Error" />-->
            <regex match="Failed to allocate sufficient memory." source="stderr" level="fatal_oom" />
            <regex match=".+" source="stderr" level="fatal" description=""/>
        </stdio>
    </xml>

    <xml name="version_command">
        <version_command>diamond version</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="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="staxids">unique Subject Taxonomy ID(s), separated by a ';' (in numerical order)</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>
                </param>
            </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="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'
        #else if $output.outfmt == "100"
            --outfmt '100'
            --out output.daa
        #else if $output.outfmt == "101"
            --outfmt '101'
            --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>