<?xml version="1.0"?>
<macros>

    <token name="@TOOL_VERSION@">5.1.0</token>
    <token name="@VERSION_SUFFIX@">0</token>

    <xml name="frogs_stat_requirements">
        <requirements>
            <requirement type="package" version="@TOOL_VERSION@">frogs</requirement>
            <requirement type="package" version="4.1.2">r-base</requirement>
            <requirement type="package" version="1.38.0">bioconductor-phyloseq</requirement>
            <requirement type="package" version="4.1">r-essentials</requirement>
            <requirement type="package" version="4.9.3">r-plotly</requirement>
            <requirement type="package" version="1.34.0">bioconductor-deseq2</requirement>
            <requirement type="package" version="2.3">r-gridextra</requirement>
            <requirement type="package" version="0.18">r-dt</requirement>
            <requirement type="package" version="1.6.6">r-optparse</requirement>
            <requirement type="package" version="1.2.2">r-sessioninfo</requirement>
            <yield />
        </requirements>
    </xml>

<xml name="restricted_sanitizer_validator">
        <sanitizer invalid_char="">
            <valid initial="string.letters,string.digits">
                <add value="-" />
                <add value=" " />
                <add value="_" />
                <add value="." />
            </valid>
        </sanitizer>
        <validator type="regex">[A-Za-z0-9- _.]+</validator>
    </xml>

    <xml name="lenient_sanitizer_validator">
        <sanitizer invalid_char="">
            <valid initial="string.letters,string.digits">
                <add value="+" />
                <add value="*" />
                <add value="-" />
                <add value="=" />
                <add value=" " />
                <add value="_" />
                <add value="," />
                <add value="." />
            </valid>
        </sanitizer>
        <validator type="regex">[A-Za-z0-9+*-= _,.]+</validator>
    </xml>

    <xml name="frogs_stat_outputs">
        <!-- HTML report : all but deseq2_preprocess -->
        <data format="html" name="html" label="${tool.name} - ${tool_name}: report.nb.html" >
            <filter>frogs_stat_tools['tool_name'] != 'deseq2_asv_preprocess' and frogs_stat_tools['tool_name'] != 'deseq2_fun_preprocess'</filter>
            <!-- Beta diversity matrix (to discover): phyloseq_beta_diversity -->
            <discover_datasets pattern="__designation__" ext="tsv" directory="BetaMatrix" visible="true"/>
        </data>
        <!-- Alpha diversity index : phyloseq_alpha_diversity -->
        <data format="tsv" name="alpha_div_tsv" label="${tool.name} - ${tool_name}: indices.tsv" >
            <filter>frogs_stat_tools['tool_name'] == 'phyloseq_alpha_diversity'</filter>
        </data>
        <!-- Phyloseq Rdata : based on ASV by phyloseq_import, based on Function by deseq2_fun_preprocess -->
        <data format="rdata" name="ASV_phyloseq_rdata" label="${tool.name} - ${tool_name}: phyloseq_asv.Rdata" >
            <filter>frogs_stat_tools['tool_name'] == 'phyloseq_import'</filter>
        </data>
        <data format="rdata" name="FUN_phyloseq_rdata" label="${tool.name} - ${tool_name}: phyloseq_fun.Rdata" >
            <filter>frogs_stat_tools['tool_name'] == 'deseq2_fun_preprocess' </filter>
        </data>
        <!-- DESeq Rdata : based on ASV by deseq2_asv_preprocess, based on Function by deseq2_fun_preprocess -->
        <data format="rdata" name="ASV_deseq_rdata" label="${tool.name} - ${tool_name}: deseq_asv.Rdata" >
            <filter>frogs_stat_tools['tool_name'] == 'deseq2_asv_preprocess' </filter>
        </data>
        <data format="rdata" name="FUN_deseq_rdata" label="${tool.name} - ${tool_name}: deseq_fun.Rdata" >
            <filter>frogs_stat_tools['tool_name'] == 'deseq2_fun_preprocess'</filter>
        </data>
        <!-- Ipath3 inputs : deseq2_fun_visualisation -->
        <data format="txt" name="Function_over_abund" label="${tool.name}- ${tool_name}: ipath_over.txt" from_work_dir="ipath_over.tsv">
            <filter>frogs_stat_tools['tool_name'] == 'deseq2_fun_visualisation'</filter>
        </data>
        <data format="txt" name="Function_under_abund" label="${tool.name}- ${tool_name}: ipath_under.txt" from_work_dir="ipath_under.tsv">
            <filter>frogs_stat_tools['tool_name'] == 'deseq2_fun_visualisation'</filter>
        </data>
    </xml>
</macros>