<tool id="FROGS_Stat" name="FROGS Stat" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" python_template_version="3.5" profile="24.0">
    <description>Analysis of community structure, composition, and differential abundances</description>
    <macros>
        <import>frogs_stat_macros.xml</import>
        <import>phyloseq_import_macros.xml</import>
        <import>phyloseq_composition_macros.xml</import>
        <import>phyloseq_alpha_diversity_macros.xml</import>
        <import>phyloseq_beta_diversity_macros.xml</import>
        <import>phyloseq_clustering_macros.xml</import>
        <import>phyloseq_structure_macros.xml</import>
        <import>phyloseq_manova_macros.xml</import>
        <import>deseq2_preprocess_macros.xml</import>
        <import>deseq2_visualisation_macros.xml</import>
    </macros>

    <expand macro="frogs_stat_requirements" />

    <command detect_errors="exit_code"><![CDATA[
        #if $frogs_stat_tools.tool_name == "phyloseq_import":
            @PHYLOSEQ_IMPORT_CMD_LINE@

        #elif $frogs_stat_tools.tool_name == "phyloseq_composition":
            @PHYLOSEQ_COMPOSITION_CMD_LINE@

        #elif $frogs_stat_tools.tool_name == "phyloseq_alpha_diversity":
            @PHYLOSEQ_ALPHA_DIVERSITY_CMD_LINE@

        #elif $frogs_stat_tools.tool_name == "phyloseq_beta_diversity":
            @PHYLOSEQ_BETA_DIVERSITY_CMD_LINE@

        #elif $frogs_stat_tools.tool_name == "phyloseq_clustering":
            @PHYLOSEQ_CLUSTERING_CMD_LINE@

        #elif $frogs_stat_tools.tool_name == "phyloseq_structure":
            @PHYLOSEQ_STRUCTURE_CMD_LINE@

        #elif $frogs_stat_tools.tool_name == "phyloseq_manova":
            @PHYLOSEQ_MANOVA_CMD_LINE@

        #elif $frogs_stat_tools.tool_name == "deseq2_asv_preprocess":   
            @DESEQ2_ASV_PREPROCESS_CMD_LINE@
        
        #elif $frogs_stat_tools.tool_name == "deseq2_fun_preprocess":   
            @DESEQ2_FUN_PREPROCESS_CMD_LINE@
        
        #elif $frogs_stat_tools.tool_name == "deseq2_asv_visualisation":   
            @DESEQ2_ASV_VISUALISATION_CMD_LINE@

        #elif $frogs_stat_tools.tool_name == "deseq2_fun_visualisation":   
            @DESEQ2_FUN_VISUALISATION_CMD_LINE@
        #end if
    ]]>
    </command>
    
    <inputs>
        <conditional name="frogs_stat_tools">
            <param name="tool_name" type="select" display="radio" label="Select a tool from the FROGS Stat suite to run your analysis.">
                <option value="" selected="true">-- Please select a tool --</option>
                <option value="phyloseq_import">Phyloseq: Import data</option>
                <option value="phyloseq_composition">Phyloseq: Taxonomic composition analysis</option>
                <option value="phyloseq_alpha_diversity">Phyloseq: Alpha diversity analysis</option>
                <option value="phyloseq_beta_diversity">Phyloseq: Beta diversity analysis</option>
                <option value="phyloseq_clustering">Phyloseq: Sample clustering analysis</option>
                <option value="phyloseq_structure">Phyloseq: Structure analysis (based on ordination methods)</option>
                <option value="phyloseq_manova">Phyloseq: Multivariate Analysis of Variance</option>
                <option value="deseq2_asv_preprocess">DESeq2: Preprocess for differential analysis of ASV</option>
                <option value="deseq2_fun_preprocess">DESeq2: Preprocess for differential analysis of FUNCTION</option>
                <option value="deseq2_asv_visualisation">DESeq2: Visualisation of differential analysis of ASV</option>                
                <option value="deseq2_fun_visualisation">DESeq2: Visualisation of differential analysis of FUNCTION</option>      
            </param>
            <when value=""/>
            <!-- ##################### phyloseq_import  ##################### -->
            <when value="phyloseq_import">
                <expand macro="phyloseq_import_inputs" />
            </when>
            <!-- ##################### phyloseq_composition  ##################### -->
            <when value="phyloseq_composition">
                <expand macro="phyloseq_composition_inputs" />
            </when>
            <!-- ##################### phyloseq_alpha_diversity  ##################### -->
            <when value="phyloseq_alpha_diversity">
                <expand macro="phyloseq_alpha_diversity_inputs" />
            </when>
            <!-- ##################### phyloseq_beta_diversity  ##################### -->
            <when value="phyloseq_beta_diversity">
                <expand macro="phyloseq_beta_diversity_inputs" />
            </when>
            <!-- ##################### phyloseq_clustering  ##################### -->
            <when value="phyloseq_clustering">
                <expand macro="phyloseq_clustering_inputs" />
            </when>
            <!-- ##################### phyloseq_structure  ##################### -->
            <when value="phyloseq_structure">
                <expand macro="phyloseq_structure_inputs" />
            </when>
            <!-- ##################### phyloseq_manova  ##################### -->
            <when value="phyloseq_manova">
                <expand macro="phyloseq_manova_inputs" />
            </when>            
            <!-- ##################### deseq2 preprocess on ASV ##################### -->
            <when value="deseq2_asv_preprocess">
                <expand macro="deseq2_asv_preprocess_inputs" />
            </when>
            <!-- ##################### deseq2 preprocess on Functions ##################### -->
            <when value="deseq2_fun_preprocess">
                <expand macro="deseq2_fun_preprocess_inputs" />
            </when>
            <!-- ##################### deseq2 visualisation on ASV ##################### -->
            <when value="deseq2_asv_visualisation">
                <expand macro="deseq2_asv_visualisation_inputs" />
            </when>
            <!-- ##################### deseq2 visualisation on Functions ##################### -->
            <when value="deseq2_fun_visualisation">
                <expand macro="deseq2_fun_visualisation_inputs" />
            </when>
        </conditional>
    </inputs>
    
    <outputs>
        <expand macro="frogs_stat_outputs" />
    </outputs>
    
    <tests>
        <!-- ##################### 1 phyloseq_import ##################### -->
        <test expect_num_outputs="2">
            <conditional name="frogs_stat_tools">
                <param name="tool_name" value="phyloseq_import"/>
                <expand macro="phyloseq_import_test_input"/>
            </conditional>
            <expand macro="phyloseq_import_test_output"/>
        </test>
        <!-- ##################### 2 phyloseq_composition ##################### -->
        <test expect_num_outputs="1">
            <conditional name="frogs_stat_tools">
                <param name="tool_name" value="phyloseq_composition"/>
                <expand macro="phyloseq_composition_test_input"/>
            </conditional>
            <expand macro="phyloseq_composition_test_output"/>
        </test>
        <!-- ##################### 3 phyloseq_alpha_diversity ##################### -->
        <test expect_num_outputs="2">
            <conditional name="frogs_stat_tools">
                <param name="tool_name" value="phyloseq_alpha_diversity"/>
                <expand macro="phyloseq_alpha_diversity_test_input"/>
            </conditional>
            <expand macro="phyloseq_alpha_diversity_test_output"/>
        </test>        
        <!-- ##################### 4 phyloseq_beta_diversity ##################### -->
        <test expect_num_outputs="1">
            <conditional name="frogs_stat_tools">
                <param name="tool_name" value="phyloseq_beta_diversity"/>
                <expand macro="phyloseq_beta_diversity_test_input"/>
            </conditional>
            <expand macro="phyloseq_beta_diversity_test_output"/>
        </test>        
        <!-- ##################### 5 phyloseq_clustering ##################### -->
        <test expect_num_outputs="1">
            <conditional name="frogs_stat_tools">
                <param name="tool_name" value="phyloseq_clustering"/>
                <expand macro="phyloseq_clustering_test_input"/>
            </conditional>
            <expand macro="phyloseq_clustering_test_output"/>
        </test>        
        <!-- ##################### 6 phyloseq_structure ##################### -->
        <test expect_num_outputs="1">
            <conditional name="frogs_stat_tools">
                <param name="tool_name" value="phyloseq_structure"/>
                <expand macro="phyloseq_structure_test_input"/>
            </conditional>
            <expand macro="phyloseq_structure_test_output"/>
        </test>  
        <!-- ##################### 7 phyloseq_manova ##################### -->
        <test expect_num_outputs="1">
            <conditional name="frogs_stat_tools">
                <param name="tool_name" value="phyloseq_manova"/>
                <expand macro="phyloseq_manova_test_input"/>
            </conditional>
            <expand macro="phyloseq_manova_test_output"/>
        </test> 
        <!-- ##################### 8 deseq2_asv_preprocess ##################### -->
        <test expect_num_outputs="1">
            <conditional name="frogs_stat_tools">
                <param name="tool_name" value="deseq2_asv_preprocess"/>
                <expand macro="deseq2_asv_preprocess_test_input"/>
            </conditional>
            <expand macro="deseq2_asv_preprocess_test_output"/>
        </test>
        <!-- ##################### 9 deseq2_fun_preprocess ##################### -->
        <test expect_num_outputs="2">
            <conditional name="frogs_stat_tools">
                <param name="tool_name" value="deseq2_fun_preprocess"/>
                <expand macro="deseq2_fun_preprocess_test_input"/>
            </conditional>
            <expand macro="deseq2_fun_preprocess_test_output"/>
        </test> 
        <!-- ##################### 10 deseq2_asv_visualisation ##################### -->
        <test expect_num_outputs="1">
            <conditional name="frogs_stat_tools">
                <param name="tool_name" value="deseq2_asv_visualisation"/>
                <expand macro="deseq2_asv_visualisation_test_input"/>
            </conditional>
            <expand macro="deseq2_asv_visualisation_test_output"/>
        </test>
        <!-- ##################### 11 deseq2_fun_visualisation ##################### -->
        <test expect_num_outputs="3">
            <conditional name="frogs_stat_tools">
                <param name="tool_name" value="deseq2_fun_visualisation"/>
                <expand macro="deseq2_fun_visualisation_test_input"/>
            </conditional>
            <expand macro="deseq2_fun_visualisation_test_output"/>
        </test> 
    </tests>

    <help><![CDATA[
    For more information and detailed documentation, visit the FROGS website https://frogs.inrae.fr.
    ]]>
    </help>

    <citations>
        <citation type="doi">10.1093/bioinformatics/btx791</citation>
        <citation type="doi">10.1093/bib/bbab318</citation>
    </citations>

</tool>
