view drhip.xml @ 0:dd2d60b55e0d draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/drhip commit 15c654c3d27df68a47483031961ace7f5b8d998d
author iuc
date Thu, 04 Dec 2025 15:05:26 +0000
parents
children
line wrap: on
line source

<tool id="drhip" name="DRHIP" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@">
    <description>Data Reduction for HyPhy with Inference Processing</description>
    <macros>
        <token name="@TOOL_VERSION@">0.1.4</token>
        <token name="@VERSION_SUFFIX@">0</token>
        <token name="@PROFILE@">25.0</token>
    </macros>
    <requirements>
        <requirement type="package" version="@TOOL_VERSION@">drhip</requirement>
    </requirements>
    <version_command>drhip --version</version_command>
    <command detect_errors="exit_code"><![CDATA[
        mkdir -p hyphy_input

        ## For each method, create directory + link files with pattern: gene.METHOD.json
        #if $busted_files
            && mkdir -p hyphy_input/BUSTED
            #for $file in $busted_files
                && ln -s '${file}' 'hyphy_input/BUSTED/${file.element_identifier}.BUSTED.json'
            #end for
        #end if

        #if $fel_files
            && mkdir -p hyphy_input/FEL
            #for $file in $fel_files
                && ln -s '${file}' 'hyphy_input/FEL/${file.element_identifier}.FEL.json'
            #end for
        #end if

        #if $meme_files
            && mkdir -p hyphy_input/MEME
            #for $file in $meme_files
                && ln -s '${file}' 'hyphy_input/MEME/${file.element_identifier}.MEME.json'
            #end for
        #end if

        #if $prime_files
            && mkdir -p hyphy_input/PRIME
            #for $file in $prime_files
                && ln -s '${file}' 'hyphy_input/PRIME/${file.element_identifier}.PRIME.json'
            #end for
        #end if

        #if $relax_files
            && mkdir -p hyphy_input/RELAX
            #for $file in $relax_files
                && ln -s '${file}' 'hyphy_input/RELAX/${file.element_identifier}.RELAX.json'
            #end for
        #end if

        #if $contrastfel_files
            && mkdir -p hyphy_input/CONTRASTFEL
            #for $file in $contrastfel_files
                && ln -s '${file}' 'hyphy_input/CONTRASTFEL/${file.element_identifier}.CONTRASTFEL.json'
            #end for
        #end if

        ## Run DRHIP with tabular output
        && drhip
            --input hyphy_input
            --output output_dir
            --tabular
    ]]></command>
    <inputs>
        <param name="busted_files" type="data" format="hyphy_results.json" multiple="true" optional="true" 
               label="BUSTED results" 
               help="HyPhy BUSTED JSON result(s). Element identifier is used as gene name."/>
        <param name="fel_files" type="data" format="hyphy_results.json" multiple="true" optional="true" 
               label="FEL results" 
               help="HyPhy FEL JSON result(s). Element identifier is used as gene name."/>
        <param name="meme_files" type="data" format="hyphy_results.json" multiple="true" optional="true" 
               label="MEME results" 
               help="HyPhy MEME JSON result(s). Element identifier is used as gene name."/>
        <param name="prime_files" type="data" format="hyphy_results.json" multiple="true" optional="true" 
               label="PRIME results" 
               help="HyPhy PRIME JSON result(s). Element identifier is used as gene name."/>
        <param name="relax_files" type="data" format="hyphy_results.json" multiple="true" optional="true" 
               label="RELAX results" 
               help="HyPhy RELAX JSON result(s). Required for comparison group analyses. Element identifier is used as gene name."/>
        <param name="contrastfel_files" type="data" format="hyphy_results.json" multiple="true" optional="true" 
               label="Contrast-FEL results" 
               help="HyPhy Contrast-FEL result(s). Required for comparison group analyses. Element identifier is used as gene name."/>
    </inputs>
    <outputs>
        <data name="combined_summary" format="tabular" from_work_dir="output_dir/combined_summary.tab" 
              label="${tool.name} on ${on_string}: Combined Summary"/>
        <data name="combined_sites" format="tabular" from_work_dir="output_dir/combined_sites.tab" 
              label="${tool.name} on ${on_string}: Combined Sites"/>
        <data name="combined_comparison_summary" format="tabular" from_work_dir="output_dir/combined_comparison_summary.tab" 
              label="${tool.name} on ${on_string}: Combined Comparison Summary">
            <filter>relax_files or contrastfel_files</filter>
        </data>
        <data name="combined_comparison_site" format="tabular" from_work_dir="output_dir/combined_comparison_site.tab" 
              label="${tool.name} on ${on_string}: Combined Comparison Site">
            <filter>relax_files or contrastfel_files</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="2">
            <param name="busted_files" value="BUSTED/gene1.json" ftype="hyphy_results.json"/>
            <param name="fel_files" value="FEL/gene1.json" ftype="hyphy_results.json"/>
            <param name="meme_files" value="MEME/gene1.json" ftype="hyphy_results.json"/>
            <param name="prime_files" value="PRIME/gene1.json" ftype="hyphy_results.json"/>
            <output name="combined_summary" ftype="tabular">
                <assert_contents>
                    <has_text text="gene" />
                    <has_text text="BUSTED" />
                    <has_text text="gene1.json" />
                    <has_text text="pval" />
                    <has_text text="omega" />
                    <has_n_lines n="2" />
                    <has_n_columns n="9"/>
                </assert_contents>
            </output>
            <output name="combined_sites" ftype="tabular">
                <assert_contents>
                    <has_text text="gene" />
                    <has_text text="site" />
                    <has_text text="gene1.json" />
                    <has_text text="fel_selection" />
                    <has_text text="meme_marker" />
                    <has_text text="prime_marker" />
                    <has_n_lines n="101" />
                    <has_n_columns n="8"/>
                </assert_contents>
            </output>
        </test>
        <test expect_num_outputs="4">
            <param name="busted_files" value="BUSTED/gene2.json" ftype="hyphy_results.json"/>
            <param name="fel_files" value="FEL/gene2.json" ftype="hyphy_results.json"/>
            <param name="meme_files" value="MEME/gene2.json" ftype="hyphy_results.json"/>
            <param name="prime_files" value="PRIME/gene2.json" ftype="hyphy_results.json"/>
            <param name="relax_files" value="RELAX/gene2.json" ftype="hyphy_results.json"/>
            <param name="contrastfel_files" value="CONTRASTFEL/gene2.json" ftype="hyphy_results.json"/>
            <output name="combined_summary" ftype="tabular">
                <assert_contents>
                    <has_text text="gene" />
                    <has_text text="BUSTED" />
                    <has_text text="RELAX" />
                    <has_text text="gene2.json" />
                    <has_text text="pval" />
                    <has_text text="omega" />
                    <has_n_lines n="2" />
                    <has_n_columns n="12"/>
                </assert_contents>
            </output>
            <output name="combined_sites" ftype="tabular">
                <assert_contents>
                    <has_text text="gene" />
                    <has_text text="site" />
                    <has_text text="gene2.json" />
                    <has_text text="fel_selection" />
                    <has_text text="meme_marker" />
                    <has_text text="prime_marker" />
                    <has_n_lines n="101" />
                    <has_n_columns n="8"/>
                </assert_contents>
            </output>
            <output name="combined_comparison_summary" ftype="tabular">
                <assert_contents>
                    <has_text text="gene" />
                    <has_text text="comparison_group" />
                    <has_text text="gene2.json" />
                    <has_text text="Foreground" />
                    <has_text text="Reference" />
                    <has_text text="background" />
                    <has_n_lines n="4" />
                    <has_n_columns n="6"/>
                </assert_contents>
            </output>
            <output name="combined_comparison_site" ftype="tabular">
                <assert_contents>
                    <has_text text="gene" />
                    <has_text text="site" />
                    <has_text text="comparison_group" />
                    <has_text text="gene2.json" />
                    <has_text text="cfel_beta" />
                    <has_text text="Foreground" />
                    <has_text text="Reference" />
                    <has_n_lines n="301" />
                    <has_n_columns n="8"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    <help><![CDATA[
**DRHIP: Data Reduction for HyPhy with Inference Processing**

Combines results from multiple HyPhy selection analysis methods into unified tabular files.

-----

**What it does**

DRHIP takes JSON outputs from HyPhy selection analysis tools and creates summary tables that combine results across multiple genes and analysis methods.

-----

**Inputs**

DRHIP expects HyPhy JSON result files from one or more of these methods:

- **BUSTED** – Branch-site test for episodic diversifying selection
- **FEL** – Fixed effects likelihood test for selection
- **MEME** – Mixed effects model of evolution
- **PRIME** – Property-informed models of evolution
- **RELAX** (optional) – Test for relaxation/intensification of selection
- **Contrast-FEL** (optional) – Compare selection between groups

At least **one method must have at least one JSON input**. Individual method inputs are marked optional so that:

- You can run DRHIP with any subset of methods (for example, only BUSTED+FEL), and
- If a method fails for some genes but succeeds for others, you can still pass the successful results and DRHIP will report what it can from the available methods.

You can provide:
- Single datasets
- Multiple datasets selected at once
- Dataset collections (for workflow use); element identifiers are used as gene names.

-----

**Outputs**

**Always generated (if corresponding inputs are provided):**
- **Combined Summary** (`tabular`) – Gene-level statistics across all supplied methods
- **Combined Sites** (`tabular`) – Site-level analysis results across all supplied methods

**Generated when RELAX or Contrast-FEL results are provided:**
- **Combined Comparison Summary** (`tabular`) – Group-specific statistics
- **Combined Comparison Site** (`tabular`) – Group-specific site analysis

-----

**Typical usage patterns**

- **Per-gene summary without branch-group comparisons:** provide any subset of BUSTED, FEL, MEME, PRIME results.
- **Branch-group comparisons:** provide the main methods plus RELAX and/or Contrast-FEL to obtain comparison summary and site tables.

-----

**Workflow tips**

- Connect HyPhy tool outputs directly to DRHIP inputs.
- Gene names come from collection element names.
- Rename collection elements to control gene names (for example, remove file extensions).
- Works best with dataset mapping over collections.

-----

**More information**

https://github.com/veg/DRHIP
    ]]></help>
    <citations>
        <citation type="bibtex">
@software{drhip2024,
  author = {Callan, Danielle and Verdonk, Hannah and Kosakovsky Pond, Sergei L},
  title = {DRHIP: Data Reduction for HyPhy with Inference Processing},
  year = {2024},
  url = {https://github.com/veg/DRHIP},
  version = {@TOOL_VERSION@}
}
        </citation>
    </citations>
</tool>