view ideas_genome_tracks.xml @ 87:60ce288eb52f draft

Uploaded
author greg
date Fri, 05 Jan 2018 13:56:36 -0500
parents daeba7e9dd11
children eede58868193
line wrap: on
line source

<tool id="ideas_genome_tracks" name="IDEAS genome tracks" version="1.0.0">
    <description></description>
    <requirements>
        <requirement type="package" version="2.4.27">bedops</requirement>
        <requirement type="package" version="1.10.4">r-data.table</requirement>
         <requirement type="package" version="1.4.4">r-optparse</requirement>
         <requirement type="package" version="332">ucsc-bedtobigbed</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
#import re
#set dbkey = None
#set sanitized_hub_name = $re.sub('\s+', '', str($hub_name), flags=re.UNICODE)
#set sanitized_hub_long_label = str($hub_long_label)[:79]
#set sanitized_hub_short_label = str($hub_short_label)[:16]
#if str($__user__.email) == 'None':
    ## This is needed only if the user is not logged in.
    #set email = "foo@bar.net"
#else:
    #set email = $__user__.email
#end if
#set input_dir_para = "input_dir_para"
#set input_dir_state = "input_dir_state"
#set set_state_name_and_color = $set_state_name_and_color_cond.set_state_name_and_color
#if str($set_state_name_and_color) == 'yes':
    #set state_repeat = $set_state_name_and_color_cond.state_repeat
    #set state_indexes = list()
    #set state_names = list()
    #set state_colors = list()
    #for $items in $state_repeat:
        $state_indexes.append(str($items.state_index))
        $state_names.append(str($items.state_name))
        $state_colors.append(str($items.state_color))
    #end for
    #set state_indexes = ",".join($state_indexes)
    #set state_names = ",".join($state_names)
    #set state_colors = ",".join($state_colors)
#end if
mkdir $input_dir_para &&
mkdir $input_dir_state &&
mkdir '$output_trackhub.files_path' &&
#for $i in $input:
    #if $dbkey is None:
        #set dbkey = $i.metadata.dbkey
    #end if
    #set filename = $i.file_name
    #set name = $i.name
    #if $name.endswith(".para"):
        ln -s $filename $input_dir_para/$name &&
    #else if $name.endswith(".state"):
        ln -s $filename $input_dir_state/$name &&
    #end if
#end for
Rscript '$__tool_directory__/ideas_genome_tracks.R'
--build $dbkey
--chrom_len_file '$chromInfo'
--email '$email'
--galaxy_url $galaxy_url
--hub_name '$hub_name'
--input_dir_para '$input_dir_para'
--input_dir_state '$input_dir_state'
--hub_long_label '$sanitized_hub_long_label'
--output_trackhub '$output_trackhub'
--output_trackhub_files_path '$output_trackhub.files_path'
--output_trackhub_id '$__app__.security.encode_id($output_trackhub.id)'
--script_dir '$__tool_directory__'
--hub_short_label '$sanitized_hub_short_label'
#if str($set_state_name_and_color) == 'yes':
    --state_indexes '$state_indexes'
    --state_names '$state_names'
    --state_colors '$state_colors'
#end if
&>ideas_genome_tracks.log;
if [[ $? -ne 0 ]]; then
    cp ideas_log.txt '$output_trackhub'
    exit 1;
fi
    ]]></command>
    <inputs>
        <param name="galaxy_url" type="baseurl" value="/"/>
        <param name="input" format="txt" type="data_collection" collection_type="list" label="IDEAS files"/>
        <param name="hub_name" type="text" value="" label="Hub name" help="All white space characters will be eliminated">
            <validator type="empty_field"/>
        </param>
        <param name="hub_short_label" type="text" value="short label" label="Hub short label" help="Limit to 17 characters">
            <validator type="empty_field"/>
        </param>
        <param name="hub_long_label" type="text" value="long label" label="Hub long label" help="Limit to 80 characters">
            <validator type="empty_field"/>
        </param>
        <conditional name="set_state_name_and_color_cond">
            <param name="set_state_name_and_color" type="select" label="Specify names and colors for one or more states?">
                <option value="no" selected="true">No</option>
                <option value="yes">Yes</option>
            </param>
            <when value="no" />
            <when value="yes">
                <repeat name="state_repeat" title="Name and color" min="1">
                    <param name="state_index" type="integer" value="" min="0" label="State index" help="Enter the integer index of the state displayed in the IDEAS heatmap">
                        <validator type="empty_field"/>
                    </param>
                    <param name="state_name" type="text" value="use state index" label="State name" help="The default string 'use state index' sets the name to the state index value">
                        <validator type="empty_field"/>
                    </param>
                    <param name="state_color" type="color" label="State color"/>
                </repeat>
            </when>
        </conditional>
    </inputs>
    <outputs>
        <data name="output_trackhub" format="trackhub"/>
    </outputs>
    <tests>
        <test>
            <param name="input">
                <collection type="list">
                    <element name="IDEAS_out.cluster" value="IDEAS_out.cluster" ftype="txt"/>
                    <element name="IDEAS_out.para" value="IDEAS_out.para" ftype="txt"/>
                    <element name="IDEAS_out.profile" value="IDEAS_out.profile" ftype="txt"/>
                    <element name="IDEAS_out.state" value="IDEAS_out.state" ftype="txt"/>
                </collection>
            </param>
            <param name="hub_name" value="MyHub"/>
            <param name="hub_short_label" value="my short label"/>
            <param name="hub_long_label" value="my long label"/>
            <output name="output_trackhub" file="output_trackhub.html" ftype="trackhub"/>
        </test>
    </tests>
    <help>
**What it does**

-----

**Required options**

    </help>
    <citations>
        <citation type="doi">10.1093/nar/gkw278</citation>
    </citations>
</tool>