view data_manager/nextclade_dm.xml @ 0:4de9e77bcc9e draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_nextclade commit 3d6dabd066dcbe31cfa38fbfac340e253d8a984d
author iuc
date Sat, 30 Jul 2022 08:09:42 +0000
parents
children
line wrap: on
line source

<tool id="data_manager_nextclade" name="nextclade data manager" version="0.0.1+galaxy0" tool_type="manage_data" profile="20.01">

    <requirements>
        <requirement type="package" version="3.8">python</requirement>
        <requirement type="package" version="2.3.0">nextclade</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
    #set $data_table = $__app__.tool_data_tables.get('nextclade')
    #if $data_table is not None and len($data_table.get_fields()) != 0
        #set $known_revisions = '--known_revisions=' + ','.join([row[0] for row in $data_table.get_fields()])
    #else
        #set $known_revisions = ''
    #end if
    #if str($additional_datasets).strip() != ''
        #if str($datasets) != ''
            #set $dataset_list = $datasets + ',' + str($additional_datasets).strip()
        #else
            #set $dataset_list = str($additional_datasets)
        #end if
    #else
        #set $dataset_list = str($datasets)
    #end if
    python '$__tool_directory__/nextclade_dm.py'
        $known_revisions
        #if $release.which == "latest"
            --latest
        #else if $release.which == "date_range"
            #if str($release.start_date).strip() != ""
                --start_date '$release.start_date'
            #end if
            #if str($release.end_date).strip() != ""
                --end_date '$release.end_date'
            #end if
        #end if
        --datasets '$dataset_list'        
        'nextclade'
        '${output_file}'
    ]]></command>
    <inputs>
        <param name="datasets" type="select" label="Select nextclade datasets" multiple="true">
            <option value="sars-cov-2" selected="true">SARS-CoV-2</option>
            <option value="MPXV">Monkeypox (All Clades)</option>
            <option value="hMPXV">Human Monkeypox (hMPXV)</option>
            <option value="hMPXV_B1">Human Monkeypox Clade B.1</option>
            <option value="flu_h1n1pdm_ha">Influenza A H1N1pdm HA</option>
            <option value="flu_h3n2_ha">Influenza A H3N2 HA</option>
            <option value="flu_vic_ha">Influenza B Victoria HA</option>
            <option value="flu_yam_ha">Influenza B Yamagata HA</option>
            <option value="sars-cov-2-no-recomb">SARS-CoV-2 without recombinants</option>
        </param>
        <param name="additional_datasets" type="text" label="Additional nextclade dataset names" help="If you want to download datasets that are not in the list above, enter their names here, separated by commas">
            <validator type="regex" message="Dataset names consist of letters, numbers, underscore and hyphens, with multiple names separated by ,">^[-A-Za-z0-9_]?[-A-Za-z0-9_,]*$</validator>
        </param>
        <conditional name="release">
            <param name="which" type="select" label="Select nextclade dataset(s) release">
                <option value="latest" selected="true">Latest</option>
                <option value="date_range">Date range</option>
            </param>
            <when value="latest">
            </when>
            <when value="date_range">
                <param name="start_date" type="text" label="Start date (YYYY-MM-DD)" help="Don't download models older than this date" optional="true">
                    <validator type="regex" message="Dates are in YYYY-MM-DD format">\d{4}-\d{2}-\d{2}$</validator>
                </param>
                <param name="end_date" type="text" label="End date (YYYY-MM-DD)" help="Don't download models newer than this date" optional="true">
                    <validator type="regex" message="Dates are in YYYY-MM-DD format">\d{4}-\d{2}-\d{2}$</validator>
                </param>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="output_file" format="data_manager_json"/>
    </outputs>
    <tests>
        <test expect_num_outputs="1">
            <conditional name="release">
                <param name="which" value="date_range" />
                <param name="start_date" value="2022-03-01" />
                <param name="end_date" value="2022-04-01" />
            </conditional>
            <output name="output_file">
                <assert_contents>
                    <has_text text='"database_name": "sars-cov-2"' />
                    <has_text text='sars-cov-2_2022-03-31T12-00-00Z' />
                    <has_text text='sars-cov-2_2022-03-24T12-00-00Z' />
                    <has_text text='sars-cov-2_2022-03-14T12-00-00Z"' />
                    <has_text text='"min_nextclade_version": "1.10.0"' />
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="1">
            <param name="datasets" value="MPXV,hMPXV" />
            <conditional name="release">
                <param name="which" value="latest" />
            </conditional>
            <output name="output_file">
                <assert_contents>
                    <has_text text='"database_name": "MPXV"' />
                    <has_text text='"database_name": "hMPXV"' />
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
        This data managers fetches databases for the nextclade_ viral genome typing tool and
        updates the nextclade database.

        The default is to fetch the latest version of the data tables, but ranges of dates
        can also be specified to fetch releases that are within those dates. The data manager
        has a built-in list of databases that can be fetched and users can specify ones by name
        if they want something that is not on the list.

        The data manager will read the existing data tables and not re-download or replace databases
        that are already present in those data tables.

        .. _nextclade: https://clades.nextstrain.org/
    ]]></help>
    <citations>
        <citation type="doi">10.21105/joss.03773</citation>
    </citations>
</tool>