view sarscov2formatter.xml @ 2:2e993ff8e7dc draft default tip

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/sarscov2formatter commit dc4d978a42ef881f602b813f9416fd37e3ea3b6a"
author iuc
date Mon, 22 Nov 2021 10:41:59 +0000
parents e3a7995dce75
children
line wrap: on
line source

<tool id="sarscov2formatter" name="sarscov2formatter" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="18.01">
    <macros>
        <token name="@TOOL_VERSION@">1.0</token>
        <token name="@VERSION_SUFFIX@">0</token>
    </macros>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">sarscov2formatter</requirement>
    </requirements>
    <command><![CDATA[
sarscov2formatter
-a '$align'
#if $source.source_choice == 'ncbi':
    #if $source.meta
        -n '$source.meta'
    #end if
#else:
    -m '$source.meta'
#end if
    ]]></command>
    <inputs>
        <param name="align" type="data" format="fasta" label="Multiple Sequence Alignment (MSA)" help='MSA to be used in HyPhy analysis' />
        <conditional name="source" >
            <param name="source_choice" type="select" label="NCBI datasource or other?" >
                <option value="ncbi">NCBI</option>
                <option value="other">Other</option>
            </param>
            <when value="ncbi">
                 <param name="meta" type="data" format="json" optional="true" label="Metadata from NCBI" help="If not given it will be downloaded" />
            </when>
            <when value="other" >
                 <param name="meta" type="data" format="tabular" label="Metadata" help="Tabular file with metadata with the correct columns (see below)" />
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="msa" format="fasta" from_work_dir="msa.fasta" label="${tool.name}: MSA" />
        <data name="dups" format="json" from_work_dir="duplicates.json" label="${tool.name}: Duplicates" />
        <data name="outmeta" format="json" from_work_dir="meta.json" label="${tool.name}: Metadata" />
    </outputs>
    <tests>
        <!-- note: test with ncbi yields unstable results for meta -> assert contents. -->
        <test>
            <param name="align" ftype="fasta" value="align.fasta" />
            <conditional name="source" >
                <param name="source_choice" value="ncbi" />
            </conditional>
            <output name="msa" ftype="fasta" compare="diff" value="msa.fasta" />
            <output name="dups" ftype="json" compare="diff" value="dups.json" />
            <output name="outmeta" ftype="json">
                <assert_contents>
                    <has_line_matching expression="\{"/>
                    <has_line_matching expression="\}"/>
                    <has_text_matching expression='"LR757995": \{'/>
                    <has_text_matching expression='"collected": '/>
                    <has_text_matching expression='"collected": '/>
                    <has_text_matching expression='"location": '/>
                    <has_text_matching expression='"country": '/>
                    <has_text_matching expression='"locality": '/>
                    <has_text_matching expression='"state": '/>
                    <has_text_matching expression='"subregion": '/>
                </assert_contents>
            </output>
        </test>
        <!-- test with local NCBI data, here a json file containing only the entries relevant for the fasta -->
        <test>
            <param name="align" ftype="fasta" value="align.fasta" />
            <conditional name="source" >
                <param name="source_choice" value="ncbi" />
                <param name="meta" ftype="json" value="test.json" />
            </conditional>
            <output name="msa" ftype="fasta" compare="diff" value="msa.fasta" />
            <output name="dups" ftype="json" compare="diff" value="dups.json" />
            <output name="outmeta" ftype="json">
                <assert_contents>
                    <has_line_matching expression="\{"/>
                    <has_line_matching expression="\}"/>
                    <has_text_matching expression='"LR757995": \{'/>
                    <has_text_matching expression='"collected": '/>
                    <has_text_matching expression='"collected": '/>
                    <has_text_matching expression='"location": '/>
                    <has_text_matching expression='"country": '/>
                    <has_text_matching expression='"locality": '/>
                    <has_text_matching expression='"state": '/>
                    <has_text_matching expression='"subregion": '/>
                </assert_contents>
            </output>
        </test>
        <!-- TODO test with tabular input -->
       <test>
           <param name="align" ftype="fasta" value="align.fasta" />
           <conditional name="source" >
               <param name="source_choice" value="other" />
               <param name="meta" ftype="tabular" value="test.tsv" />
           </conditional>
           <output name="msa" ftype="fasta" compare="diff" value="msa-other.fasta" />
           <output name="dups" ftype="json" compare="diff" value="dups-other.json" />
           <output name="outmeta" ftype="json" compare="diff" value="meta-other.json" />
       </test>
    </tests>
        <help><![CDATA[

=================
sarscov2formatter
=================

Custom sript that performs necessary formatting operations for the SARS-CoV2 Selection Analysis workflow.

If using NCBI as data source the file can be obtained from https://www.ncbi.nlm.nih.gov/projects/genome/sars-cov-2-seqs/ncov-sequences.yaml.
If not given the tool will download it automatically.

If using non-NCBI data, the metadata input file must be tabular with the following columns: ID, collection_date, country, state (optional), and locality (optional). Optional columns should still be created even if they are not used.

Dates should be of the format: YYMMDD (example: May 1 2020 = 20200501).

    ]]></help>
    <citations>
        <citation type="bibtex">
            @misc{githubsarscov2formatter,
            author = {Nicholas Keener},
            year = {2020},
            title = {sarscov2formatter},
            publisher = {Github},
            journal = {Github repository},
            url = {https://github.com/nickeener/sarscov2formatter},
        }</citation>
    </citations>
</tool>