view macros.xml @ 3:12baadec7809 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/obitools commit 5d3c7a7b3f7d687bb03ef7993ddf1a6507d655bd"
author iuc
date Mon, 10 May 2021 19:35:45 +0000
parents 7d16de45c021
children 08d873cdd5f6
line wrap: on
line source

<?xml version="1.0"?>
<macros>
    <xml name="requirements">
        <requirements>
            <requirement type="package" version="@TOOL_VERSION@">obitools</requirement>
        </requirements>
    </xml>

    <token name="@TOOL_VERSION@">1.2.13</token>
    <token name="@PROFILE@">21.01</token>

    <xml name="stdio">
        <stdio>
            <exit_code range="1:" level="fatal" description="Error in Obitools execution" />
        </stdio>
    </xml>

    <token name="@INPUT_FORMATS@">fastqsanger,fastqsanger.gz,fastqsolexa,fastqsolexa.gz,fasta,fasta.gz</token>
    <token name="@GUNZIP_INPUT@"><![CDATA[
        #if $input.ext.endswith(".gz")
            gunzip -c '$input' > input &&
        #else
            ln -s '$input' input &&
        #end if
    ]]></token>
    <token name="@GZIP_OUTPUT@"><![CDATA[
        #if $input.ext.endswith(".gz")
        | gzip -c 
    #end if
    ]]></token>
    
    <!-- generate galaxy.json to determine output format
        - by default same as input
        - if out_format can be specified 
          - fasta/fastq depending on $out_format (if != "")
          - or fasta if the tool does not support choosing the output format, e.g. obiuniq which always outputs fasta
        - gz if $input is zipped 
    
        A list of outputs to include in the json can be given by
        setting a variable $outputs = [...] listing pairs of output names and the actual output
        (defaults to [("output", $output)])
    -->
    <token name="@GENERATE_GALAXY_JSON@"><![CDATA[
        #import json

        #try:
            #silent $outputs[0]
        #except 
            #set outputs = [("output", $output)]
        #end try

        #if $input.ext.startswith("fastq")
            #set ext = "fastqsanger"
        #else if $input.ext.startswith("fasta")
            #set ext = "fasta"
        #end if

        #try
            #if $out_format == "fasta"
                #set ext = "fasta"
            #else if $out_format == "fastq"
                #set ext = "fastqsanger"
            #end if
        #except
            #set ext = "fasta"
        #end try

        #if $input.ext.endswith(".gz")
            #set ext = ext + ".gz"
        #end if

        #set gxy_json = {}
        #for oname, o in $outputs
            #silent gxy_json[oname] = {"ext": ext}
        #end for
        && echo '${json.dumps(gxy_json)}' >> galaxy.json
    ]]></token>
    
    <token name="@OUT_FORMAT@"><![CDATA[
        #if $out_format
            --${out_format}-output
        #end if
    ]]></token>
    
    <xml name="out_format_macro">
        <param name="out_format" type="select" optional="true" label="Output data type" help="For FASTA/Q the the default output type is the same as the input type">
            <option value="fasta">fasta</option>
            <option value="fastq">fastq</option>
        </param>
    </xml>

    <token name="@OBITOOLS_LINK@">
