view macros.xml @ 1:d13b21a1a231 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tool_collections/fgbio commit fdd4ffa3adad8412f98305d809927691bafd2ed7
author iuc
date Tue, 04 Nov 2025 18:39:39 +0000
parents 9d593c42f037
children
line wrap: on
line source

<macros>
    <xml name="requirements">
        <requirements>
            <requirement type="package" version="@TOOL_VERSION@">fgbio</requirement>
            <requirement type="package" version="1.22">samtools</requirement>
            <yield/>
        </requirements>
    </xml>
    <token name="@TOOL_VERSION@">2.1.0</token>
    <token name="@VERSION_SUFFIX@">0</token>
    <token name="@PROFILE@">22.05</token>

    <xml name="optional_reference" token_help="" token_argument="">
        <conditional name="addref_cond">
            <param name="addref_select" type="select" label="Use a reference sequence">
                <help>@HELP@</help>
                <option value="no">No</option>
                <option value="history">Use a genome/index from the history</option>
                <option value="cached">Use a built-in genome</option>
            </param>
            <when value="no"/>
            <when value="history">
                <param argument="@ARGUMENT@" type="data" format="fasta,fasta.gz" label="Reference"/>
            </when>
            <when value="cached">
                <param argument="@ARGUMENT@" type="select" label="Reference">
                    <options from_data_table="fasta_indexes">
                        <filter type="data_meta" ref="input" key="dbkey"/>
                    </options>
                    <validator type="no_options" message="No reference genome is available for the build associated with the selected input dataset"/>
                </param>
            </when>
        </conditional>
    </xml>

    <xml name="mandatory_reference" token_help="" token_argument="">
        <conditional name="addref_cond">
            <param name="addref_select" type="select" label="Use a reference sequence">
                <help>@HELP@</help>
                <option value="history">Use a genome/index from the history</option>
                <option value="cached">Use a built-in genome</option>
            </param>
            <when value="history">
                <param argument="@ARGUMENT@" type="data" format="fasta,fasta.gz" label="Reference"/>
            </when>
            <when value="cached">
                <param argument="@ARGUMENT@" type="select" label="Reference">
                    <options from_data_table="fasta_indexes">
                        <filter type="data_meta" ref="input" key="dbkey"/>
                        <validator message="No reference genome is available for the build associated with the selected input dataset" type="no_options" />
                    </options>
                </param>
            </when>
        </conditional>
    </xml>

    <token name="@PREPARE_FASTA_IDX@"><![CDATA[
        #set use_ref=True
        #if $addref_cond.addref_select == "history":
            #if $addref_cond.ref.is_of_type('fasta'):
                reffa="reference.fa" &&
                ln -s '${addref_cond.ref}' \$reffa &&
                samtools faidx \$reffa &&
            #else:
                reffa="reference.fa.gz" &&
                ln -s '${addref_cond.ref}' \$reffa &&
                {
                    samtools faidx \$reffa ||
                    {
                        echo "Failed to index compressed reference. Trying decompressed ..." 1>&2 &&
                        gzip -dc \$reffa > reference.fa &&
                        reffa="reference.fa" &&
                        samtools faidx \$reffa;
                    }
                } &&
            #end if
            reffai=\$reffa.fai &&
        #elif $addref_cond.addref_select == "cached":
            reffa='${addref_cond.ref.fields.path}' &&
            reffai=\$reffa.fai &&
        #else
            #set use_ref=False
        #end if
    ]]></token>

    <xml name="citations">
        <citations>
            <citation type="doi">10.5281/zenodo.16878970</citation>
        </citations>
    </xml>

    <xml name="version_command">
        <version_command><![CDATA[fgbio --version 2>&1 | grep Version]]></version_command>
    </xml>

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