view data_manager/data_manager_ncbi_taxonomy_sqlite.xml @ 0:7a76cd412252 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/data_managers/data_manager_ncbi_taxonomy_sqlite/ commit bad9f3d1468b454b1ac073fa796e66b1d0164d38"
author iuc
date Tue, 21 Jul 2020 17:04:41 -0400
parents
children 54a0869d0051
line wrap: on
line source

<tool id="data_manager_ncbi_taxonomy_sqlite" name="NCBI Taxonomy SQLite builder" tool_type="manage_data" profile="18.09" version="@PACKAGE_VERSION@+galaxy1" python_template_version="3.5">
    <macros>
        <token name="@PACKAGE_VERSION@">1.0.5</token>
    </macros>
    <requirements>
        <requirement type="package" version="@PACKAGE_VERSION@">rust-ncbitaxonomy</requirement>
        <requirement type="package" version="3.7">python</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        #if $taxonomy.taxonomy_source == 'cached':
            #set $taxonomy_dir = $taxonomy.taxonomy_table.fields.path
        #else
            mkdir taxonomy && ln -s '$taxonomy.nodes' taxonomy/nodes.dmp && ln -s '$taxonomy.names' taxonomy/names.dmp &&
            #set $taxonomy_dir = 'taxonomy'
        #end if 
        python '$__tool_directory__/data_manager_ncbi_taxonomy_sqlite.py' '$taxonomy_dir' '$name' '$description' '$output_file'
    ]]></command>
    <inputs>
        <conditional name="taxonomy">
            <param name="taxonomy_source" type="select" label="Choose source of NCBI Taxonomy">
                <option value="cached" selected="true">Use built-in NCBI Taxonomy database</option>
                <option value="history">Datasets from history</option>
            </param>
            <when value="cached">
                <param type="select" name="taxonomy_table" label="NCBI Taxonomy database">
                    <options from_data_table="ncbi_taxonomy">
                        <filter type="sort_by" column="1" /> 
                        <validator type="no_options" message="No NCBI Taxonomy downloads are available" />
                    </options>
                    <validator type="no_options" message="No NCBI Taxonomy database download is available" />
                </param>
            </when>
            <when value="history">
                <param name="nodes" type="data" format="txt" label="NCBI Taxonomy nodes.dmp file" />
                <param name="names" type="data" format="txt" label="NCBI Taxonomy names.dmp file" />
            </when>
        </conditional>
        <param name="name" type="text" label="Name of taxonomy database" help="(leave blank to use name based on today's date)" />
        <param name="description" type="text" label="Description of taxonomy database" help="(leave blank to use name based on today's date)" />
    </inputs>
    <outputs>
        <data name="output_file" format="data_manager_json"/> 
    </outputs>
    <tests>
        <test>
            <conditional name="taxonomy">
                <param name="taxonomy_source" value="history" />
                <param name="nodes" ftype="txt" value="taxdb/nodes.dmp" />
                <param name="names" ftype="txt" value="taxdb/names.dmp" />
            </conditional>
            <param name="name" value="test" />
            <param name="description" value="test database" />
            <output name="output_file">
                <assert_contents>
                    <has_text text="tax.ncbitaxonomy.sqlite" />
                    <has_text text="test database" />
                </assert_contents>
            </output>
        </test>
        <test>
            <conditional name="taxonomy">
                <param name="taxonomy_source" value="cached" />
                <param name="taxonomy_table" value="sample" />
            </conditional>
            <param name="name" value="test" />
            <param name="description" value="test database" />
            <output name="output_file">
                <assert_contents>
                    <has_text text="tax.ncbitaxonomy.sqlite" />
                    <has_text text="test database" />
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
        The data manager creates a SQLite version the NCBI Taxonomy database, using the plain text files of the
        NCBI database as input. Storing the database as a SQLite database allows for faster querying.

        Input is either from the individual files (nodes.dmp and names.dmp) from the NCBI Taxonomy database or
        from a previously downloaded code of the database stored as "reference data" in the Galaxy server.

        .. class: infomark

        *Notice:** If you leave name, or description blank, it will be generated automatically from the current date.
    ]]></help>
    <citations>
        <citation type="bibtex">@misc{vanHeusen2020,
        author = {van Heusden, P.},
        title = {a Rust crate for working with a local copy of the NCBI Taxonomy database },
        year = {2020},
        publisher = {GitHub},
        journal = {GitHub repository},
        howpublished = {\url{https://github.com/pvanheus/ncbitaxonomy}},
        commit = {84d79cdcf2adb262c61511f8c7b9eceb5299b87d}
        }
        </citation>
    </citations>
</tool>