view data_manager/data_manager_refgenie_pull.xml @ 1:ecb14c82f4d7 draft

"planemo upload for repository https://github.com/blankenberglab/galaxy-tools-blankenberg/tree/master/data_managers/data_manager_refgenie_pull commit da4cbfcb158b1cf283c5736434fa88b645783306"
author blankenberglab
date Fri, 10 Sep 2021 12:52:13 +0000
parents 659bfadcd8c6
children f5401ae34455
line wrap: on
line source

<tool id="data_manager_refgenie_pull" name="refgenie asset pulling" version="@VERSION@" tool_type="manage_data" profile="20.05">
    <description>from remote resource</description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <requirements>
        <requirement type="package" version="@VERSION@">refgenie</requirement>
    </requirements>
    <code file="data_manager_refgenie_pull.py" />
    <environment_variables>
        <environment_variable name="API_KEY" inject="api_key" />
    </environment_variables>
    <command detect_errors="exit_code"><![CDATA[
       #for $asset in $assets:
         #set ga = str($asset).split('/',2)
         refgenie pull -c '$__app__.config.refgenie_config_file' -g '$ga[1]' '$ga[2]' $force >> '${out_log}' 2>&1
         &&
       #end for
       echo '{}' > '${out_file}'
       #if $api_refresh:
         && python '${__tool_directory__}/data_manager_refgenie_pull.py' -k "\$API_KEY" -u '${__galaxy_url__}' >> '${out_log}'
       #end if
    ]]></command>
    <inputs>
        <param argument="--assets" name="assets" type="drill_down" display="checkbox" hierarchy="exact" multiple="True" optional="False" label="Select desired asset" dynamic_options="galaxy_code_get_refgenie_assets(__trans__.app.config.refgenie_config_file)" help="string of asset-registry-paths">
            <validator type="regex" message="You must select an asset, not the remote URL or genome.">.+/.+/.+</validator>
        </param>
        <param argument="--force" name="force" type="boolean" truevalue="--force" falsevalue="" checked="False" label="Force (re-)download" />
        <param argument="--api_refresh" name="api_refresh" type="boolean" truevalue="--api_refresh" falsevalue="" checked="True" label="Refresh Galaxy data tables using API" />
    </inputs>
    <outputs>
        <data name="out_file" format="data_manager_json"/>
        <data name="out_log" format="txt"/>
    </outputs>
    <tests>
        <test>
            <param name="assets" value="aHR0cDovL3JlZmdlbm9tZXMuZGF0YWJpby5vcmcvdjIvYXNzZXRz/t7/fasta:default"/>
            <param name="force" value="--force"/>
            <param name="api_refresh" value=""/>
            <output name="out_file">
                <assert_contents>
                    <has_text text="{}"/>
                </assert_contents>
            </output>
            <output name="out_log">
                <assert_contents>
                    <has_text text="Download complete"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

Fetches a reference genome using refgenie (http://refgenie.databio.org).

.. class:: infomark

**Notice:** Galaxy data tables will be refreshed using API calls.

.. class:: warning

**You must configure Galaxy to use refgenie, by setting 'refgenie_config_file' in the Galaxy config. This tool uses refgenie config file version 0.3.**
    ]]></help>
    <citations>
        <citation type="doi">10.1093/gigascience/giz149</citation>
        <citation type="doi">10.1101/2020.10.09.327114</citation>
    </citations>
</tool>