view jbrowse_hub.xml @ 5:e762f4b9e4bd draft

planemo upload for repository https://github.com/Yating-L/jbrowse-archive-creator.git commit a3a8cdf5c9b100db56b2534e8718b5fc976435ff
author yating-l
date Fri, 07 Jul 2017 17:21:23 -0400
parents 7e471cdd9e71
children
line wrap: on
line source

<tool id="jbrowse_hub" name="JBrowse Archive Creator" version="1.0.1">
    <description>
        This Galaxy tool is used to prepare your files to be ready for displaying on JBrowse
    </description>

    <requirements>
        <requirement type="package" version="1.2">samtools</requirement>
        <requirement type="package" version="1.9">numpy</requirement>
        <requirement type="package" version="1.68">biopython</requirement>
        <requirement type="package" version="1.0">ucsc_tools_340</requirement>
        <requirement type="package" version="1.12.1">jbrowse_tools</requirement>
    </requirements>

    <stdio>
    </stdio>

    <command detect_errors="exit_code"><![CDATA[
        python $__tool_directory__/jbrowse_hub.py 
        --fasta '$reference' 
        --genome_name '$genome_name'

        #set galaxy_url = str($GALAXY_URL)
        #set $jbrowse_url = galaxy_url.replace("8080", "80")
        --jbrowse_host '$jbrowse_url'
        
        ## json metadata recording from Remi's hub-archive-creator.xml
        #import json
        #set global data_parameter_dict = {}

        ## Function to retrieve the data of the inputs
        #def prepare_json($input_to_prepare, $extra_data_dict={})
            #set false_path = str($input_to_prepare)
            #set name = $input_to_prepare.name

            #set data_dict = {"name": $name}
            #silent data_dict.update($extra_data_dict)

            #silent $data_parameter_dict.update({$false_path: $data_dict})

        #end def

        #for $g in $group
        #for $f in $g.format
            #set track_label =  str($f.formatChoice.label)
            #set group_name = str($g.group_name)
            #set extra_data_dict = {"label" : $track_label, "category" : $group_name} 
            #if $f.formatChoice.format_select == 'bed'
                #set track_color = str($f.formatChoice.track_color)
                #silent extra_data_dict.update({"color" : $track_color})
                #if $f.formatChoice.bedChoice.bed_select == 'bed_generic_option'
                    --bed $f.formatChoice.bedChoice.BED_generic
                    #silent $prepare_json($f.formatChoice.bedChoice.BED_generic, extra_data_dict)
                #elif $f.formatChoice.bedChoice.bed_select == 'bed_simple_repeats_option'
                    --bedSimpleRepeats $f.formatChoice.bedChoice.BED_simple_repeats
                    #silent $prepare_json($f.formatChoice.bedChoice.BED_simple_repeats, extra_data_dict)
                #elif $f.formatChoice.bedChoice.bed_select == 'bed_splice_junctions_option'
                    --bedSpliceJunctions $f.formatChoice.bedChoice.BED_splice_junctions
                    #silent $prepare_json($f.formatChoice.bedChoice.BED_splice_junctions, extra_data_dict)
                #elif $f.formatChoice.bedChoice.bed_select == 'bigpsl'
                    --bigpsl $f.formatChoice.bedChoice.BigPsl
                    #silent $prepare_json($f.formatChoice.bedChoice.BigPsl, extra_data_dict)
                #end if
            #end if
            #if $f.formatChoice.format_select == 'bam'
                --bam $f.formatChoice.BAM
                #silent $prepare_json($f.formatChoice.BAM, extra_data_dict)
            #end if
            #if $f.formatChoice.format_select == 'gff3'
                #set track_color = str($f.formatChoice.track_color)
                #silent extra_data_dict.update({"color" : $track_color})
                #if $f.formatChoice.gff3Choice.gff3_select == 'gff3_generic'
                    --gff3 $f.formatChoice.gff3Choice.GFF3_generic
                    #silent $prepare_json($f.formatChoice.gff3Choice.GFF3_generic, extra_data_dict)
                #elif $f.formatChoice.gff3Choice.gff3_select == 'gff3_transcript'
                    --gff3_transcript $f.formatChoice.gff3Choice.GFF3_transcript
                    #silent $prepare_json($f.formatChoice.gff3Choice.GFF3_transcript, extra_data_dict)
                #elif $f.formatChoice.gff3Choice.gff3_select == 'gff3_mrna'
                    --gff3_mrna $f.formatChoice.gff3Choice.GFF3_mrna
                    #silent $prepare_json($f.formatChoice.gff3Choice.GFF3_mrna, extra_data_dict)
                #end if
            #end if
            #if $f.formatChoice.format_select == 'blastxml'
                --blastxml $f.formatChoice.BlastXML
                #silent $prepare_json($f.formatChoice.BlastXML, extra_data_dict)
            #end if
            #if $f.formatChoice.format_select == 'gtf'
                --gtf $f.formatChoice.GTF
                #set track_color = str($f.formatChoice.track_color)
                #silent extra_data_dict.update({"color" : $track_color})
                #silent $prepare_json($f.formatChoice.GTF, extra_data_dict)
            #end if
            #if $f.formatChoice.format_select == 'bigwig'
                --bigwig $f.formatChoice.BIGWIG
                #set pos_color = str($f.formatChoice.pos_color)
                #set neg_color = str($f.formatChoice.neg_color)
                #silent $extra_data_dict.update({"style" : {"pos_color" : $pos_color, "neg_color" : $neg_color}})
                #silent $prepare_json($f.formatChoice.BIGWIG, extra_data_dict)
            #end if
       #end for
       #end for

       #set all_data_json = json.dumps($data_parameter_dict)
       -j '$all_data_json'
       -e '$output.extra_files_path'
       -o '$output'

    ]]></command>

    <inputs>
        <param name="GALAXY_URL" type="baseurl" value="" />
        <param name="reference" type="data" format="fasta" label="Reference Genome" />
        <param name="genome_name" type="text" size="30" value="unknown" label="Genome name" />
        <repeat name="group" title="New group">
            <param type="text" name="group_name" label="Group name" value="Default group"/>
            <repeat name="format" title="New track">
                <conditional name="formatChoice">
                    <param name="format_select" type="select" label="Format">
                        <option value="bam" selected="true">BAM</option>
                        <option value="bed">BED</option>
                        <option value="blastxml">BlastXML</option>
                        <option value="bigwig">BigWig</option>
                        <option value="gff3">GFF3</option>
                        <option value="gtf">GTF</option>
                    </param>

                    <when value="bam">
                        <param
                                format="bam"
                                name="BAM"
                                type="data"
                                label="BAM File"
                        />
                        <param name="label" type="text" size="30" value = "Sequence Alignment" label="Track name" />
                    </when>     
                    <when value="bed">
                        <conditional name="bedChoice">
                            <param name="bed_select" type="select" label="Bed Choice">
                                <option value="bed_generic_option">BED format</option>
                                <option value="bed_simple_repeats_option">BED Simple repeat (bed4+12 / simpleRepeat.as)</option>
                                <option value="bed_splice_junctions_option">BED Splice junctions (bed12+1 / spliceJunctions.as)</option>
                                <option value="bigpsl">Blat Alignment (bed12+12 / bigPsl.as)</option>
                            </param>
                            <when value="bed_generic_option">
                                <param
                                        format="bed"
                                        name="BED_generic"
                                        type="data"
                                        label="Bed File"
                                />
                            </when>
                            <when value="bed_simple_repeats_option">
                                <param
                                        format="bed"
                                        name="BED_simple_repeats"
                                        type="data"
                                        label="Bed Simple Repeats (Bed4+12) File"
                                />
                            </when>
                            <when value="bed_splice_junctions_option">
                                <param
                                        format="bed"
                                        name="BED_splice_junctions"
                                        type="data"
                                        label="Bed Splice Junctions (Bed12+1) File"
                                />
                            </when>
                            <when value="bigpsl">
                                <param
                                    format="bed"
                                    name="BigPsl"
                                    type="data"
                                    label="Blat Alignments File"
                                />
                            </when>
                        </conditional>
                        <param name="label" type="text" size="30" value="BED file" label="Track name" />
                        <param name="track_color" type="color" label="Track color" value="#daa520">
                            <sanitizer>
                                <valid initial="string.letters,string.digits">
                                    <add value="#"/>
                                </valid>
                            </sanitizer>
                        </param>
                    </when>
                    <when value="blastxml">
                        <param
                                format="blastxml"
                                name="BlastXML"
                                type="data"
                                label="Blast Alignments File"
                        />
                        <param name="label" type="text" size="30" value="Blast Alignment" label="Track name" />
                        <param name="track_color" type="color" label="Track color" value="#daa520">
                            <sanitizer>
                                <valid initial="string.letters,string.digits">
                                    <add value="#"/>
                                </valid>
                            </sanitizer>
                        </param>
                    </when>
                    <when value="bigwig">
                        <param
                                format="bigwig"
                                name="BIGWIG"
                                type="data"
                                label="BIGWIG File"
                        />
                        <param name="label" type="text" size="30" value="Sequence Coverage" label="Track name" />
                        <param name="pos_color" type="color" label="Positive Coverage Color" value="#FFA600">
                            <sanitizer>
                                <valid initial="string.letters,string.digits">
                                    <add value="#"/>
                                </valid>
                            </sanitizer>
                        </param>
                        <param name="neg_color" type="color" label="Negative Coverage Color" value="#005EFF">
                            <sanitizer>
                                <valid initial="string.letters,string.digits">
                                    <add value="#"/>
                                </valid>
                            </sanitizer>
                        </param>
                    </when>
                    <when value="gff3">
                        <conditional name="gff3Choice">
                            <param name="gff3_select" type="select" label="gff3 type">
                                <option value="gff3_generic">GFF3 format</option>
                                <option value="gff3_transcript">GFF3 format output from gene prediction tools (e.g. Augustus), structure: gene->transcription->CDS</option>
                                <option value="gff3_mrna">GFF3 format output from gene prediction tools (e.g. SNAP), structure: gene->mRNA->CDS</option>
                            </param>
                            <when value="gff3_generic">
                                <param
                                        format="gff3"
                                        name="GFF3_generic"
                                        type="data"
                                        label="GFF3 File"
                                />
                            </when>
                            <when value="gff3_transcript">
                                <param
                                        format="gff3"
                                        name="GFF3_transcript"
                                        type="data"
                                        label="GFF3 File from gene prediction"
                                />
                            </when>
                            <when value="gff3_mrna">
                                <param
                                        format="gff3"
                                        name="GFF3_mrna"
                                        type="data"
                                        label="GFF3 File from gene prediction"
                                />
                            </when>
                        </conditional>
                        <param name="label" type="text" size="30" value="Gene Prediction" label="Track name" />
                        <param name="track_color" type="color" label="Track color" value="#daa520">
                            <sanitizer>
                                <valid initial="string.letters,string.digits">
                                    <add value="#"/>
                                </valid>
                            </sanitizer>
                        </param>
                    </when>
                    <when value="gtf">
                        <param
                                format="gtf"
                                name="GTF"
                                type="data"
                                label="GTF File"
                        />
                        <param name="label" type="text" size="30" value="Assembled Transcripts" label="Track name" />
                        <param name="track_color" type="color" label="Track color" value="#daa520">
                            <sanitizer>
                                <valid initial="string.letters,string.digits">
                                    <add value="#"/>
                                </valid>
                            </sanitizer>
                        </param>
                    </when>  
                </conditional>
            </repeat>
        </repeat>
    </inputs>

    <outputs>
        <data format="jbrowsehub" name="output" label="${tool.name}" />
    </outputs>
    <tests>
        <test>
            <param name="reference" value="dbia3/raw/dbia3.fa" />
            <param name="genome_name" value="unknown" />
            <param name="group_name" value="Default group"/>
            <param name="format_select" value="bam" />
            <param name="BAM" value="dbia3/raw/HISAT.bam" />
            <param name="label" value="" />             
            <output name="output" file="JBrowse_Archive_Creator_html.html" />
        </test>
    </tests>
    <help>
        This Galaxy tool will create a tar file which including raw datasets and json datasets that can be used for
        JBrowse visualization.
    </help>
    <citations>
    </citations>
</tool>