view gemini_db_info.xml @ 8:c2a413e47fe9 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/gemini commit f7bdf08922aaf4119aefe7041e754a69cf64aebd
author iuc
date Wed, 13 Jul 2022 15:37:56 +0000
parents bc8b01d1b496
children
line wrap: on
line source

<tool id="gemini_db_info" name="GEMINI database info" version="@VERSION@">
    <description>Retrieve information about tables, columns and annotation data stored in a GEMINI database</description>
    <expand macro="bio_tools"/>
    <macros>
        <import>gemini_macros.xml</import>
    </macros>
    <expand macro="requirements" />
    <expand macro="stdio" />
    <expand macro="version_command" />
    <command>
<![CDATA[
        #if str($select.info_type) == 'scheme':
            gemini db_info '$infile' | tr -s ' ' '\t'
        #elif str($select.info_type) == 'resources':
            gemini query --header -q "SELECT name as data_source, resource as resource_file from resources" '$infile'
        #elif str($select.info_type) == 'gene_detailed':
            gemini query --header -q "SELECT gene, synonym as synonyms, transcript FROM gene_detailed WHERE gene is not NULL GROUP BY transcript ORDER BY gene" '$infile'
        #else:
            gemini query --header -q "SELECT * FROM samples" "$infile" | cut -f 2-${select.format}
        #end if

        > '$outfile'
]]>
    </command>
    <inputs>
        <expand macro="infile" />
        <conditional name="select">
            <param name="info_type" type="select"
            label="Information to retrieve from the database">
                <option value="scheme">Names of database tables and their columns</option>
                <option value="resources">List of annotation data sources</option>
                <option value="gene_detailed">List of genes and their transcripts</option>
                <option value="samples">Write out sample information in PED format</option>
            </param>
            <when value="scheme" />
            <when value="resources" />
            <when value="gene_detailed" />
            <when value="samples">
                <param name="format" type="select" display="radio"
                label="Format of the pedigree file">
                    <option value="">Allow extra columns to accomodate custom sample info</option>
                    <option value="7">Restrict to 6 PED standard columns and drop additional info</option>
                </param>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="outfile" format="tabular" />
    </outputs>
    <tests>
        <test>
            <param name="infile" value="gemini_load_result1.db" ftype="gemini.sqlite" />
            <conditional name="select">
                <param name="info_type" value="scheme" />
            </conditional>
            <output name="outfile">
                <assert_contents>
                    <has_line_matching expression="table_name&#009;column_name&#009;type.*" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="infile" value="gemini_load_result1.db" ftype="gemini.sqlite" />
            <conditional name="select">
                <param name="info_type" value="resources" />
            </conditional>
            <output name="outfile">
                <assert_contents>
                    <has_line line="data_source&#009;resource_file" />
                    <has_n_columns n="2" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="infile" value="gemini_load_result1.db" ftype="gemini.sqlite" />
            <conditional name="select">
                <param name="info_type" value="gene_detailed" />
            </conditional>
            <output name="outfile">
                <assert_contents>
                    <has_line line="gene&#009;synonyms&#009;transcript" />
                    <has_n_columns n="3" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="infile" value="gemini_comphets_input.db" ftype="gemini.sqlite" />
            <conditional name="select">
                <param name="info_type" value="samples" />
            </conditional>
            <output name="outfile">
                <assert_contents>
                    <has_line_matching expression="family_id&#009;name&#009;paternal_id&#009;maternal_id&#009;sex&#009;phenotype&#009;.+" />
                </assert_contents>
            </output>
        </test>
        <test>
            <param name="infile" value="gemini_comphets_input.db" ftype="gemini.sqlite" />
            <conditional name="select">
                <param name="info_type" value="samples" />
                <param name="format" value="7" />
            </conditional>
            <output name="outfile">
                <assert_contents>
                    <has_line line="family_id&#009;name&#009;paternal_id&#009;maternal_id&#009;sex&#009;phenotype" />
                    <has_n_columns n="6" />
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
**What it does**

Because of the sheer number of annotations that are stored in gemini, it is easy to lose the overview of what is actually available through database queries.

This tool offers a simple way to inspect the structure, the origin of the
annotations and some of the actual annotation content quickly.
    ]]></help>
    <expand macro="citations"/>
</tool>