<?xml version="1.0"?>
<tool id="hyphy_relax" name="HyPhy-RELAX" version="2.5.0+galaxy0">
  <description>Detect relaxed selection in a codon-based
  phylogenetic framework</description>
  <macros>
    <import>macros.xml</import>
  </macros>
  <expand macro="requirements"/>
  <command detect_errors="exit_code"><![CDATA[
      ln -s '$input_file' relax_input.fa &&
      ln -s '$input_nhx' relax_input.nhx &&
      @HYPHY_INVOCATION@ relax
        --alignment `pwd`/relax_input.fa
        --tree `pwd`/relax_input.nhx
        --models '$analysisType'
        #if $treeAnnotations == "2":
          --test TEST
          --reference REFERENCE
        #else:
          --test TEST
        #end if
        > '$relax_log'
    ]]></command>
  <inputs>
    <expand macro="inputs"/>
    <expand macro="gencode"/>
    <param name="analysisType" type="select" label="Analysis Type">
      <option value="All">All</option>
      <option value="Minimal">Minimal</option>
    </param>
    <param name="treeAnnotations" type="select" label="Tree Annotations">
      <option value="1">TEST only</option>
      <option value="2">TEST and REFERENCE</option>
    </param>
  </inputs>
  <outputs>
    <data name="relax_log" format="txt"/>
    <data name="relax_output" format="hyphy_json_results" from_work_dir="relax_input.fa.RELAX.json"/>
  </outputs>
  <tests>
    <test>
      <param name="input_file" ftype="fasta" value="relax-in1.fa"/>
      <param name="input_nhx" ftype="nhx" value="relax-in1.nhx"/>
      <output name="relax_output" file="relax-out1.json" compare="sim_size"/>
    </test>
  </tests>
  <help><![CDATA[
RELAX (Detect relaxed selection in a codon-based phylogenetic framework)
        ]]></help>
  <expand macro="citations">
    <citation type="doi">10.1093/molbev/msu400</citation>
  </expand>
</tool>