<![CDATA[
--------

**Project links:**

`OBITools`_

.. _OBITools: https://pythonhosted.org/OBITools/
]]>
    </token>

    <xml name="attributes">
        <option value="ali_dir" selected="true">ali_dir</option>
        <option value="ali_length">ali_length</option>
        <option value="avg_quality">avg_quality</option>
        <option value="best_match">best_match</option>
        <option value="best_identity">best_identity</option>
        <option value="class">class</option>
        <option value="cluster">cluster</option>
        <option value="complemented">complemented</option>
        <option value="count">count</option>
        <option value="cut">cut</option>
        <option value="direction">direction</option>
        <option value="distance">distance</option>
        <option value="error">error</option>
        <option value="experiment">experiment</option>
        <option value="family">family</option>
        <option value="family_name">family_name</option>
        <option value="forward_error">forward_error</option>
        <option value="forward_match">forward_match</option>
        <option value="forward_primer">forward_primer</option>
        <option value="forward_score">forward_score</option>
        <option value="forward_tag">forward_tag</option>
        <option value="forward_tm">forward_tm</option>
        <option value="genus">genus</option>
        <option value="genus_name">genus_name</option>
        <option value="head_quality">head_quality</option>
        <option value="id_status">id_status</option>
        <option value="merged_star">merged_star</option>
        <option value="merged">merged</option>
        <option value="mid_quality">mid_quality</option>
        <option value="mode">mode</option>
        <option value="obiclean_cluster">obiclean_cluster</option>
        <option value="obiclean_count">obiclean_count</option>
        <option value="obiclean_head">obiclean_head</option>
        <option value="obiclean_headcount">obiclean_headcount</option>
        <option value="obiclean_internalcount">obiclean_internalcount</option>
        <option value="obiclean_samplecount">obiclean_samplecount</option>
        <option value="obiclean_singletoncount">obiclean_singletoncount</option>
        <option value="obiclean_status">obiclean_status</option>
        <option value="occurrence">occurrence</option>
        <option value="order">order</option>
        <option value="order_name">order_name</option>
        <option value="pairend_limit ">pairend_limit </option>
        <option value="partial ">partial </option>
        <option value="rank">rank</option>
        <option value="reverse_error">reverse_error</option>
        <option value="reverse_match">reverse_match</option>
        <option value="reverse_primer">reverse_primer</option>
        <option value="reverse_score">reverse_score</option>
        <option value="reverse_tag">reverse_tag</option>
        <option value="reverse_tm">reverse_tm</option>
        <option value="sample">sample</option>
        <option value="scientific_name">scientific_name</option>
        <option value="score">score</option>
        <option value="score_norm">score_norm</option>
        <option value="select">select</option>
        <option value="seq_ab_match">seq_ab_match</option>
        <option value="seq_a_single">seq_a_single</option>
        <option value="seq_a_mismatch">seq_a_mismatch</option>
        <option value="seq_a_deletion">seq_a_deletion</option>
        <option value="seq_a_insertion">seq_a_insertion</option>
        <option value="seq_b_single">seq_b_single</option>
        <option value="seq_b_mismatch">seq_b_mismatch</option>
        <option value="seq_b_deletion">seq_b_deletion</option>
        <option value="seq_b_insertion">seq_b_insertion</option>
        <option value="seq_length">seq_length</option>
        <option value="seq_length_ori">seq_length_ori</option>
        <option value="seq_rank">seq_rank</option>
        <option value="sminL">sminL</option>
        <option value="sminR">sminR</option>
        <option value="species">species</option>
        <option value="species_list">species_list</option>
        <option value="species_name">species_name</option>
        <option value="status">status</option>
        <option value="strand">strand</option>
        <option value="tail_quality">tail_quality</option>
        <option value="taxid">taxid</option>
    </xml>

    <xml name="input_format_options_macro">
        <section name="input_format_options" title="Input format options" expanded="false">
            <param name="options_inputtype" type="select"  optional="true" label="Specify the input datatype" help="default: determine automatically (should only be necessay for non FASTA/FASTQ datasets)">
                <option value="--genbank">genbank</option>
                <option value="--embl">embl</option>
                <option value="--sanger">sanger</option>
                <option value="--solexa">solexa</option>
                <option value="--ecopcr">ecopcr</option>
                <option value="--ecopcrdb">ecopcrdb</option>
                <option value="--fasta">fasta (including obitools fasta extentions)</option>
                <option value="--raw-fasta">raw fasta (more tolerant format variant)</option>
            </param>
            <param name="options_seqtype" type="select" optional="true" label="Specify the sequence datatype" >
                <option value="--nuc">nucleic</option>
                <option value="--prot">protein</option>
            </param>
        </section>
    </xml>
    
    <token name="@INPUT_FORMAT@"><![CDATA[
        #if $input_format_options.options_inputtype
            $input_format_options.options_inputtype
        #else
            #if $input.ext.startswith("fasta")
                --fasta
            #else if $input.ext.startswith("fastqsolexa")
                ## input file is in fastq nucleic format produced by solexa sequencer
                --solexa
            #else
                ## input file is in sanger fastq nucleic format (standard fastq)
                --sanger
            #end if
        #end if
        #if $input_format_options.options_seqtype
            $input_format_options.options_seqtype
        #end if
    ]]></token>

    <xml name="sanitizer">
        <sanitizer invalid_char="test">
            <valid initial="default">
                <!--add value="&quot;"/-->
            </valid>
            <mapping initial="default">
                <add source="&gt;" target="\&gt;"/>
                <add source="&quot;" target="\&quot;"/>
            </mapping>
        </sanitizer>
    </xml>

    <xml name="citation">
        <citations>
            <citation type="doi">10.1111/1755-0998.12428</citation>
        </citations>
    </xml>

</macros>