Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tools/drhip/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
categories:
- Phylogenetics
- Sequence Analysis
description: Data Reduction for HyPhy with Inference Processing. A toolkit for analyzing
and summarizing HyPhy evolutionary selection analysis results
long_description: |
DRHIP processes and summarizes evolutionary selection analysis results from HyPhy
across multiple methods (BUSTED, FEL, MEME, PRIME, RELAX, Contrast-FEL) and genes.
It generates combined CSV files with gene-level and site-specific statistics.
name: drhip
owner: iuc
remote_repository_url: https://github.com/galaxyproject/tools-iuc/tree/master/tools/drhip
homepage_url: https://github.com/veg/DRHIP
248 changes: 248 additions & 0 deletions tools/drhip/drhip.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
<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.3</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
&& drhip
--input hyphy_input
--output output_dir
]]></command>
<inputs>
<param name="busted_files" type="data" format="json,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="json,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="json,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="json,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="json,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="json,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="csv" from_work_dir="output_dir/combined_summary.csv"
label="${tool.name} on ${on_string}: Combined Summary"/>
<data name="combined_sites" format="csv" from_work_dir="output_dir/combined_sites.csv"
label="${tool.name} on ${on_string}: Combined Sites"/>
<data name="combined_comparison_summary" format="csv" from_work_dir="output_dir/combined_comparison_summary.csv"
label="${tool.name} on ${on_string}: Combined Comparison Summary">
<filter>relax_files or contrastfel_files</filter>
</data>
<data name="combined_comparison_site" format="csv" from_work_dir="output_dir/combined_comparison_site.csv"
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="json"/>
<param name="fel_files" value="FEL/gene1.json" ftype="json"/>
<param name="meme_files" value="MEME/gene1.json" ftype="json"/>
<param name="prime_files" value="PRIME/gene1.json" ftype="json"/>
<output name="combined_summary">
<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" />
</assert_contents>
</output>
<output name="combined_sites">
<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" />
</assert_contents>
</output>
</test>
<test expect_num_outputs="4">
<param name="busted_files" value="BUSTED/gene2.json" ftype="json"/>
<param name="fel_files" value="FEL/gene2.json" ftype="json"/>
<param name="meme_files" value="MEME/gene2.json" ftype="json"/>
<param name="prime_files" value="PRIME/gene2.json" ftype="json"/>
<param name="relax_files" value="RELAX/gene2.json" ftype="json"/>
<param name="contrastfel_files" value="CONTRASTFEL/gene2.json" ftype="json"/>
<output name="combined_summary">
<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" />
</assert_contents>
</output>
<output name="combined_sites">
<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" />
</assert_contents>
</output>
<output name="combined_comparison_summary">
<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" />
</assert_contents>
</output>
<output name="combined_comparison_site">
<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" />
</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 CSV 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**

Provide one or more JSON result files from these HyPhy 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

You can provide:
- Single files
- Multiple files selected at once
- Collections of files (for workflow use)

-----

**Outputs**

**Always generated:**
- **Combined Summary** - Gene-level statistics for all methods
- **Combined Sites** - Site-specific analysis results

**Generated when RELAX or Contrast-FEL provided:**
- **Combined Comparison Summary** - Group-specific statistics
- **Combined Comparison Site** - Group-specific site analysis

All outputs are CSV files suitable for downstream analysis in R, Python, etc.

-----

**Workflow Tips**

- Connect HyPhy tool outputs directly to DRHIP inputs
- Gene names come from collection element names
- Rename collection elements to control gene names (e.g., 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 = {0.1.3}
}
</citation>
</citations>
</tool>
Loading