view hamronize_tool.xml @ 0:d2590ecc4189 draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/hamronization commit 17562209ea2b5b8b28f229a5c305e468b04be58e"
author iuc
date Tue, 16 Mar 2021 12:38:42 +0000
parents
children ec82fac4eb4b
line wrap: on
line source

<tool id="hamronize_tool" name="hamronize" version="@VERSION@+galaxy0">
    <description> parse multiple Antimicrobial Resistance Analysis Reports into a common data structure</description>
    <macros>
        <import>macros.xml</import>
    </macros>

    <expand macro="requirements" />
    <expand macro="version_command" />

    <command detect_errors="exit_code"><![CDATA[
        #set $extra_2_params = str("ariba,srax,csstar,groot").split(",")
        #set $extra_1_param = $extra_2_params + str("amrfinderplus,rgi,resfinder4,deeparg,kmerresistance,srst2,amrplusplus,resfarms").split(",")
        
        hamronize 
        ${select_tool.tool}
        --analysis_software_version '${analysis_software_version}'
        --reference_database_version '${reference_database_version}'
        --format ${output_format}
        #if $output_format == "tsv" 
            --output hamronized.tsv
        #else
            --output hamronized.json
        #end if 
        
        #if $select_tool.tool in $extra_1_param
            --input_file_name $select_tool.input_file_name
        #end if
        
        #if $select_tool.tool in $extra_2_params
            --reference_database_id $select_tool.reference_database_id
        #end if
        
        $report
    ]]>    </command>

    <inputs>
        <param name="report" type="data" format="txt,tabular,tsv" label="Report file"/>
        <conditional name="select_tool">
            <param name="tool" type="select" label="Tool">
                <option value="abricate" selected="true">abricate</option>
                <option value="amrfinderplus">amrfinderplus</option>
                <option value="ariba">ariba</option>
                <option value="rgi">rgi</option>
                <option value="resfinder">resfinder</option>
                <option value="resfinder4">resfinder4</option>
                <option value="srax">srax</option>
                <option value="deeparg">deeparg</option>
                <option value="kmerresistance">kmerresistance</option>
                <option value="srst2">srst2</option>
                <option value="staramr">staramr</option>
                <option value="csstar">csstar</option>
                <option value="amrplusplus">amrplusplus</option>
                <option value="resfams">resfams</option>
                <option value="groot">groot</option>
            </param>
            <when value="abricate" />
            <when value="resfinder" />
            <when value="staramr" />
            <when value="amrfinderplus">
                <expand macro="input_file_name"/>
            </when>

            <when value="ariba">
                <expand macro="input_file_name"/>
                <expand macro="reference_database_id"/>
            </when>

            <when value="rgi">
                <expand macro="input_file_name"/>
            </when>

            <when value="resfinder4">
                <expand macro="input_file_name"/>
            </when>

            <when value="srax">
                <expand macro="input_file_name"/>
                <expand macro="reference_database_id"/>
            </when>

            <when value="deeparg">
                <expand macro="input_file_name"/>
            </when>

            <when value="kmerresistance">
                <expand macro="input_file_name"/>
            </when>

            <when value="srst2">
                <expand macro="input_file_name"/>
            </when>

            <when value="csstar">
                <expand macro="input_file_name"/>
                <expand macro="reference_database_id"/>
            </when>

            <when value="amrplusplus">
                <expand macro="input_file_name"/>
            </when>

            <when value="resfams">
                <expand macro="input_file_name"/>
            </when>

            <when value="groot">
                <expand macro="input_file_name"/>
                <expand macro="reference_database_id"/>
            </when>
        </conditional>
        <param name="output_format" type="select" label="Output format" multiple="false" display="radio">
            <option value="tsv" selected="True">tsv</option>
            <option value="json">json</option>
        </param>
        <param name="analysis_software_version" type="text" label="Analysis software version"></param>
        <param name="reference_database_version" type="text" label="Reference database version"></param>
    </inputs>

    <outputs>
        <data format="tsv" name="output_tsv" label="${tool.name} on ${on_string}: Output" from_work_dir="hamronized.tsv">
            <filter>output_format == "tsv"</filter>
        </data>
        <data format="json" name="output_json" label="${tool.name} on ${on_string}: Output" from_work_dir="hamronized.json">
            <filter>output_format == "json"</filter>
        </data>
    </outputs>
    <tests>
        <!-- abricate -->
        <test expect_num_outputs="1">
            <param name="report" value="abricate/report.tsv" ftype="tsv" />
            <param name="tool" value="abricate" />
            <param name="output_format" value="tsv" />
            <param name="reference_database_version" value="db_v_1" />
            <param name="analysis_software_version" value="tool_v_1" />
            <output name="output_tsv" ftype="tsv" file="hamronized_abricate.tsv" />
        </test>
        <test expect_num_outputs="1">
            <param name="report" value="abricate/report.tsv" ftype="tsv" />
            <param name="tool" value="abricate" />
            <param name="output_format" value="json" />
            <param name="reference_database_version" value="db_v_1" />
            <param name="analysis_software_version" value="tool_v_1" />
            <output name="output_json" ftype="json" file="hamronized_abricate.json" />
        </test>
        <!-- ariba -->
        <test expect_num_outputs="1">
            <param name="report" value="ariba/report.tsv" ftype="tsv" />
            <param name="tool" value="ariba" />
            <param name="output_format" value="tsv" />
            <param name="reference_database_version" value="db_v_1" />
            <param name="analysis_software_version" value="ariba_v1" />
            <param name="input_file_name" value="ariba_report" />
            <param name="reference_database_id" value="dbname" />
            <output name="output_tsv" ftype="tsv" file="hamronized_ariba.tsv" />
        </test>
        <!-- rgi -->
        <test expect_num_outputs="1">
            <param name="report" value="rgi/rgi.txt" ftype="txt" />
            <param name="tool" value="rgi" />
            <param name="output_format" value="tsv" />
            <param name="reference_database_version" value="card_v1" />
            <param name="analysis_software_version" value="rgi_v1" />
            <param name="input_file_name" value="rgi_report" />
            <output name="output_tsv" ftype="tsv" file="hamronized_rgi.tsv" />
        </test>
    </tests>
    <help><![CDATA[
    **What it does**
    Hamronize parse multiple Antimicrobial Resistance Analysis Reports into a common data structure

    **Inputs**
    
    ::

        Tools with hAMRonizable reports:
        {abricate,amrfinderplus,ariba,rgi,resfinder,resfinder4,srax,deeparg,kmerresistance,srst2,staramr,csstar,amrplusplus,resfams,groot}
        abricate            hAMRonize abricate's output report i.e., OUTPUT.tsv
        amrfinderplus       hAMRonize amrfinderplus's output report i.e., OUTPUT.tsv
        ariba               hAMRonize ariba's output report i.e., OUTDIR/OUTPUT.tsv
        rgi                 hAMRonize rgi's output report i.e., OUTPUT.txt or OUTPUT_bwtoutput.gene_mapping_data.txt
        resfinder           hAMRonize resfinder's output report i.e., data_resfinder.json
        resfinder4          hAMRonize resfinder4's tabular output report i.e., ResFinder_results_tab.txt
        srax                hAMRonize srax's output report i.e., sraX_detected_ARGs.tsv
        deeparg             hAMRonize deeparg's output report i.e., OUTDIR/OUTPUT.mapping.ARG
        kmerresistance      hAMRonize kmerresistance's output report i.e., OUTPUT.KmerRes
        srst2               hAMRonize srst2's output report i.e., OUTPUT_srst2_report.tsv
        staramr             hAMRonize staramr's output report i.e., resfinder.tsv
        csstar              hAMRonize csstar's output report i.e., OUTPUT.tsv
        amrplusplus         hAMRonize amrplusplus's output report i.e., gene.tsv
        resfams             hAMRonize resfams's output report i.e., resfams.tblout
        groot               hAMRonize groot's output report i.e., OUTPUT.tsv (from `groot report`)
    


    ::
    
    More: https://github.com/pha4ge/hAMRonization/#usage

    ]]>    </help>
</tool>