<?xml version="1.0"?>
<tool id="roi_table" name="ROI Details">
    <description>ROI Details</description>

    <command interpreter="python">
    roi_details.py --in-file $input --out-file "$out_file" --out-dir "$out_file.files_path"
    #if $max_rois    # --max-rois $max_rois #end if
    #if $link_target # --link-target $link_target #end if
    #if $link_type   # --link-type $link_type #end if
    #if $igv_host    # --igv-host $igv_host #end if
    #if $igv_port    # --igv-port $igv_port #end if
    #if $ucsc_org    # --ucsc-org $ucsc_org #end if
    #if $ucsc_db     # --ucsc-db $ucsc_db #end if
    #if $ucsc_chr_prefix # --ucsc-chr-prefix "$ucsc_chr_prefix" #end if
    </command>

    <!--
      Input Files and Parameters
    -->
    <inputs>
        <param name="input" format="roi" type="data"
               label="ROI file to generate details for."/>

        <param name="max_rois" type="integer" value="100"
               label="Maximal total number of records to process. 0 for all." />

        <param name="link_type" type="select" label="Link target.">
            <option value="local_igv" label="Local IGV Instance" />
            <option value="ucsc" label="UCSC Genome Browser" />
        </param>

        <param name="link_target" type="select" label="Open links in.">
            <option value="_blank" selected="true">new window</option>
            <option value="_top">this window</option>
            <option value="">this frame</option>
        </param>

        <param name="igv_host" type="text" label="Host for the IGV link." value="localhost" />
        <param name="igv_port" type="integer" label="Port for the IGV link." value="60151" />

        <param name="ucsc_org" type="text" label="UCSC Genome Browser org value." value="human" />
        <param name="ucsc_db" type="text" label="UCSC Genome Browser db value." value="hg18" />
        <param name="ucsc_chr_prefix" type="text" label="Prefix to add to contig names." value="" />
    </inputs>

    <!--
      Output Files
    -->
    <outputs>
        <data name="out_file" format="html" label="${input.name} Table" />
    </outputs>

    <!--
      Recognize errors by return code and not output to stderr.
    -->
    <stdio>
        <exit_code range="1:" level="fatal" />
        <exit_code range=":-1" level="fatal" />
    </stdio>

    <!--
      Tool Help
    -->
    <help>No help yet.</help>

    <!--
      Dependencies
    -->
    <requirements>
        <requirement type="python-module">Cheetah</requirement>
        <requirement type="python-module">matplotlib</requirement>
    </requirements>
</tool>
